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