mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 07:16:31 +03:00
Only send IncomingMsgBunch if there are more than 0 new messages (#3941)
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
- Only send IncomingMsgBunch if there are more than 0 new messages #3941
|
||||||
|
|
||||||
### API-Changes
|
### API-Changes
|
||||||
|
|
||||||
|
|||||||
@@ -828,11 +828,13 @@ impl Imap {
|
|||||||
|
|
||||||
info!(context, "{} mails read from \"{}\".", read_cnt, folder);
|
info!(context, "{} mails read from \"{}\".", read_cnt, folder);
|
||||||
|
|
||||||
let msg_ids = received_msgs
|
let msg_ids: Vec<MsgId> = received_msgs
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|m| m.msg_ids.clone())
|
.flat_map(|m| m.msg_ids.clone())
|
||||||
.collect();
|
.collect();
|
||||||
context.emit_event(EventType::IncomingMsgBunch { msg_ids });
|
if !msg_ids.is_empty() {
|
||||||
|
context.emit_event(EventType::IncomingMsgBunch { msg_ids });
|
||||||
|
}
|
||||||
|
|
||||||
chat::mark_old_messages_as_noticed(context, received_msgs).await?;
|
chat::mark_old_messages_as_noticed(context, received_msgs).await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user