feat: implement pinned messages
- render pinned events on the chat top - support scroll up for several pinned messages - ask to unpin messages - add button to pin message - fix some null-safety issues - fix the Linux database directly for debug builds Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
9272376fc5
commit
704fd404b1
10 changed files with 169 additions and 32 deletions
|
|
@ -823,6 +823,30 @@ class ChatController extends State<Chat> {
|
|||
}
|
||||
}
|
||||
|
||||
unpinEvent(String eventId) async {
|
||||
final response = await showOkCancelAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context)!.unpin,
|
||||
message: L10n.of(context)!.confirmEventUnpin,
|
||||
okLabel: L10n.of(context)!.unpin,
|
||||
cancelLabel: L10n.of(context)!.cancel,
|
||||
);
|
||||
if (response == OkCancelResult.ok) {
|
||||
final events = room!.pinnedEventIds
|
||||
..removeWhere((oldEvent) => oldEvent == eventId);
|
||||
room!.setPinnedEvents(events);
|
||||
}
|
||||
}
|
||||
|
||||
void pinEvent() {
|
||||
room!.setPinnedEvents(
|
||||
<String>{
|
||||
...room!.pinnedEventIds,
|
||||
...selectedEvents.map((e) => e.eventId),
|
||||
}.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
void onInputBarChanged(String text) {
|
||||
if (text.endsWith(' ') && matrix!.hasComplexBundles) {
|
||||
final clients = currentRoomBundle;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue