powered by Jive Software

Roster and notifications

Hi,

I am trying to implement a plugin which allows adding/deleting contacts via a web interface. I have created the plugin and it works ok but I think I hit an issue which is by design of openfire.

The issue is - I want to have contact ‘‘A’’ be notified of when a contact ‘‘B’’ is online/away etc. without contact ‘‘B’’ having contact ‘‘A’’ on his contact list/roster.

Is this possible?

Hi,

XMPP supports one-way subscriptions (see http://www.xmpp.org/rfcs/rfc3921.html#substates ), so this should be possible. I have anyhow no idea how to create these subscription states except by editing the database manually and restart Openfire. But I did not look in the javadoc, there may be simple a way to code this.

LG

You can specify these states using RosterItem.RecvType, RosterItem.SubType and RosterItem.AskType. I think the important one is the SubType. I will play around with it more and see if this helps and post back with results.

I tried out a couple of things - below is an extract of my jiveRoster table -

mysql> select * from jiveRoster;

*----


*–


+


+-+-++----+

rosterID

username

jid

sub

ask

recv

nick

*----


*–


+


+-+-++----+

62

alvins123

alvins82@192.168.1.104

1

-1

-1

NULL

| 61 | alvins82 | alvins123@192.168.1.104 | 2 | -1 | -1 | NULL |

*----


*–


+


+-+-++----+

So contact ‘‘A’’ (alvins123) wants notifications from contact ‘‘B’’ (alvins82). This works - but ‘‘alvins123’’ still shows up in ‘‘alvins82’’ contact list - I guess this is dependant on how the client is coded.

But I guess this is good enough. Now my other problem is that I have to restart openfire for roster changes to take affect - discussed in a seperate thread.

Thanks.