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

Better handling of malformed jids in send_direct_invitation command

This commit is contained in:
Paweł Chmielowski 2024-09-02 12:49:39 +02:00
parent b455d93c69
commit 3c896d1c6a

View File

@ -1501,8 +1501,10 @@ send_direct_invitation(RoomName, RoomService, Password, Reason, UsersStrings) ->
get_users_to_invite(RoomJid, UsersStrings) -> get_users_to_invite(RoomJid, UsersStrings) ->
OccupantsTuples = get_room_occupants(RoomJid#jid.luser, OccupantsTuples = get_room_occupants(RoomJid#jid.luser,
RoomJid#jid.lserver), RoomJid#jid.lserver),
OccupantsJids = [jid:decode(JidString) OccupantsJids = try [jid:decode(JidString)
|| {JidString, _Nick, _} <- OccupantsTuples], || {JidString, _Nick, _} <- OccupantsTuples]
catch _:{bad_jid, _} -> throw({error, "Malformed JID of invited user"})
end,
lists:filtermap( lists:filtermap(
fun(UserString) -> fun(UserString) ->
UserJid = jid:decode(UserString), UserJid = jid:decode(UserString),