Search in sources :

Example 6 with ApiGroupFull

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;
    }
}
Also used : ApiGroup(im.actor.core.api.ApiGroup) ApiGroupFull(im.actor.core.api.ApiGroupFull)

Example 7 with ApiGroupFull

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;
    }
}
Also used : ApiGroup(im.actor.core.api.ApiGroup) ApiGroupFull(im.actor.core.api.ApiGroupFull)

Example 8 with ApiGroupFull

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;
    }
}
Also used : ApiGroup(im.actor.core.api.ApiGroup) ApiGroupFull(im.actor.core.api.ApiGroupFull)

Example 9 with ApiGroupFull

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;
    }
}
Also used : ApiGroup(im.actor.core.api.ApiGroup) ApiGroupFull(im.actor.core.api.ApiGroupFull)

Example 10 with ApiGroupFull

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);
}
Also used : ApiGroup(im.actor.core.api.ApiGroup) ApiGroup(im.actor.core.api.ApiGroup) ArrayList(java.util.ArrayList) ApiGroupFull(im.actor.core.api.ApiGroupFull) ApiMember(im.actor.core.api.ApiMember)

Aggregations

ApiGroup (im.actor.core.api.ApiGroup)11 ApiGroupFull (im.actor.core.api.ApiGroupFull)11 ApiMember (im.actor.core.api.ApiMember)2 ArrayList (java.util.ArrayList)2