Skip to content

Commit 109562b

Browse files
PIG208chrisbobbe
andcommitted
msglist: Add and manage outbox message objects in message list view
This adds some overhead on message-event handling, linear in the number of outbox messages in a view. We rely on that number being small. We add outboxMessages as a list independent from messages on _MessageSequence. Because outbox messages are not rendered (the raw content is shown as plain text), we leave the 1-1 relationship between `messages` and `contents` unchanged. When computing `items`, we now start to look at `outboxMessages` as well, with the guarantee that the items related to outbox messages always come after those for other messages. Look for places that call `_processOutboxMessage(int index)` for references, and the changes to `checkInvariants` on how this affects the message list invariants. `addOutboxMessage` is similar to `handleMessage`. However, outbox messages do not rely on the fetched state, i.e. they can be synchronously updated when the message list view was first initialized. This implements minimal support to display outbox message message item widgets in the message list, without indicators for theirs states. Retrieving content from failed sent requests and the full UI are implemented in a later commit. Co-authored-by: Chris Bobbe <[email protected]>
1 parent a4b5abb commit 109562b

File tree

7 files changed

+936
-37
lines changed

7 files changed

+936
-37
lines changed

lib/model/message.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ class MessageStoreImpl extends PerAccountStoreBase with MessageStore, _OutboxMes
394394
}
395395
}
396396

397+
// TODO predict outbox message moves using propagateMode
398+
397399
for (final view in _messageListViews) {
398400
view.messagesMoved(messageMove: messageMove, messageIds: event.messageIds);
399401
}

0 commit comments

Comments
 (0)