use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.
the class Group method editMembersBecameAsync.
public Group editMembersBecameAsync() {
if (getWrappedExt() != null) {
ApiGroupFull e = getWrappedExt();
ApiGroupFull fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), e.getOwnerUid(), new ArrayList<>(), e.getTheme(), e.getAbout(), e.getExt(), true, e.isSharedHistory(), e.getShortName(), e.getPermissions());
fullExt.setUnmappedObjects(e.getUnmappedObjects());
return new Group(getWrapped(), fullExt);
} else {
return this;
}
}
use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.
the class Group method editExtPermissions.
public Group editExtPermissions(long permissions) {
if (getWrappedExt() != null) {
ApiGroupFull e = getWrappedExt();
ApiGroupFull fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), e.getOwnerUid(), e.getMembers(), e.getTheme(), e.getAbout(), e.getExt(), e.isAsyncMembers(), e.isSharedHistory(), e.getShortName(), permissions);
fullExt.setUnmappedObjects(e.getUnmappedObjects());
return new Group(getWrapped(), fullExt);
} else {
return this;
}
}
use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.
the class Group method editHistoryShared.
public Group editHistoryShared() {
if (getWrappedExt() != null) {
ApiGroupFull e = getWrappedExt();
ApiGroupFull fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), e.getOwnerUid(), e.getMembers(), e.getTheme(), e.getAbout(), e.getExt(), e.isAsyncMembers(), true, e.getShortName(), e.getPermissions());
fullExt.setUnmappedObjects(e.getUnmappedObjects());
return new Group(getWrapped(), fullExt);
} else {
return this;
}
}
use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.
the class Group method editAbout.
public Group editAbout(String about) {
if (getWrappedExt() != null) {
ApiGroupFull e = getWrappedExt();
ApiGroupFull fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), e.getOwnerUid(), e.getMembers(), e.getTheme(), about, e.getExt(), e.isAsyncMembers(), e.isSharedHistory(), e.getShortName(), e.getPermissions());
fullExt.setUnmappedObjects(e.getUnmappedObjects());
return new Group(getWrapped(), fullExt);
} else {
return this;
}
}
use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.
the class Group method editMembers.
public Group editMembers(List<ApiMember> added, List<Integer> removed, int count) {
ApiGroupFull fullExt = null;
if (getWrappedExt() != null) {
ApiGroupFull e = getWrappedExt();
ArrayList<ApiMember> nMembers = new ArrayList<>(e.getMembers());
// Remove members
for (Integer i : removed) {
for (ApiMember m : nMembers) {
if (m.getUid() == i) {
nMembers.remove(m);
break;
}
}
}
// Adding members
for (ApiMember a : added) {
for (ApiMember m : nMembers) {
if (m.getUid() == a.getUid()) {
nMembers.remove(m);
break;
}
}
nMembers.add(a);
}
fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), e.getOwnerUid(), nMembers, e.getTheme(), e.getAbout(), e.getExt(), e.isAsyncMembers(), e.isSharedHistory(), e.getShortName(), e.getPermissions());
fullExt.setUnmappedObjects(e.getUnmappedObjects());
}
ApiGroup w = getWrapped();
ApiGroup res = new ApiGroup(w.getId(), w.getAccessHash(), w.getTitle(), w.getAvatar(), count, w.isMember(), w.isHidden(), w.getGroupType(), w.getPermissions(), w.isDeleted(), w.getExt());
return new Group(res, fullExt);
}
Aggregations