1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-17 08:54:49 +02:00

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.
This commit is contained in:
Anno van Vliet 2016-08-25 12:05:24 +02:00 committed by Florian Schmaus
parent 2b83decc89
commit 47a4856cae

View file

@ -316,7 +316,7 @@ public class MultiUserChat {
connection.addSyncStanzaListener(presenceListener, new AndFilter(fromRoomFilter, connection.addSyncStanzaListener(presenceListener, new AndFilter(fromRoomFilter,
StanzaTypeFilter.PRESENCE)); StanzaTypeFilter.PRESENCE));
connection.addSyncStanzaListener(subjectListener, new AndFilter(fromRoomFilter, connection.addSyncStanzaListener(subjectListener, new AndFilter(fromRoomFilter,
MessageWithSubjectFilter.INSTANCE)); MessageWithSubjectFilter.INSTANCE, new NotFilter(MessageTypeFilter.ERROR)));
connection.addSyncStanzaListener(declinesListener, new AndFilter(new StanzaExtensionFilter(MUCUser.ELEMENT, connection.addSyncStanzaListener(declinesListener, new AndFilter(new StanzaExtensionFilter(MUCUser.ELEMENT,
MUCUser.NAMESPACE), new NotFilter(MessageTypeFilter.ERROR))); MUCUser.NAMESPACE), new NotFilter(MessageTypeFilter.ERROR)));
connection.addPacketInterceptor(presenceInterceptor, new AndFilter(new ToFilter(room), connection.addPacketInterceptor(presenceInterceptor, new AndFilter(new ToFilter(room),