Search in sources :

Example 1 with ApiGroupFull

use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.

the class Group method editMemberChangedAdmin.

public Group editMemberChangedAdmin(int uid, Boolean isAdmin) {
    if (getWrappedExt() != null) {
        ApiGroupFull e = getWrappedExt();
        ArrayList<ApiMember> nMembers = new ArrayList<>(e.getMembers());
        for (int i = 0; i < nMembers.size(); i++) {
            ApiMember m = nMembers.get(i);
            if (m.getUid() == uid) {
                nMembers.remove(m);
                nMembers.add(i, new ApiMember(m.getUid(), m.getInviterUid(), m.getDate(), isAdmin));
                break;
            }
        }
        ApiGroupFull 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());
        return new Group(getWrapped(), fullExt);
    } else {
        return this;
    }
}
Also used : ApiGroup(im.actor.core.api.ApiGroup) ArrayList(java.util.ArrayList) ApiGroupFull(im.actor.core.api.ApiGroupFull) ApiMember(im.actor.core.api.ApiMember)

Example 2 with ApiGroupFull

use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.

the class Group method editShortName.

public Group editShortName(String shortName) {
    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(), shortName, 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 3 with ApiGroupFull

use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.

the class Group method editOwner.

public Group editOwner(int uid) {
    if (getWrappedExt() != null) {
        ApiGroupFull e = getWrappedExt();
        ApiGroupFull fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), uid, e.getMembers(), e.getTheme(), e.getAbout(), 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 4 with ApiGroupFull

use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.

the class Group method editFullExt.

public Group editFullExt(ApiMapValue ext) {
    if (getWrappedExt() != null) {
        ApiGroupFull e = getWrappedExt();
        ApiGroupFull fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), e.getOwnerUid(), e.getMembers(), e.getTheme(), e.getAbout(), ext, 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 5 with ApiGroupFull

use of im.actor.core.api.ApiGroupFull in project actor-platform by actorapp.

the class Group method editTopic.

// 
// Editing Ext
// 
public Group editTopic(String topic) {
    if (getWrappedExt() != null) {
        ApiGroupFull e = getWrappedExt();
        ApiGroupFull fullExt = new ApiGroupFull(e.getId(), e.getCreateDate(), e.getOwnerUid(), e.getMembers(), topic, e.getAbout(), 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)

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