Suppose that I have two user account, for example, A and B in the Jive messenger server. and A had added B to its roster, but A wasn’‘t in B’'s roster.
Thus
1)when B is offline, if A logins, B is shown “offline” in A roster
then B log on the server successfully
all online friends in B’'s roster are noticed that B is currently online
Because A isn’‘t in B’‘s roster, so A don’‘t accept this notice message, and can’'t make the status of B updated in its roster.
I wonder which way I can take to make A noticed whenever B changes its presence.
If B is in A’'s roster then A should be notified when B changes his/her presence. Is this not working as expected? If you meant the opposite – one option would be directed presence – the XMPP spec allows you to send presence directly to another user.
Since you are adding the roster items directly to the database you will need to add another row in order to make things work.
What you need is to have two roster items (i.e. 2 rows in jiveRoster). One row represents the TO presence subscription which is what you already has. What you are missing is another row that represents the FROM presence subscription. Therefore, you need to execute this other SQL query: