1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02:00

Don't pass empty resource to jid:make()

This commit is contained in:
Evgeniy Khramtsov 2017-02-25 10:01:01 +03:00
parent 485aae8134
commit 603ec9cb19
23 changed files with 44 additions and 48 deletions

View file

@ -182,9 +182,7 @@ export(_Server) ->
{sr_user,
fun(Host, #sr_user{us = {U, S}, group_host = {Group, LServer}})
when LServer == Host ->
SJID = jid:to_string(
jid:tolower(
jid:make(U, S, <<"">>))),
SJID = make_jid_s(U, S),
[?SQL("select @(jid)s from sr_user where jid=%(SJID)s"
" and grp=%(Group)s;"),
?SQL("insert into sr_user(jid, grp) values ("
@ -200,6 +198,6 @@ import(_, _, _) ->
%%% Internal functions
%%%===================================================================
make_jid_s(U, S) ->
jid:to_string(jid:tolower(jid:make(U, S, <<"">>))).
jid:to_string(jid:tolower(jid:make(U, S))).
make_jid_s({U, S}) -> make_jid_s(U, S).