fix: mxid validation

This commit is contained in:
Christian Pauly 2021-01-18 08:43:29 +01:00
commit 857566b56e
2 changed files with 9 additions and 8 deletions

View file

@ -99,11 +99,10 @@ class _InvitationSelectionState extends State<InvitationSelection> {
}
setState(() {
foundProfiles = List<Profile>.from(response.results);
if ('@$text'.isValidMatrixId &&
foundProfiles.indexWhere((profile) => '@$text' == profile.userId) ==
-1) {
if (text.isValidMatrixId &&
foundProfiles.indexWhere((profile) => text == profile.userId) == -1) {
setState(() => foundProfiles = [
Profile.fromJson({'user_id': '@$text'}),
Profile.fromJson({'user_id': text}),
]);
}
final participants = room