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

Log a message when a user gets registered

This commit is contained in:
Evgeniy Khramtsov 2017-11-17 18:02:12 +03:00
parent 4f12359b9c
commit 3202b7a9a1

View File

@ -334,6 +334,10 @@ try_register(User, Server, Password, SourceRaw, Lang) ->
Password)
of
ok ->
?INFO_MSG("The account ~s was registered "
"from IP address ~s",
[jid:encode({User, Server, <<"">>}),
ip_to_string(Source)]),
send_welcome_message(JID),
send_registration_notifications(
?MODULE, JID, Source),
@ -492,6 +496,8 @@ remove_timeout(Source) ->
true -> ok
end.
ip_to_string({_, _, _} = USR) ->
jid:encode(USR);
ip_to_string(Source) when is_tuple(Source) ->
misc:ip_to_list(Source);
ip_to_string(undefined) -> <<"undefined">>;