0
votes

We are implementing a chat infrastructure with using ejabberd-16.08 and we've decided to use mod_interact(https://github.com/adamvduke/mod_interact) for sending request to our webservers while the receipant user is offline (so we can send them push notifications)

However when I integrate mod_interact with ejaberd and send a message to one of my offline friends in my roster, I saw that mod_interact sends mod_unavailable message instead of mod_offline message. (I want mod_interact to send mod_offline message because only mod_offline has the proper information to send push notifications)

So I wonder whats the difference between beeing online and beeing unavailable and how can we set that.

P.S: The user I'm trying to send message(Which seems unavailable) was disconnected from server(not specificaly set his/her presence to unavailable)

Thanks

2

2 Answers

0
votes

When the user gets offline means he is disconnected form the server and unavailable behaviour is same as offline .if you want to customize the behaviour of presence unavailable you can. You can visit here to know more.

0
votes

In XMPP there's nothing called offline. User status could be,

unavailable -- Signals that the entity is no longer available for communication.
subscribe -- The sender wishes to subscribe to the recipient's presence.
subscribed -- The sender has allowed the recipient to receive their presence.
unsubscribe -- The sender is unsubscribing from another entity's presence.
unsubscribed -- The subscription request has been denied or a previously-granted subscription has been cancelled.
probe -- A request for an entity's current presence; SHOULD be generated only by a server on behalf of a user.
error -- An error has occurred regarding processing or delivery of a previously-sent presence stanza.

unavailable means user gone offline. But if an online user set custom status as unavailable you also receive unavailable status but in this case user is actually online.

Note : You can use probe to get user's actual status.