OpenFire - Permanent Group Chat using PubSub

馋奶兔 提交于 2019-12-05 00:16:51

问题


First from this question : Asmack/openfire How do I keep a user permanently in groupchat room

I read that I cannot use MUC to keep the user persistent in the group, they'll automatically leave the group and can rejoin after they come online again, that concept is like IRC like what've been asked in here -> http://community.igniterealtime.org/thread/48020.

Then from the stackoverflow question I read about using pubsub, then I've done some research about pubsub and what I've got is pubsub can persist the user to be in the group even the user is offline but the message flow is more like one directional from the publisher to the subscriber (read-only).

So if I want to create a group chat application can I use pubsub and set all the member to become both publisher and subscriber? or is there any alternative solution?or my understanding of the pubsub and MUC is incorrect? my goal is to create some group chat like in the whatsapp or blackberry messenger group.

Thanks.


回答1:


You can make users permanent in Group chat in MUC by changing the following code of openfire.

File : src/java/org/jivesoftware/openfire/muc/spi/LocalMUCUser.java

change line 547-550:

// TODO Consider that different nodes can be creating and processing this presence at the same time (when 

remote node went down)

removeRole(group);

role.getChatRoom().leaveRoom(role);

TO:

// TODO Consider that different nodes can be creating and processing this presence at the same time (when 

remote node went down)

// TODO Dont remove user from group when they go offline.

//removeRole(group);

//role.getChatRoom().leaveRoom(role);


来源:https://stackoverflow.com/questions/19782876/openfire-permanent-group-chat-using-pubsub

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!