Please let me know the ideas for implementing the following scenarios using Smack API.
To retrieve the user’s last presence mode.
For example, if an user sets his presence mode to "dnd", on logging in next time to the server, I like to retrieve his last presence mode i.e., “dnd” to be set in my client application. Its similar to how Gtalk behaves w.r.t this last presence mode.
To retrieve the currently logged in user’s presence info using Smack. I can see methods for retrieving roster’s presence info, but I am unable to find the methods for retrieving presence of the user itself.
Okay I might be wrong here, but I dont think XMPP handles this by default. Pretty sure that googletalk probably handles it by storing recently used statues on their own server. You can code around this by storing this info in some local settings, and then using them again when a user logs in.
Yes, storing in DB or local setting is a workable solution for both questions.
But for question # 2.
I assumed that XMPP supports retrieval of own presence info because Openfire’s Admin Console displays these presence info under “Sessions” tab , which is also client of XMPP.
Well openfire is a server so I’d presume (I could be wrong) that they store recently used status’s much like google talks servers do? It might be worth digging around in the code to see how they do it