User status message for iOS chat app - iphone

I am developing an iPhone chat application using robbiehanson/XMPPFramework and I am using OpenFire on the server side. I want to implement the user status feature on my app like the whatsapp status concept.
How can I achieve this, is there any default support on the openfire server for storing the user status messages ?
Thanks in advance

I am not sure what you call 'user status'. You can add information about the presence of the user in presence packets. This is purely transient information and is generally not stored in XMPP server.
You can also decide to publish status information in a more persistent way using Personal Eventing Protocol (PEP). The last status is generally stored by server to be resend / retrieved at a later time.
Reference: http://xmpp.org/extensions/xep-0163.html

Related

how to kick someone from videocall agora with flutter

I'm creating an app for video or voice call with flutter for Android / iOS. And I want to enable someone to kick another from a call. Is there anyone who knows how? any idea?
There are lots of functions in RtcEngine() and I don't know which one would remove another users.
There's a couple of ways that I can think of to do this:
RTM (new name: Signalling)
Using RTM, you could send a message to the user you want to kick, which reacts to logic on the device that then restricts it from rejoining the room. For example, send a plain text message such as "kicked_from:channel-id-here", or a json string if you want to add more complex messages that are decoded by your application:
"{\"action\":\"kick\",\"channel-id\",\"reason\":\"abuse\"}"
This is then saved into a map for example, which then is checked whenever they try to rejoin a channel.
RTM can be found here.
Via Token Server
When kicking someone from your room, you could send a message to your token server with a specific user's ID.
The token server could then revoke that token from joining the channel, resulting in them then leaving the channel. You'd have to then add some logic to either the token server or the client to prevent that user to request a new token and rejoining.

how to get user's skype status

i'm developing an android application that will send notifications to users, one of the ways it notify is via skype, i need to know the user's status to trust that the user is going to read the message since it seems i can send skype messages even when the target user is offline.
im using https://docs.botframework.com/en-us/restapi/connector/ bot's API to send the messages
¿is there anyway to get the current status(online, away, etc..) of an especific skype user?
since it seems they no longer offer "mystatus.skype.com" service.

Setup XMPP server to use other JSON API on webserver for user storage and authentication

We are developing a consumer hardware product. Each device is registered on a central webserver and the owner also have a user account to which the device is linked. The owner may also choose to share the device with other users.
Now, to solve the problem of getting through firewalls etc we are using XMPP: the user access his/her devices using an iOS/Android app. The app connects to the XMPP-server and so does the hardware devices. So the app can access the devices by sending custom XMPP stanzas.
Currently the device and the mobile app use the same JID, so the device will allow messages only from the same bare JID as itself uses. To allow for sharing devices we are planning to use the roster instead: the device will get its own JID ("hw381983829#thexmppserver.com") and will accept stanzas from all JID's in its roster.
The problem I'm having is that the users, devices and device-sharing data are stored on the webserver. I would like to use this same information on the XMPP-server: all users and devices on the webserver are allowed to login to XMPP and the roster of a device is the same as the users that may access it. This information can be accessed through a JSON API.
One way would be to mirror changes as they happen, but I don't like that idea since there are too many steps that could go wrong.
The best solution I can think of is to let the XMPP server use the JSON API instead of its builtin database. It would be read-only, but that is not a problem since all registration and sharing should be done on the webserver.
Any ideas on how to proceed? The functionality described above is more or less all that we need: we don't need S2S, offline messages, etc. We are currently using Ejabberd, but Prosody or Openfire are perhaps better alternatives?
For authentication, it looks like this ejabberd contribution does exactly what you need:
https://github.com/processone/ejabberd-contrib/tree/master/ejabberd_auth_http
For roster, it is easy to write a custom roster module that will be hitting your HTTP backend instead of query the database thanks to ejabberd API.
You can have a look at mod_roster as a guide to implement the methods: https://github.com/processone/ejabberd/blob/master/src/mod_roster.erl

OpenFire + FastPath WebChat - Pre Fill the User Chat Window with ongoing Conversation

Currently I am using Olark for live chat on my website.
I am planning to replace it with an in house OpenFire installation.
However, there is one problem.
With Olark live chat snippet (which I embed on my website) - if a user opens the website in multiple tabs - it's prefilled with the ongoing conversation. For e.g. - you can try it on (moonclerk.com).
How do I achieve the same pre population of chat window with the ongoing conversation with OpenFire + FP WebChat?
The way we achieve it at Olark is not exactly trivial. We don't actually use an XMPP client on the end-user's side, which makes it a bit easier, but basically our transport layer is able to grab conversation events for a conversation in-progress based on a session UUID that is stored in the user's cookies. XMPP isn't involved in that process at all, for us (it is only concerned with final delivery to and from Operators).
I don't know what FastPath's architecture is like, but if you were looking for this functionality, or to add it yourself, XMPP supports retrieving some n number of messages from the message history for a client. Check out XMPPFramework - Retrieve Archived Messages From Openfire Server for more on that.

XMPP: how to request server for presence status of a user's contacts?

We have a site and we developed a chat system for it using strophe.js library and ejabberd XMPP server. We use session attachment that was initiated with PHP (using an in-house library). What we do is get the RID and SID from the PHP script, then use strophe's session attachment. The said RID and SID is stored on a cookie and the RID value on the cookie is updated every update of the RID on strophe.js.
This works fine, after logging in we receive the presence status of each of our contacts. The problem with this is, when you go to another page on the site, and attach using the said RID (we use the incremented value produced by strophe) and SID, the server wouldn't send presence information of your contacts anymore as opposed to when you logged in. This caused our contacts area to appear all invisible even though they are online. They would only appear online if you (or your contact) log out on the chat, then log in again (since you will receive a presence update from the XMPP server).
I have written a workaround where the presence status of your contacts is saved on a cookie (all online contacts will have their JIDs saved on the cookie) when a presence is received from the server. This is checked every page load, if the cookie is set, it will be read, and all JIDs on the cookie will be marked as online. This is working fine but there might be some better ways to solve this, using XMPP's default behaviors.
XMPP servers send presence probes to all your contacts on your behalf when you send your own initial presence to the server. From then on, you will only receive presence status changes from your contacts.
If you lose the presence state of your contacts, you will need to send your own presence probes to re-establish that state. However, this is probably not something you want to do a lot, and passing around the presence state is probably preferred in most cases.
You could try passing the state via XMPP. For example, you could use Private XML Storage (XEP-0049), Pubsub (XEP-0060), or PEP (XEP-0163).
Another option instead of cookies for passing it client side is to use an HTML5 SharedWorker object to hold the state.
I shudder to think of the scale properties associated with storing all of the presence you just received from the server back to the server in private storage. Private storage almost always is backed to long-term storage rather than stored in memory, so you're going to grind your server's disk to dust.
If you want to store more state in the browser, and insulate yourself from browser version, and you're already using jQuery, then jStore is pretty sweet.