mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +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:
parent
ef933c07cc
commit
9a0ff13cc2
@ -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,
|
||||||
|
@ -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),
|
||||||
|
Loading…
Reference in New Issue
Block a user