From 051e1be83214710b0bd7c1037b605e7364d4221e Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Tue, 19 Dec 2017 10:24:07 +0100 Subject: [PATCH] send_direct_invitations accepts only user jids --- src/mod_muc_admin.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index e41f62b59..3d363fc95 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -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,