Skip to content

Commit

Permalink
TW-499: filter invite other people when create new group chat
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn authored and hoangdat committed Sep 19, 2023
1 parent 86dcd92 commit 42eba43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extension IsStateExtension on Event {
!isGroupNameChangeWhenCreate() &&
!isGroupAvatarChangeWhenCreate() &&
!isActivateEndToEndEncryption() &&
!isInviteWhenCreate();

static const Set<String> importantStateEvents = {
EventTypes.Encryption,
Expand Down Expand Up @@ -64,6 +65,12 @@ extension IsStateExtension on Event {
content['url'] == null &&
prevContent?['url'] == null;
}
bool isInviteWhenCreate() {
return type == EventTypes.RoomMember &&
content['membership'] != null &&
content['membership'] == 'invite' &&
content['reason'] == null;
}
bool isSomeoneChangeAvatar() {
return stateKey != null &&
prevContent?["membership"] == 'join' &&
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ packages:
description:
path: "."
ref: twake-supported
resolved-ref: "954430a1296311db4b34eadeaf29ecfb4ff330df"
resolved-ref: "186ded3be6d5acbe3476e61a38f6aeb41cac5347"
url: "[email protected]:linagora/matrix-dart-sdk.git"
source: git
version: "0.22.2"
Expand Down

0 comments on commit 42eba43

Please sign in to comment.