/** * Invites another user to the room in which one is an occupant. The invitation * will be sent to the room which in turn will forward the invitation to the invitee.<p> * * If the room is password-protected, the invitee will receive a password to use to join * the room. If the room is members-only, the the invitee may be added to the member list. * * @param user the user to invite to the room.(e.g. hecate@shakespeare.lit) * @param reason the reason why the user is being invited. * @throws NotConnectedException * @throws InterruptedException */ public void invite(EntityBareJid user, String reason) throws NotConnectedException, InterruptedException { invite(new Message(), user, reason); }
MultiUserChat muc = multiUserChatManager.getMultiUserChat("foo@conference.myserver"); muc.invite("jhondoe@myserver","Join this groupchat!");
/** * Invites another user to the room in which one is an occupant. The invitation * will be sent to the room which in turn will forward the invitation to the invitee.<p> * * If the room is password-protected, the invitee will receive a password to use to join * the room. If the room is members-only, the the invitee may be added to the member list. * * @param user the user to invite to the room.(e.g. hecate@shakespeare.lit) * @param reason the reason why the user is being invited. */ public void invite(String user, String reason) { invite(new Message(), user, reason); }
String room = "private-chat-" + UUID.randomUUID().toString(); room = room + "@groupchat.google.com"; MultiUserChat muc = new MultiUserChat(cc, room); muc.join("username", "password"); muc.invite("username", "hi");
/** * Invites another user to the room in which one is an occupant. The invitation * will be sent to the room which in turn will forward the invitation to the invitee.<p> * * If the room is password-protected, the invitee will receive a password to use to join * the room. If the room is members-only, the the invitee may be added to the member list. * * @param user the user to invite to the room.(e.g. hecate@shakespeare.lit) * @param reason the reason why the user is being invited. */ public void invite(String user, String reason) { invite(new Message(), user, reason); }
/** * Invites another user to the room in which one is an occupant. The invitation * will be sent to the room which in turn will forward the invitation to the invitee.<p> * * If the room is password-protected, the invitee will receive a password to use to join * the room. If the room is members-only, the the invitee may be added to the member list. * * @param user the user to invite to the room.(e.g. hecate@shakespeare.lit) * @param reason the reason why the user is being invited. */ public void invite(String user, String reason) { invite(new Message(), user, reason); }
/** * Invites another user to the room in which one is an occupant. The invitation * will be sent to the room which in turn will forward the invitation to the invitee.<p> * * If the room is password-protected, the invitee will receive a password to use to join * the room. If the room is members-only, the the invitee may be added to the member list. * * @param user the user to invite to the room.(e.g. hecate@shakespeare.lit) * @param reason the reason why the user is being invited. */ public void invite(String user, String reason) { invite(new Message(), user, reason); }
private void inviteUser(String s) { try { if (multiUserChat != null) { multiUserChat.invite(s, "hello"); finish(); } } catch (SmackException.NotConnectedException e) { e.printStackTrace(); Toast.makeText(this,e.getMessage(),Toast.LENGTH_LONG).show(); } } }
public void actionPerformed(ActionEvent actionEvent) { String message = invitees.get(selectedUser); EntityFullJid jid = userManager.getJIDFromDisplayName(selectedUser); try { chat.invite(jid.asEntityBareJid(), message); } catch ( SmackException.NotConnectedException | InterruptedException e ) { Log.warning( "Unable to send stanza to " + jid, e ); } } };
MultiUserChat muc = new MultiUserChat(XMPP.getInstance().getConnection(getActivity()), groupname); try { muc.create(StringUtils.parseName(XMPP.getInstance().getConnection(getActivity()).getUser())); muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT)); } catch (XMPPException e) { } catch (NoResponseException e) { e.printStackTrace(); } catch (SmackException e) { e.printStackTrace(); } for (int i = 0; i < alSelectedContacts.size(); i++) { Log.e("tag", "group chating purpose1 ::" + alSelectedContacts.get(i).get("id")); try { muc.invite((alSelectedContacts.get(i).get("id") + "_user") + "@" + XMPP.HOST, alSelectedContacts.get(i).get("id") + "_user"); } catch (NotConnectedException e) { e.printStackTrace(); } } try { muc.sendMessage("New group created"); } catch (NotConnectedException e1) { e1.printStackTrace(); } catch (XMPPException e1) { e1.printStackTrace(); }
@Override public Object construct() { final Set<EntityBareJid> invitedJIDs = new HashSet<>(); final MultiUserChat groupChat = MultiUserChatManager.getInstanceFor( SparkManager.getConnection() ).getMultiUserChat( roomJID ); // Send invitations for ( final EntityBareJid jid : invitees) { try { groupChat.invite(jid, invitation); invitedJIDs.add( jid ); } catch ( SmackException.NotConnectedException | InterruptedException e ) { Log.warning( "Unable to invite " + jid + " to " + roomJID, e ); } } return invitedJIDs; }
/** * Invite a user to this conference room. * * @param jid the jid of the user to invite. * @param message the message to send with the invitation. */ public void inviteUser( EntityBareJid jid, String message ) { message = message != null && !message.isEmpty() ? message : Res.getString( "message.please.join.in.conference" ); try { getMultiUserChat().invite( jid, message ); roomInfo.addInvitee( jid, message ); } catch ( SmackException.NotConnectedException | InterruptedException e ) { Log.warning( "Unable to invite " + jid + " to room " + roomInfo.getName(), e ); } }
chatRoom.getMultiUserChat().invite(jid, message != null ? message : Res.getString("message.please.join.in.conference")); String nickname = SparkManager.getUserManager().getUserNicknameFromJID(jid); chatRoom.getTranscriptWindow().insertNotificationMessage("Invited " + nickname, ChatManager.NOTIFICATION_COLOR);
multiUserChat.invite(jid, message); room.getTranscriptWindow().insertNotificationMessage(Res.getString("message.waiting.for.user.to.join",jid), ChatManager.NOTIFICATION_COLOR);