Ejabberd 16.09 Muc Discovery - erlang

We're using IOS XMPP Framework and Android Smack Library to connect our ejabberd server in our mobile application.
Both of them has the similar problem.
When we create the room as admin, we add users to member list by sending ejabberd
<item affiliation='member' jid='xxx#yyy.com'>
Then users can send and receive messages to group without any problem.
And if a user removes the app from device and reinstall it, we are using muc discovery protocol to discover which rooms he/she were joined before he/she uninstall the app
However there is a problem at this point, If a user uses the muc discovery when all the participants of the group became offline. Server doesn't return muc discovery result about that group to user as he/she is a participant of it.
And when I check the admin console those groups seems to have 0 participants(Because all the participants are offline, but they are in the memberlist). And I think muc discovery returns only the groups which have more than 0 participants
Does anyone know why does it happen and how can I find a solution to that? #badlop
We're using ejabberd 16.09

Muc says if user goes offline then he should left all his group, that is why you are not getting group participant when users goes offline.
See here
http://xmpp.org/extensions/xep-0045.html
Instead of using muc use muc-light
https://xmpp.org/extensions/inbox/muc-light.html
It will help you resolve issue and its very easy to implement.

Related

XMPP iOS Framework detect internet disconnection issue with OpenFire server

I have implemented chatting application using XMPP iOS Framework with OpenFire server.
Fortunately, application is running successfully but I am facing one issue of internet disconnection in application.
When user is getting logout or went in offline mode manually then it sends stanza to his/her rosters. So his/her rosters knows that user went in offline mode.
Now when internet will disconnect from user's device at that time application is not able to send presence stanza to server due to internet disconnection. So his/her rosters won't get information about that offline user and user will be shown in online mode only.
I thought something like OpenFire server might be able to check connected users and whenever any user gets disconnected it should send presence stanza with offline status to his rosters so they can know that this user is on offline mode.
Can anybody please help me if there is any way through which I can implement this feature.
It will be very helpful for me to solve this issue.
Thanks in advance.
It's the core xmpp feature and Openfire must send unavailable to your contacts on your behalf. So it looks like a bug.
But there is a different problem - users with mobile internet may reconnect too often, and XMPP community developed a Stream Management extension, which allow server to "hibernate" client session when it quickly reconnect and restore it without presence changes. Summarize:
Check if Stream Management is active - in this case user will still online fixed amount of time (typically 5 minutes) and then go offline.
Check if Openfire implements any non-standard extension to maintain user session.
If you are sure none of extensions are "hibernating" user session - then it is a really bug. Try the same with different xmpp server - good candidates are ejabberd and prosody

Conversations in XMPP

I'm implementing an XMPP Chat and I was wondering if there is any XEP regarding lists of conversations (like WhatsApp). With message archiving, the clients can retrieve the message history with a given user, but if they open the application for the first time, they doesn't know which users they've previously talked to.
I use ejabberd as my server.
Unfortunately, I do not know of such a XEP. Most XMPP systems assume you will have a roster. Then, it's easy to fetch chat history between you and a particular user just by querying the Message Archive (XEP-0313) with that user's JID.
That being said, I also believe a roster-agnostic Chat-partners XEP would be nice to have.

3rd Party Library for chat with syncing to other device

I am working on chat application. I have chat syncing option like skype. suppose I am logged in Device A and I have done chat from this device. now when I logged in Device B at that time all the chat history will be synced in device B.
Problem with XMPP
I have 4 types of chat person to person, person to network, person to business and person to group. In xmpp we cant differentiate the type of chat, as in out local database we have a type field. and I guess in xmpp server database there is no type field to identify the type of chat. so I am looking for 3rd party API for chat.
In XMPP, you can use the specification Message Archive Management to achieve this.
use this https://www.twilio.com/ .this is gives you SDK. Twilio provide service of sms and chatting

Send XMPP message element multiple destinations (Facebook Chat API)

I'm using Facebook Chat API in an iOS app. I already can send a message successfully to a Facebook friend. Now I'm wondering if a can send the same message to multiple recipients.
I don't know if it's technically possible or there's any limitation about that.
I know that I can create N messages for N users and send one by one. But depending on the number of Facebook friends that the user can select, it can take a long time until all the messages are delivered. If this is the only case, should I open one different thread for each message that is going to be sent with the XMPP stream?
I appreciate any resolution or clue for this question.
There's an XMPP extension XEP-0033: Extended Stanza Addressing which supports multicasting messages to multiple recipients. The extension has progressed to draft status, however few XMPP servers or clients support it. I doubt Facebook Chat does, and couldn't find any mention in the XMPPFramework source.
I don't think there's a better way than sending the same message to multiple recipients. Some servers may require you to pause between sending lots of identical messages, and I wouldn't be surprised if that were true of Facebook Chat.
Multi-User Chat is another way to accomplish this with XMPP, but unfortunately Facebook Chat doesn't support MUC.

How to get live scores through a plugin for openfire?

I want to create a new plugin which will send live scores to the xmpp iOS client.
I have already created a new plugin and a service for it, but not getting any idea how to send live scores from openfire server to the xmpp iOS client.
Pls, suggest me something.
Thanks
One way would be to use multi chat. You can create a room for each match. Anyone who wishes to receive live score (or anything for that matter) joins the room. You have a bot that sends the score into the room and everybody who is in the room gets it. You can also configure the room so that it is visitors only and anonymous. See XEP-0045
Another way is the use pubsub. Again every match is a node. Users subscribe to the node. See XEP-0060
I'm not sure about others XMPP servers but IFAIK MUC and pubsub are supported by openfire.

Resources