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.
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.
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.
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.