mirror of
https://github.com/mautrix/signal.git
synced 2025-03-14 14:15:36 +00:00
Merge pull request #345 from maltee1/failed_invite_check_members
don't kick ghost on GroupPatchNotAcceptedError if they are in the signal group
This commit is contained in:
commit
14610ceb54
2 changed files with 13 additions and 0 deletions
|
@ -114,6 +114,10 @@ class NoSuchAccountError(ResponseError):
|
|||
pass
|
||||
|
||||
|
||||
class GroupPatchNotAcceptedError(ResponseError):
|
||||
pass
|
||||
|
||||
|
||||
response_error_types = {
|
||||
"invalid_request": RequestValidationFailure,
|
||||
"TimeoutException": TimeoutException,
|
||||
|
@ -129,6 +133,7 @@ response_error_types = {
|
|||
"UnregisteredUserError": UnregisteredUserError,
|
||||
"ProfileUnavailableError": ProfileUnavailableError,
|
||||
"NoSuchAccountError": NoSuchAccountError,
|
||||
"GroupPatchNotAcceptedError": GroupPatchNotAcceptedError,
|
||||
# TODO add rest from https://gitlab.com/signald/signald/-/tree/main/src/main/java/io/finn/signald/clientprotocol/v1/exceptions
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import time
|
|||
|
||||
from mausignald.errors import (
|
||||
AttachmentTooLargeError,
|
||||
GroupPatchNotAcceptedError,
|
||||
NotConnected,
|
||||
ProfileUnavailableError,
|
||||
RPCError,
|
||||
|
@ -860,6 +861,13 @@ class Portal(DBPortal, BasePortal):
|
|||
invited_by.username, self.chat_id, add_members=[user.address]
|
||||
)
|
||||
self.revision = update_meta.revision
|
||||
except GroupPatchNotAcceptedError as e:
|
||||
update_meta = await self.signal.get_group(invited_by.username, self.chat_id)
|
||||
if (
|
||||
user.address not in update_meta.members
|
||||
and user.address not in update_meta.pending_members
|
||||
):
|
||||
raise RejectMatrixInvite(str(e)) from e
|
||||
except RPCError as e:
|
||||
raise RejectMatrixInvite(str(e)) from e
|
||||
if user.mxid == self.config["bridge.relay.relaybot"] != "@relaybot:example.com":
|
||||
|
|
Loading…
Add table
Reference in a new issue