I am trying to find a way to see if a user is online/connected without knowing its SID. The only way i have gotten to is to check its last activity time. If it returns an error then it is online, if it has value then it isn't online....I am not sure if there is any other way to see if a user is online.
Do i have to switch any specific things on in Ejabberd?
But when i send an IQ it isnt working either.
var iq = $iq({
type: 'get',
id: 'last1',
to: "jay@server.com" })
.c('query', {xmlns: 'jabber:iq:last'});
conn.sendIQ(iq);
Edit: I found out that the requesting entity is not authorized to retrieve last activity information, how would i allow that?? I am the admin