From 47a4856cae10ab095c68ebf637c074762cc53262 Mon Sep 17 00:00:00 2001 From: Anno van Vliet Date: Thu, 25 Aug 2016 12:05:24 +0200 Subject: [PATCH] Filter Errors on Change subject listener. A unauthorized user sents a update room subject message which is rejected by the server. It responds with an error message which is not picked up by the ChangeSubjectListener. --- .../main/java/org/jivesoftware/smackx/muc/MultiUserChat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index c34391ed1..b0e759a9b 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -316,7 +316,7 @@ public class MultiUserChat { connection.addSyncStanzaListener(presenceListener, new AndFilter(fromRoomFilter, StanzaTypeFilter.PRESENCE)); connection.addSyncStanzaListener(subjectListener, new AndFilter(fromRoomFilter, - MessageWithSubjectFilter.INSTANCE)); + MessageWithSubjectFilter.INSTANCE, new NotFilter(MessageTypeFilter.ERROR))); connection.addSyncStanzaListener(declinesListener, new AndFilter(new StanzaExtensionFilter(MUCUser.ELEMENT, MUCUser.NAMESPACE), new NotFilter(MessageTypeFilter.ERROR))); connection.addPacketInterceptor(presenceInterceptor, new AndFilter(new ToFilter(room),