Java 类org.jivesoftware.smackx.muc.Affiliate 实例源码

项目:spark-svn-mirror    文件:BannedUsers.java   
/**
 * Loads all banned users in a ChatRoom.
 */
public void loadAllBannedUsers() {
    // Clear all elements from model
    listModel.clear();

    Iterator<Affiliate> bannedUsers = null;
    try {
        bannedUsers = chat.getOutcasts().iterator();
    }
    catch (XMPPException e) {
        Log.error("Error loading all banned users", e);
    }

    while (bannedUsers != null && bannedUsers.hasNext()) {
        Affiliate bannedUser = bannedUsers.next();
        ImageIcon icon = SparkRes.getImageIcon(SparkRes.STAR_RED_IMAGE);
        icon.setDescription(bannedUser.getJid());
        listModel.addElement(icon);
    }
}
项目:aceim    文件:XMPPChatListener.java   
boolean amIOwner(MultiUserChat chat) throws XMPPException {
    for (Affiliate aff : chat.getOwners()) {
        if (getInternalService().getService().getEntityAdapter().normalizeJID(aff.getJid()).equals(getInternalService().getService().getProtocolUid())) {
            return true;
        }
    }
    return false;
}
项目:spark-svn-mirror    文件:UserInvitationPane.java   
/**
 * Removes oneself as an owner of the room.
 *
 * @param muc the <code>MultiUserChat</code> of the chat room.
 */
private void removeOwner(MultiUserChat muc) {
    if (muc.isJoined()) {
        // Try and remove myself as an owner if I am one.
        Collection<Affiliate> owners = null;
        try {
            owners = muc.getOwners();
        }
        catch (XMPPException e1) {
            return;
        }

        if (owners == null) {
            return;
        }

        Iterator<Affiliate> iter = owners.iterator();

        List<String> list = new ArrayList<String>();
        while (iter.hasNext()) {
            Affiliate affilitate = iter.next();
            String jid = affilitate.getJid();
            if (!jid.equals(SparkManager.getSessionManager().getBareAddress())) {
                list.add(jid);
            }
        }
        if (list.size() > 0) {
            try {
                Form form = muc.getConfigurationForm().createAnswerForm();
                form.setAnswer("muc#roomconfig_roomowners", list);

                // new DataFormDialog(groupChat, form);
                muc.sendConfigurationForm(form);
            }
            catch (XMPPException e) {
                Log.error(e);
            }
        }
    }
}
项目:spark-svn-mirror    文件:InvitationPane.java   
/**
 * Removes oneself as an owner of the room.
 *
 * @param muc the <code>MultiUserChat</code> of the chat room.
 */
private void removeOwner(MultiUserChat muc) {
    if (muc.isJoined()) {
        // Try and remove myself as an owner if I am one.
        Collection owners = null;
        try {
            owners = muc.getOwners();
        }
        catch (XMPPException e1) {
            return;
        }

        if (owners == null) {
            return;
        }

        Iterator iter = owners.iterator();

        List list = new ArrayList();
        while (iter.hasNext()) {
            Affiliate affilitate = (Affiliate)iter.next();
            String jid = affilitate.getJid();
            if (!jid.equals(SparkManager.getSessionManager().getBareAddress())) {
                list.add(jid);
            }
        }
        if (list.size() > 0) {
            try {
                Form form = muc.getConfigurationForm().createAnswerForm();
                form.setAnswer("muc#roomconfig_roomowners", list);

                // new DataFormDialog(groupChat, form);
                muc.sendConfigurationForm(form);
            }
            catch (XMPPException e) {
                Log.error(e);
            }
        }
    }
}
项目:mangosta-android    文件:ChatActivity.java   
@Override
public void onRoomMembersLoaded(final List<Affiliate> members) {
    super.onRoomMembersLoaded(members);
}
项目:mangosta-android    文件:RoomManagerListener.java   
public void onRoomMembersLoaded(List<Affiliate> members) {

    }