Home
MatriX vNext
MatriX XMPP SDK ▼
Forum
About us ▼
Contact
Not logged in.
·
Lost password
·
Register
Forum
Search
Members
Forum:
MatriX and XmppDotNet
Get online user from openfire
skhanna
2016-09-14, 20:08
#1
Member since Jul 2016 ·
73
posts · Location: Indore
Group memberships:
Members
Show profile
·
Link to this post
Subject:
Get online user from openfire
Hi Alex,
can we get all connected users from openfire using matrix library.
Thanks,
Sanjeev
Alex
2016-09-14, 20:26
#2
Member since Feb 2003 ·
4449
posts · Location: Germany
Group memberships:
Administrators, Members
Show profile
·
Link to this post
Most server support this over ad-hoc commands for users which have admin privileges.
Please check if your Openfire server support this:
http://www.xmpp.org/extensions/xep-0133.html#get-online-us…
If yes, then just execute the command as described in
XEP-0133: Service Administration
Alex
skhanna
2016-09-14, 20:43
#3
Member since Jul 2016 ·
73
posts · Location: Indore
Group memberships:
Members
Show profile
·
Link to this post
Thanks Alex.
How I can execute this command in matrix. I also want to get online users for specific group.
Thanks in Advance
Sanjeev
Alex
2016-09-14, 20:55
#4
Member since Feb 2003 ·
4449
posts · Location: Germany
Group memberships:
Administrators, Members
Show profile
·
Link to this post
This gives you all online users, you cannot request only a given group.
Alex
2016-09-14, 22:17
#5
Member since Feb 2003 ·
4449
posts · Location: Germany
Group memberships:
Administrators, Members
Show profile
·
Link to this post
here is code from one of our Unit Tests which should help you.
public
void
TestOnlineUsers
(
)
{
string
XML1
=
@"<iq id='get-online-users-list-1'
to='shakespeare.lit'
type='set'
xmlns='jabber:client'>
<command xmlns='http://jabber.org/protocol/commands'
action='execute'
node='http://jabber.org/protocol/admin#get-online-users-list'/>
</iq>"
;
var
iq
=
new
Iq
{
To
=
"shakespeare.lit"
,
Id
=
"get-online-users-list-1"
,
Type
=
Matrix
.
Xmpp
.
IqType
.
Set
}
;
var
cmd
=
new
Command
(
)
{
Action
=
Action
.
Execute
,
Node
=
"http://jabber.org/protocol/admin#get-online-users-list"
}
;
iq
.
Add
(
cmd
)
;
XmlAssertion
.
AssertXmlEquals
(
Util
.
GetXmlDiff
(
XML1, iq
)
)
;
}
Close
Smaller –
Larger +
Reply to this post:
Verification code:
Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys:
Special characters:
Forum:
MatriX and XmppDotNet