25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Merge pull request #1125 from vthriller/roster-push

mod_roster should probably respect roster item changes introduced with roster_process_item hooks upon pushing
This commit is contained in:
badlop 2016-06-08 13:57:52 +02:00
commit a4f213837e

View File

@ -382,14 +382,14 @@ process_item_set(From, To,
Item = get_roster_by_jid_t(LUser, LServer, LJID),
Item1 = process_item_attrs_managed(Item, Attrs, Managed),
Item2 = process_item_els(Item1, Els),
case Item2#roster.subscription of
remove -> del_roster_t(LUser, LServer, LJID);
_ -> update_roster_t(LUser, LServer, LJID, Item2)
end,
send_itemset_to_managers(From, Item2, Managed),
Item3 = ejabberd_hooks:run_fold(roster_process_item,
LServer, Item2,
[LServer]),
case Item3#roster.subscription of
remove -> del_roster_t(LUser, LServer, LJID);
_ -> update_roster_t(LUser, LServer, LJID, Item3)
end,
send_itemset_to_managers(From, Item3, Managed),
case roster_version_on_db(LServer) of
true -> write_roster_version_t(LUser, LServer);
false -> ok