mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
dc_markseen_msgs() should not handle deaddrop
messages are marked as 'noticed' already when the chat is opened
as all UIs call dc_marknoticed_chat();
also marking messages as 'noticed' when dc_markseen_msgs() is called
is not needed therefore - but stands in the way of further improvements
for the deaddrop, eg. UI may let the user decide when the deaddrop
can be removed from chatlist ('All done' button or so)
This commit is contained in:
@@ -1594,13 +1594,22 @@ void dc_marknoticed_contact (dc_context_t* context, uint32_t co
|
||||
|
||||
|
||||
/**
|
||||
* Mark a message as _seen_, updates the IMAP state and
|
||||
* sends MDNs. If the message is not in a real chat (e.g. a contact request), the
|
||||
* message is only marked as NOTICED and no IMAP/MDNs is done. See also
|
||||
* dc_marknoticed_chat().
|
||||
* Mark messages as presented to the user.
|
||||
* Typically, UIs call this function on scrolling through the chatlist,
|
||||
* when the messages are presented at least for a little moment.
|
||||
* The concrete action depends on the type of the chat and on the users settings
|
||||
* (dc_msgs_presented() may be a better name therefore, but well :)
|
||||
*
|
||||
* Moreover, if messages belong to a chat with ephemeral messages enabled,
|
||||
* the ephemeral timer is started for these messages.
|
||||
* - For normal chats, the IMAP state is updated, MDN is sent
|
||||
* (if dc_set_config()-options `mdns_enabled` is set)
|
||||
* and the internal state is changed to DC_STATE_IN_SEEN to reflect these actions.
|
||||
*
|
||||
* - For the deaddrop, no IMAP or MNDs is done
|
||||
* and the internal change is not changed therefore.
|
||||
* See also dc_marknoticed_chat().
|
||||
*
|
||||
* Moreover, timer is started for incoming ephemeral messages.
|
||||
* This also happens for messages in the deaddrop.
|
||||
*
|
||||
* One #DC_EVENT_MSGS_NOTICED event is emitted per modified chat.
|
||||
*
|
||||
|
||||
@@ -1545,21 +1545,18 @@ pub async fn markseen_msgs(context: &Context, msg_ids: Vec<MsgId>) -> bool {
|
||||
continue;
|
||||
}
|
||||
|
||||
if curr_blocked == Blocked::Not {
|
||||
if curr_state == MessageState::InFresh || curr_state == MessageState::InNoticed {
|
||||
update_msg_state(context, id, MessageState::InSeen).await;
|
||||
info!(context, "Seen message {}.", id);
|
||||
if curr_blocked == Blocked::Not
|
||||
&& (curr_state == MessageState::InFresh || curr_state == MessageState::InNoticed)
|
||||
{
|
||||
update_msg_state(context, id, MessageState::InSeen).await;
|
||||
info!(context, "Seen message {}.", id);
|
||||
|
||||
job::add(
|
||||
context,
|
||||
job::Job::new(Action::MarkseenMsgOnImap, id.to_u32(), Params::new(), 0),
|
||||
)
|
||||
.await;
|
||||
updated_chat_ids.insert(curr_chat_id, true);
|
||||
}
|
||||
} else if curr_state == MessageState::InFresh {
|
||||
update_msg_state(context, id, MessageState::InNoticed).await;
|
||||
updated_chat_ids.insert(DC_CHAT_ID_DEADDROP, true);
|
||||
job::add(
|
||||
context,
|
||||
job::Job::new(Action::MarkseenMsgOnImap, id.to_u32(), Params::new(), 0),
|
||||
)
|
||||
.await;
|
||||
updated_chat_ids.insert(curr_chat_id, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user