mod_admin_extra: Let send_message omit subject
Let the send_message command omit the subject if the user either specified an empty subject or a message type of "chat".
This commit is contained in:
parent
94c690661b
commit
7ca2ae6947
|
@ -1406,10 +1406,9 @@ send_packet_all_resources(FromJID, ToU, ToS, ToR, Packet) ->
|
|||
ejabberd_router:route(FromJID, ToJID, Packet).
|
||||
|
||||
build_packet(Type, Subject, Body) ->
|
||||
Tail = case Subject of
|
||||
<<"chat">> -> [];
|
||||
_ -> [{xmlel, <<"subject">>, [], [{xmlcdata, Subject}]}]
|
||||
end,
|
||||
Tail = if Subject == <<"">>; Type == <<"chat">> -> [];
|
||||
true -> [{xmlel, <<"subject">>, [], [{xmlcdata, Subject}]}]
|
||||
end,
|
||||
{xmlel, <<"message">>,
|
||||
[{<<"type">>, Type}, {<<"id">>, randoms:get_string()}],
|
||||
[{xmlel, <<"body">>, [], [{xmlcdata, Body}]} | Tail]
|
||||
|
|
Loading…
Reference in New Issue