Project

General

Profile

How to get user online state ?

jeff shaw
Added over 2 years ago

Hi All, can some one tell me how to get user's online state ? send an iq or other wise?

thanks alot.


Replies (4)

Added by jeff shaw over 2 years ago

I have a jid list and I want to get online stats.

Added by jeff shaw over 2 years ago

one or more user's state.

Added by Wojciech Kapcia TigaseTeam over 2 years ago

jeff shaw wrote:

Hi All, can some one tell me how to get user's online state ? send an iq or other wise?

You can use Admin Ad-Hoc commands to get information about given JID:

<iq type="set" to="sess-man@{VHost}" id="get-info-1">
    <command xmlns="http://jabber.org/protocol/commands" node="get-user-info">
        <x xmlns="jabber:x:data" type="submit">
            <field type="hidden" var="FORM_TYPE">
                <value>http://jabber.org/protocol/admin</value>
            </field>
            <field type="jid-single" var="accountjid">
                <value>{UserJID}</value>
            </field>
            <field type="boolean" var="Show connected resources in table">
                <value>1</value>
            </field>
        </x>
    </command>
</iq>

However, it will only list connected resources and information to which cluster node the user is connected. It won't include current presence of the given connection.

Added by jeff shaw over 2 years ago

thank you for your reply.

    (1-4/4)