From ff8720698a5b243b943a4f4d41da48d500d0225a Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 29 Dec 2014 22:03:26 +0100 Subject: [PATCH] Change muc.InvitationListner to use the MUC instance --- .../java/org/jivesoftware/smackx/muc/InvitationListener.java | 2 +- .../java/org/jivesoftware/smackx/muc/MultiUserChatManager.java | 3 ++- .../java/org/jivesoftware/smackx/workgroup/user/Workgroup.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/InvitationListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/InvitationListener.java index 26987c32c..cec5de04c 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/InvitationListener.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/InvitationListener.java @@ -40,7 +40,7 @@ public interface InvitationListener { * @param password the password to use when joining the room. * @param message the message used by the inviter to send the invitation. */ - public abstract void invitationReceived(XMPPConnection conn, String room, String inviter, String reason, + public abstract void invitationReceived(XMPPConnection conn, MultiUserChat room, String inviter, String reason, String password, Message message); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java index 1a8e0aeb8..1d0e4c050 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java @@ -127,8 +127,9 @@ public class MultiUserChatManager extends Manager { // Check if the MUCUser extension includes an invitation if (mucUser.getInvite() != null) { // Fire event for invitation listeners + MultiUserChat muc = getMultiUserChat(packet.getFrom()); for (InvitationListener listener : invitationsListeners) { - listener.invitationReceived(connection(), packet.getFrom(), mucUser.getInvite().getFrom(), + listener.invitationReceived(connection(), muc, mucUser.getInvite().getFrom(), mucUser.getInvite().getReason(), mucUser.getPassword(), message); } } diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java index 1d502e86f..2bba746a1 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java @@ -130,7 +130,8 @@ public class Workgroup { */ MultiUserChatManager.getInstanceFor(connection).addInvitationListener( new org.jivesoftware.smackx.muc.InvitationListener() { - public void invitationReceived(XMPPConnection conn, String room, String inviter, + @Override + public void invitationReceived(XMPPConnection conn, org.jivesoftware.smackx.muc.MultiUserChat room, String inviter, String reason, String password, Message message) { inQueue = false; queuePosition = -1;