From 42eba43713aacb4f0b18baa1370221c6d27920df Mon Sep 17 00:00:00 2001 From: sherlock Date: Tue, 19 Sep 2023 01:33:12 +0700 Subject: [PATCH] TW-499: filter invite other people when create new group chat --- .../matrix_sdk_extensions/filtered_timeline_extension.dart | 7 +++++++ pubspec.lock | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/utils/matrix_sdk_extensions/filtered_timeline_extension.dart b/lib/utils/matrix_sdk_extensions/filtered_timeline_extension.dart index 85851ff53a..3281305bde 100644 --- a/lib/utils/matrix_sdk_extensions/filtered_timeline_extension.dart +++ b/lib/utils/matrix_sdk_extensions/filtered_timeline_extension.dart @@ -32,6 +32,7 @@ extension IsStateExtension on Event { !isGroupNameChangeWhenCreate() && !isGroupAvatarChangeWhenCreate() && !isActivateEndToEndEncryption() && + !isInviteWhenCreate(); static const Set importantStateEvents = { EventTypes.Encryption, @@ -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' && diff --git a/pubspec.lock b/pubspec.lock index bc1e105f82..16938d18b8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1526,7 +1526,7 @@ packages: description: path: "." ref: twake-supported - resolved-ref: "954430a1296311db4b34eadeaf29ecfb4ff330df" + resolved-ref: "186ded3be6d5acbe3476e61a38f6aeb41cac5347" url: "git@github.com:linagora/matrix-dart-sdk.git" source: git version: "0.22.2"