• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Affiliate类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.jivesoftware.smackx.muc.Affiliate的典型用法代码示例。如果您正苦于以下问题:Java Affiliate类的具体用法?Java Affiliate怎么用?Java Affiliate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

Affiliate类属于org.jivesoftware.smackx.muc包,在下文中一共展示了Affiliate类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadAllBannedUsers

点赞 3

import org.jivesoftware.smackx.muc.Affiliate; //导入依赖的package包/类
/**
 * 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);
    }
}
 

开发者ID:visit,
项目名称:spark-svn-mirror,
代码行数:23,
代码来源:BannedUsers.java

示例2: amIOwner

点赞 2

import org.jivesoftware.smackx.muc.Affiliate; //导入依赖的package包/类
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;
}
 

开发者ID:snuk182,
项目名称:aceim,
代码行数:9,
代码来源:XMPPChatListener.java

示例3: removeOwner

点赞 2

import org.jivesoftware.smackx.muc.Affiliate; //导入依赖的package包/类
/**
 * 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);
            }
        }
    }
}
 

开发者ID:visit,
项目名称:spark-svn-mirror,
代码行数:45,
代码来源:UserInvitationPane.java

示例4: removeOwner

点赞 2

import org.jivesoftware.smackx.muc.Affiliate; //导入依赖的package包/类
/**
 * 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);
            }
        }
    }
}
 

开发者ID:visit,
项目名称:spark-svn-mirror,
代码行数:45,
代码来源:InvitationPane.java

示例5: onRoomMembersLoaded

点赞 2

import org.jivesoftware.smackx.muc.Affiliate; //导入依赖的package包/类
@Override
public void onRoomMembersLoaded(final List<Affiliate> members) {
    super.onRoomMembersLoaded(members);
}
 

开发者ID:esl,
项目名称:mangosta-android,
代码行数:5,
代码来源:ChatActivity.java

示例6: onRoomMembersLoaded

点赞 1

import org.jivesoftware.smackx.muc.Affiliate; //导入依赖的package包/类
public void onRoomMembersLoaded(List<Affiliate> members) {

    }
 

开发者ID:esl,
项目名称:mangosta-android,
代码行数:4,
代码来源:RoomManagerListener.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)