1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

Change muc.InvitationListner to use the MUC instance

This commit is contained in:
Florian Schmaus 2014-12-29 22:03:26 +01:00
parent d27ec34fa3
commit ff8720698a
3 changed files with 5 additions and 3 deletions

View file

@ -40,7 +40,7 @@ public interface InvitationListener {
* @param password the password to use when joining the room. * @param password the password to use when joining the room.
* @param message the message used by the inviter to send the invitation. * @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); String password, Message message);
} }

View file

@ -127,8 +127,9 @@ public class MultiUserChatManager extends Manager {
// Check if the MUCUser extension includes an invitation // Check if the MUCUser extension includes an invitation
if (mucUser.getInvite() != null) { if (mucUser.getInvite() != null) {
// Fire event for invitation listeners // Fire event for invitation listeners
MultiUserChat muc = getMultiUserChat(packet.getFrom());
for (InvitationListener listener : invitationsListeners) { 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); mucUser.getInvite().getReason(), mucUser.getPassword(), message);
} }
} }

View file

@ -130,7 +130,8 @@ public class Workgroup {
*/ */
MultiUserChatManager.getInstanceFor(connection).addInvitationListener( MultiUserChatManager.getInstanceFor(connection).addInvitationListener(
new org.jivesoftware.smackx.muc.InvitationListener() { 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) { String reason, String password, Message message) {
inQueue = false; inQueue = false;
queuePosition = -1; queuePosition = -1;