Re-fetch conversation only when marking as unread, as it's the
only scenario where unreadMessages and other values cannot be
computed cheaply on the client side.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Save the message from the current input field by conversation into the
store.
This makes it possible to keep the message when switching the
conversation.
Also fixes an issue where joining or leaving a call would clear the
message due to the field being destroyed and recreated between the
message list and the sidebar.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Fix error related to unavailable upload menu.
Don't send request for updating read marker on server in guest mode.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Instead of calling the service's "fetchConversation" method and manually
adding to the store, use the new "fetchConversation" store action that
does that directly
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Re-fetching makes sure that harder to compute values are re-fetched from
the server like unreadMessages, unreadMention, etc.
This introduces a new store action "fetchConversation".
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Allow copy message link and mark as unread in locked rooms.
This needed to shift the action flags logic a bit.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
When posting new messages, the read marker UI will also be updated.
Fixed read marker update when scrolled to bottom.
Fixed warnings related to temporary message id being a string.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Added props for previous and next message id in MessagesGroup and
Message components.
Now using the previous message id when marking as unread.
Since now the next message id is available on all message components,
the logic in MessagesList that iterates over the next messages is now
using the next message id attribute instead of handling the DOM tree on
its own.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
To avoid jumping around when updating the lastReadMessage property, its
last value is now cached in visualLastReadMessageId in the
messagesStore. The marker always keeps its position until the user
focusses away then back. In the latter case the marker position is
refreshed based on the last backend/store state.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>