首先从这个问题:Smack/openfire 如何让用户永久留在群聊室 https://stackoverflow.com/questions/19653877/asmack-openfire-how-do-i-keep-a-user-permanently-in-groupchat-room
我读到我不能使用 MUC 来让用户持续留在组中,他们会自动离开组并可以在再次上线后重新加入,这个概念就像 IRC 就像这里所要求的那样 ->http://community.igniterealtime.org/thread/48020 http://community.igniterealtime.org/thread/48020.
然后从 stackoverflow 问题中我读到了有关使用 pubsub 的信息,然后我对 pubsub 做了一些研究,我得到的是 pubsub 可以将用户保留在组中,即使用户处于离线状态,但消息流更像是一个从发布者到订阅者的定向(只读)。
那么,如果我想创建一个群聊应用程序,我可以使用 pubsub 并将所有成员设置为发布者和订阅者吗?还是有其他解决方案?或者我对 pubsub 和 MUC 的理解不正确?
我的目标是创建一些群组聊天,例如在 Whatsapp 或 Blackberry Messenger 群组中。
Thanks.
您可以通过更改 openfire 的以下代码使用户永久保留在 MUC 的群聊中。
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);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)