mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Set roster name from XEP-0172, or the stored one (#1611)
This commit is contained in:
parent
e2496562f9
commit
1d62dc4621
@ -619,6 +619,7 @@ process_subscription(Direction, User, Server, JID1,
|
||||
{Subscription, Pending} ->
|
||||
NewItem = Item#roster{subscription = Subscription,
|
||||
ask = Pending,
|
||||
name = get_nick_subels(SubEls, Item#roster.name),
|
||||
xs = SubEls,
|
||||
askmessage = AskMessage},
|
||||
roster_subscribe_t(LUser, LServer, LJID, NewItem),
|
||||
@ -657,6 +658,12 @@ process_subscription(Direction, User, Server, JID1,
|
||||
false
|
||||
end.
|
||||
|
||||
get_nick_subels(SubEls, Default) ->
|
||||
case xmpp:get_subtag(#presence{sub_els = SubEls}, #nick{}) of
|
||||
{nick, N} -> N;
|
||||
_ -> Default
|
||||
end.
|
||||
|
||||
%% in_state_change(Subscription, Pending, Type) -> NewState
|
||||
%% NewState = none | {NewSubscription, NewPending}
|
||||
-ifdef(ROSTER_GATEWAY_WORKAROUND).
|
||||
|
Loading…
Reference in New Issue
Block a user