Project

General

Profile

Change behavior of "remove user"

Keren Meir
Added over 5 years ago

Hi,

I want to changed a little bit the behavior of the Tigase when user1 wants to remove user2 from his contact list.

Assume we have this situation:

user1 user2


\ user2 \ \ user1 \

\ \ \ \

____\ ____\

user1 remove user2 - I want that user2 will NOT remove user1 from his list. I want that user1 will be exists in user2 contact list. (as shown below)

user1 user2


\ \ \ user1 \

\ \ \ \

____\ ____\

I changed the "subscription" behavior so when user1 remove user2 the subscription in the database will be "to" in user2 instead of none (after remove)

but it is still doesn't work good. User2 stops from getting presence from user1.

For user2 - roster in DB:

How can I change it so it will work as I want?

Thanks


Replies (3)

Added by Wojciech Kapcia TigaseTeam over 5 years ago

Tigase should already works the way you described - given that both users have 'both' subscription then removing user2 from user1's roster should only cause changing subscription type for user1 in user2's roster. Bottomline - server should not (as per specification) remove contact from user roster.

Regarding:

(...) user1 remove user2 (...) User2 stops from getting presence from user1.

how exactly do you want to achieve that? presence is only broadcasted to items in users owner, if you remove user2 from user1 roster then no matter what subscription user1-item has in user2's roster the presence of user1 won't be broadcasted to user2 because that item is not present in user1's roster.

Added by Keren Meir over 5 years ago

Thanks!

Two important things:

  1. When user1 remove user2 from contact list, 2 packets have been sent:

    1. presence unsubscribe from user1 to user2 - this packet changes subscription in user2 roster, of item=user1 from "both" to "to"
    2. presence unsubscribed from user1 to user2 - this packet changes subscription in user2 roster, of item=user1 from "to" to "none"

2.The server remove user2 from user1's roster. I changed it so now the server changes the subscription of user2 (in user1 roster) to "from" instead of removing it

Added by Wojciech Kapcia TigaseTeam over 5 years ago

So basically user can't remove contact from it's roster - correct? If I understand correctly in case of attempt of removing user from roster you should only generate presence of the type='unsubscribe' - this will cause to maintain subscription in your desired direction; one downside - it will leave user2 in user1's roster.

    (1-3/3)