mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-19 04:15:09 +00:00
fix: Only use prefix switching if we have complex bundles
This commit is contained in:
parent
b7053c2044
commit
c6cd9a9ed6
1 changed files with 13 additions and 11 deletions
|
@ -739,17 +739,19 @@ class ChatController extends State<Chat> {
|
|||
}
|
||||
|
||||
void onInputBarChanged(String text) {
|
||||
final clients = currentRoomBundle;
|
||||
for (final client in clients) {
|
||||
final prefix = client.sendPrefix;
|
||||
if ((prefix?.isNotEmpty ?? false) &&
|
||||
text.toLowerCase() == '${prefix.toLowerCase()} ') {
|
||||
setSendingClient(client);
|
||||
setState(() {
|
||||
inputText = '';
|
||||
sendController.text = '';
|
||||
});
|
||||
return;
|
||||
if (text.endsWith(' ') && matrix.hasComplexBundles) {
|
||||
final clients = currentRoomBundle;
|
||||
for (final client in clients) {
|
||||
final prefix = client.sendPrefix;
|
||||
if ((prefix?.isNotEmpty ?? false) &&
|
||||
text.toLowerCase() == '${prefix.toLowerCase()} ') {
|
||||
setSendingClient(client);
|
||||
setState(() {
|
||||
inputText = '';
|
||||
sendController.text = '';
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
typingCoolDown?.cancel();
|
||||
|
|
Loading…
Reference in a new issue