5
votes

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
Not 100% sure of what you're trying to do. Are you trying to accomplish keeping a list of users and showing their online status?Mark S
@MarkStraley no, it's no need like that, so I want to create a messenger app where the user can create a group, and the group member will always be in the group and the message will be always delivered in the group, so when the user want to read the group message he/she must open the group chat, do you understand what I mean?Niko Adrianus Yuwono
If I understand you right, Take a look a rosters. You can create groups with rosters. I think some combination of roster groups and pubsub might be what you're after. My first thought would not be MUC. Once you subscribe/authorize in a roster, it stays until removed.Mark S
@MarkStraley Ah I never heard of rosters, I'll research about it first, thanks for your suggestion mark!Niko Adrianus Yuwono
@nayoso how did you do it in the end? I've been stuck in the exact same issue as your's for some weeks now. kindly share your findings.Talha Mir

1 Answers

3
votes

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);