Skip to content

Commit 261bfef

Browse files
committed
autocomplete: Exclude user from autocomplete popup if deactivated
Fixes #451
1 parent 81a6c2a commit 261bfef

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/model/autocomplete.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ class MentionAutocompleteQuery {
289289
// TODO(#236) test email too, not just name
290290
// TODO(#237) test with diacritics stripped, where appropriate
291291

292+
if (!user.isActive) return false;
293+
292294
return _testName(user, cache);
293295
}
294296

test/model/autocomplete_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ void main() {
344344
doCheck('Four F', eg.user(fullName: 'Full Name Four Words'), false);
345345
});
346346

347+
test('user is always excluded when not active regardless of other criteria', () {
348+
doCheck('Full Name', eg.user(fullName: 'Full Name', isActive: false), false);
349+
});
350+
347351
});
348352

349353
}

0 commit comments

Comments
 (0)