本文整理汇总了Java中org.jivesoftware.smackx.muc.MultiUserChat.invite方法的典型用法代码示例。如果您正苦于以下问题:Java MultiUserChat.invite方法的具体用法?Java MultiUserChat.invite怎么用?Java MultiUserChat.invite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.smackx.muc.MultiUserChat
的用法示例。
在下文中一共展示了MultiUserChat.invite方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendRoomInvite
import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
/**
* Send invites to clients for joining multi user chat room
*
* @param muc
* @param userList
* @param inviteMessage
*/
public void sendRoomInvite(MultiUserChat muc, ArrayList<String> userList, String inviteMessage) {
if (muc != null && muc.getRoom() != null && !muc.getRoom().isEmpty()) {
if (userList != null && !userList.isEmpty()) {
for (String user : userList) {
try {
muc.invite(user, inviteMessage);
} catch (NotConnectedException e) {
e.printStackTrace();
}
}
logger.info(userList.size() + " clients were invited to room(" + muc.getRoom() + ")");
}
} else {
logger.info("There is no available room for invitation");
}
}
示例2: inviteFriend
import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
public void inviteFriend(String roomJid, String user, boolean autoJoin) {
MultiUserChat chat = null;
synchronized (mService.get().mLocker) {
chat = mService.get().mMultiUserChats.get(roomJid);
}
if (chat == null && autoJoin) {
chat = mService.get().initMultiUserChat(roomJid, false);
}
if (chat != null) {
try {
chat.invite(user, "");
} catch (Exception e) {
}
}
}
示例3: invite
import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
private static void invite(MultiUserChat groupChat, GroupChatRoom room, Collection<String> jids, String message) {
if (jids != null && message != null) {
for (String jid : jids) {
groupChat.invite(jid, message);
room.getTranscriptWindow().insertNotificationMessage(
Res.getString("message.waiting.for.user.to.join", jid), ChatManager.NOTIFICATION_COLOR);
}
}
}
示例4: inviteUserAsync
import org.jivesoftware.smackx.muc.MultiUserChat; //导入方法依赖的package包/类
@Override
public void inviteUserAsync(ChatGroup group, Contact invitee) {
String chatRoomJid = group.getAddress().getAddress();
if (mMUCs.containsKey(chatRoomJid))
{
MultiUserChat muc = mMUCs.get(chatRoomJid);
String reason = ""; //no reason for now
muc.invite(invitee.getAddress().getAddress(),reason);
}
}