fix: Invite left members

This commit is contained in:
Christian Pauly 2020-10-02 11:24:19 +02:00
parent e5b23fa227
commit fe649e5a62
2 changed files with 12 additions and 10 deletions

View File

@ -98,11 +98,13 @@ class _InvitationSelectionState extends State<InvitationSelection> {
Profile.fromJson({'user_id': '@$text'}),
]);
}
foundProfiles.removeWhere((profile) =>
widget.room
final participants = widget.room
.getParticipants()
.indexWhere((u) => u.id == profile.userId) !=
-1);
.where((user) =>
[Membership.join, Membership.invite].contains(user.membership))
.toList();
foundProfiles.removeWhere((profile) =>
participants.indexWhere((u) => u.id == profile.userId) != -1);
});
}

View File

@ -550,12 +550,6 @@ class _SettingsState extends State<Settings> {
ListTile(
trailing: Icon(Icons.link),
title: Text(L10n.of(context).license),
onTap: () => launch(
'https://gitlab.com/ChristianPauly/fluffychat-flutter/raw/master/LICENSE'),
),
ListTile(
trailing: Icon(Icons.code),
title: Text(L10n.of(context).sourceCode),
onTap: () => showLicensePage(
context: context,
applicationIcon:
@ -563,6 +557,12 @@ class _SettingsState extends State<Settings> {
applicationName: AppConfig.applicationName,
),
),
ListTile(
trailing: Icon(Icons.code),
title: Text(L10n.of(context).sourceCode),
onTap: () => launch(
'https://gitlab.com/ChristianPauly/fluffychat-flutter'),
),
],
),
),