25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

send_direct_invitations accepts only user jids

This commit is contained in:
Christophe Romain 2017-12-19 10:24:07 +01:00
parent 9bccac03f5
commit 051e1be832

View File

@ -823,9 +823,9 @@ get_room_occupants_number(Room, Host) ->
send_direct_invitation(RoomName, RoomService, Password, Reason, UsersString) ->
RoomJid = jid:make(RoomName, RoomService),
XmlEl = build_invitation(Password, Reason, RoomJid),
UsersStrings = get_users_to_invite(RoomJid, UsersString),
[send_direct_invitation(RoomJid, UserStrings, XmlEl)
|| UserStrings <- UsersStrings],
Users = get_users_to_invite(RoomJid, UsersString),
[send_direct_invitation(RoomJid, UserJid, XmlEl)
|| UserJid <- Users],
timer:sleep(1000),
ok.
@ -843,8 +843,9 @@ get_users_to_invite(RoomJid, UsersString) ->
orelse UserJid#jid.lserver /= OccupantJid#jid.lserver
end,
OccupantsJids),
case Val of
true -> {true, UserJid};
case {UserJid#jid.luser, Val} of
{<<>>, _} -> false;
{_, true} -> {true, UserJid};
_ -> false
end
end,