Merge branch 'soru/fix-only-prefix-on-complex-bundles' into 'main'

fix: Only use prefix switching if we have complex bundles

See merge request famedly/fluffychat!525
This commit is contained in:
Krille Fear 2021-09-21 07:12:23 +00:00
commit 6bd332f756
1 changed files with 13 additions and 11 deletions

View File

@ -739,17 +739,19 @@ class ChatController extends State<Chat> {
} }
void onInputBarChanged(String text) { void onInputBarChanged(String text) {
final clients = currentRoomBundle; if (text.endsWith(' ') && matrix.hasComplexBundles) {
for (final client in clients) { final clients = currentRoomBundle;
final prefix = client.sendPrefix; for (final client in clients) {
if ((prefix?.isNotEmpty ?? false) && final prefix = client.sendPrefix;
text.toLowerCase() == '${prefix.toLowerCase()} ') { if ((prefix?.isNotEmpty ?? false) &&
setSendingClient(client); text.toLowerCase() == '${prefix.toLowerCase()} ') {
setState(() { setSendingClient(client);
inputText = ''; setState(() {
sendController.text = ''; inputText = '';
}); sendController.text = '';
return; });
return;
}
} }
} }
typingCoolDown?.cancel(); typingCoolDown?.cancel();