mod_push: Set 'last-message-sender' to bare JID

If the mod_push option 'include_sender' is set to 'true', use the bare
JID rather than the full JID for the 'last-message-sender' field.
This commit is contained in:
Holger Weiss 2023-09-09 17:33:16 +02:00
parent 2782430887
commit 6c573cc9fd
1 changed files with 2 additions and 1 deletions

View File

@ -682,7 +682,7 @@ drop_online_sessions(LUser, LServer, Clients) ->
-spec make_summary(binary(), xmpp_element() | xmlel() | none, direction())
-> xdata() | undefined.
make_summary(Host, #message{from = From} = Pkt, recv) ->
make_summary(Host, #message{from = From0} = Pkt, recv) ->
case {mod_push_opt:include_sender(Host),
mod_push_opt:include_body(Host)} of
{false, false} ->
@ -702,6 +702,7 @@ make_summary(Host, #message{from = From} = Pkt, recv) ->
end,
Fields2 = case IncludeSender of
true ->
From = jid:remove_resource(From0),
[{'last-message-sender', From} | Fields1];
false ->
Fields1