mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-14 22:00:16 +02:00
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:
parent
2782430887
commit
6c573cc9fd
|
@ -682,7 +682,7 @@ drop_online_sessions(LUser, LServer, Clients) ->
|
||||||
|
|
||||||
-spec make_summary(binary(), xmpp_element() | xmlel() | none, direction())
|
-spec make_summary(binary(), xmpp_element() | xmlel() | none, direction())
|
||||||
-> xdata() | undefined.
|
-> 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),
|
case {mod_push_opt:include_sender(Host),
|
||||||
mod_push_opt:include_body(Host)} of
|
mod_push_opt:include_body(Host)} of
|
||||||
{false, false} ->
|
{false, false} ->
|
||||||
|
@ -702,6 +702,7 @@ make_summary(Host, #message{from = From} = Pkt, recv) ->
|
||||||
end,
|
end,
|
||||||
Fields2 = case IncludeSender of
|
Fields2 = case IncludeSender of
|
||||||
true ->
|
true ->
|
||||||
|
From = jid:remove_resource(From0),
|
||||||
[{'last-message-sender', From} | Fields1];
|
[{'last-message-sender', From} | Fields1];
|
||||||
false ->
|
false ->
|
||||||
Fields1
|
Fields1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user