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) ->
OccupantsTuples = get_room_occupants(RoomJid#jid.luser,
RoomJid#jid.lserver),
OccupantsJids = [jid:decode(JidString)
|| {JidString, _Nick, _} <- OccupantsTuples],
OccupantsJids = try [jid:decode(JidString)
|| {JidString, _Nick, _} <- OccupantsTuples]
catch _:{bad_jid, _} -> throw({error, "Malformed JID of invited user"})
end,
lists:filtermap(
fun(UserString) ->
UserJid = jid:decode(UserString),