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

mod_register: Send welcome message as 'chat' too (#4246)

Apparently, some clients don't display 'normal' messages to the user.
This commit is contained in:
Badlop 2024-07-12 11:21:55 +02:00
parent ef933c07cc
commit 9a0ff13cc2
2 changed files with 8 additions and 0 deletions

View File

@ -412,6 +412,12 @@ send_welcome_message(JID) ->
case mod_register_opt:welcome_message(Host) of case mod_register_opt:welcome_message(Host) of
{<<"">>, <<"">>} -> ok; {<<"">>, <<"">>} -> ok;
{Subj, Body} -> {Subj, Body} ->
ejabberd_router:route(
#message{from = jid:make(Host),
to = JID,
type = chat,
subject = xmpp:mk_text(Subj),
body = xmpp:mk_text(<<Subj/binary, "\n\n", Body/binary>>)}),
ejabberd_router:route( ejabberd_router:route(
#message{from = jid:make(Host), #message{from = jid:make(Host),
to = JID, to = JID,

View File

@ -920,6 +920,8 @@ presence_broadcast(Config) ->
IQ = #iq{type = get, IQ = #iq{type = get,
from = JID, from = JID,
sub_els = [#disco_info{node = Node}]} = recv_iq(Config), sub_els = [#disco_info{node = Node}]} = recv_iq(Config),
#message{type = chat,
subject = [#text{lang = <<"en">>,data = <<"Welcome!">>}]} = recv_message(Config),
#message{type = normal, #message{type = normal,
subject = [#text{lang = <<"en">>,data = <<"Welcome!">>}]} = recv_message(Config), subject = [#text{lang = <<"en">>,data = <<"Welcome!">>}]} = recv_message(Config),
#presence{from = JID, to = JID} = recv_presence(Config), #presence{from = JID, to = JID} = recv_presence(Config),