当前位置: 首页>>代码示例>>Java>>正文


Java MultiUserChat.getOwners方法代码示例

本文整理汇总了Java中org.jivesoftware.smackx.muc.MultiUserChat.getOwners方法的典型用法代码示例。如果您正苦于以下问题:Java MultiUserChat.getOwners方法的具体用法?Java MultiUserChat.getOwners怎么用?Java MultiUserChat.getOwners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.smackx.muc.MultiUserChat的用法示例。


在下文中一共展示了MultiUserChat.getOwners方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: amIOwner

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的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

示例2: removeOwner

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的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

示例3: removeOwner

import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的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


注:本文中的org.jivesoftware.smackx.muc.MultiUserChat.getOwners方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。