Ignore ChannelParticipantBanned in participant list. Fixes #635

This commit is contained in:
Tulir Asokan
2021-10-29 20:15:24 +03:00
parent 3507095572
commit 83d457f2b3
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -27,7 +27,7 @@ from telethon.tl.types import (
PhotoEmpty, InputChannel, InputUser, ChatPhotoEmpty, PeerUser, Photo, TypeChat, TypeInputPeer,
TypeUser, User, InputPeerPhotoFileLocation, ChatParticipantAdmin, ChannelParticipantAdmin,
ChatParticipantCreator, ChannelParticipantCreator, UserProfilePhoto, UserProfilePhotoEmpty,
InputPeerUser)
InputPeerUser, ChannelParticipantBanned)
from mautrix.errors import MForbidden
from mautrix.types import (RoomID, UserID, RoomCreatePreset, EventType, Membership,
@@ -797,7 +797,8 @@ class PortalMetadata(BasePortal, ABC):
@staticmethod
def _filter_participants(users: List[TypeUser], participants: List[TypeParticipant]
) -> Iterable[TypeUser]:
participant_map = {part.user_id: part for part in participants}
participant_map = {part.user_id: part for part in participants
if not isinstance(part, ChannelParticipantBanned)}
for user in users:
try:
user.participant = participant_map[user.id]