In my chat application when I have to add a friend I have to follow this process -
Suppose A->B ist : A will send subscribe packet to B ( server entry shows NONE subscription ) iind - B will send subscribed packet to A ( server entry will be - TO/FROM) iiird - B will again send subscribe packet to A ( server entry TO/FROM ) ivth - A will send subscribed packet to B ( server entry BOTH )
Each time a notification is sent to the concerned user and after allowing corresponding packet is sent.
I want to do it like this -
When A sends a friend request to B ( a notification To B will be sent - and the server entry should be TO/FROM ) and its upto B to accept or not, If he accepts it then immediately the server entry should be BOTH.
Please tell me how can I achieve the same by sending only two sets of subscription packets.
Thanks