powered by Jive Software

How to listen for messages like group destroyed, configuration changed etc


#1

Whenever I tend to destroy a group, i get a message packet similar to

<message from='coven@muclight.shakespeare.lit'
         to='crone1@shakespeare.lit'
         type='groupchat'
         id='destroynotif'>
    <x xmlns='urn:xmpp:muclight:0#affiliations'>
        <user affiliation='none'>crone1@shakespeare.lit</user>
    </x>
    <x xmlns='urn:xmpp:muclight:0#destroy' />
    <body />
</message>

into smack debug logs, but none of my listeners listen to this sort of message, how do i listen for this sort of messages?


#2

That is a job for a StanzaListener

In this particular case you would first create a StanzaFilter for messages with <{urn:xmpp:muclight:0#destroy}x/> extension elements and possibly with a given from address.

Then you register your listener using the filter with

XMPPConnection.add(Sync|Async)StanzaListener(StanzaListener, StanzaFilter)