mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
Merge branch 'main' into 'main'
fix: Quick account switching Closes #1186 See merge request famedly/fluffychat!1111
This commit is contained in:
commit
64821e4ec5
@ -76,7 +76,7 @@ class ChatPageWithRoom extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ChatController extends State<ChatPageWithRoom> {
|
class ChatController extends State<ChatPageWithRoom> {
|
||||||
Room get room => widget.room;
|
Room get room => sendingClient.getRoomById(roomId) ?? widget.room;
|
||||||
|
|
||||||
late Client sendingClient;
|
late Client sendingClient;
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||||||
TextEditingController sendController = TextEditingController();
|
TextEditingController sendController = TextEditingController();
|
||||||
|
|
||||||
void setSendingClient(Client c) {
|
void setSendingClient(Client c) {
|
||||||
// first cancle typing with the old sending client
|
// first cancel typing with the old sending client
|
||||||
if (currentlyTyping) {
|
if (currentlyTyping) {
|
||||||
// no need to have the setting typing to false be blocking
|
// no need to have the setting typing to false be blocking
|
||||||
typingCoolDown?.cancel();
|
typingCoolDown?.cancel();
|
||||||
@ -376,6 +376,10 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||||||
room.setTyping(false);
|
room.setTyping(false);
|
||||||
currentlyTyping = false;
|
currentlyTyping = false;
|
||||||
}
|
}
|
||||||
|
// then cancel the old timeline
|
||||||
|
// fixes bug with read reciepts and quick switching
|
||||||
|
loadTimelineFuture = _getTimeline(eventContextId: room.fullyRead);
|
||||||
|
|
||||||
// then set the new sending client
|
// then set the new sending client
|
||||||
setState(() => sendingClient = c);
|
setState(() => sendingClient = c);
|
||||||
}
|
}
|
||||||
@ -393,7 +397,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||||||
|
|
||||||
final commandMatch = RegExp(r'^\/(\w+)').firstMatch(sendController.text);
|
final commandMatch = RegExp(r'^\/(\w+)').firstMatch(sendController.text);
|
||||||
if (commandMatch != null &&
|
if (commandMatch != null &&
|
||||||
!room.client.commands.keys.contains(commandMatch[1]!.toLowerCase())) {
|
!sendingClient.commands.keys.contains(commandMatch[1]!.toLowerCase())) {
|
||||||
final l10n = L10n.of(context)!;
|
final l10n = L10n.of(context)!;
|
||||||
final dialogResult = await showOkCancelAlertDialog(
|
final dialogResult = await showOkCancelAlertDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
Loading…
Reference in New Issue
Block a user