Listen for new rooms being created

Hello,

Smack 4.1.3

Openfire 3.10.2

I am just wondering is there any way that clients could be notified for any new rooms that are have been created? Without waiting for a room invitation.

For example, another client creates a new room. And all other clients will be notified of this new room?

Many thanks for any suggestions,

There is currently no such function, but it could be fairly easily created via PubSub ( XEP-0060: Publish-Subscribe )

This requires code modifications!

Clientside:

Using the PubSub functionality users, can subscribe to events

  1. Create your own eventtype “MUC_CREATED”

  2. Subscribe to the event via PubSub

Serverside:

In MultiUserChatService listen to chatRoomAdded and publish “MUC_CREATED” via PubSub

This requires code modifications!
I argue that you can do it without modifying Smack by just building the functionality on top of Smack. And I don’t recommend touching any of Smack’s parts, everything you need to do using XMPP should be doable without any code change to Smack already. Otherwise you have to carry you Smack changes over to new Smack release and have to maintain then. The usual burden if you think you need a special version of a library.

Flow:

This requires code modifications!
I argue that you can do it without modifying Smack by just building the functionality on top of Smack.

well yes, the pubsub functionality is already implemented in smack and also openfire.

you’d basically need to create a plugin in OF to listen to new rooms being created and fire the Publish message.

Also you could possibly periodically scan the MUC service for newly created public groupchats, which would only require clientside code

edit: did a quick runthrough, this should do the job:

[Java] Smack Room Discovery - Pastebin.com

(beware untested)