Move event emitting for a new message to a separate function

This commit is contained in:
iequidoo
2023-01-13 15:47:26 -03:00
committed by iequidoo
parent 5b265dbc1c
commit badbf766bb
2 changed files with 12 additions and 10 deletions

View File

@@ -356,11 +356,7 @@ pub(crate) async fn receive_imf_inner(
} else if !chat_id.is_trash() {
let fresh = received_msg.state == MessageState::InFresh;
for msg_id in &received_msg.msg_ids {
if incoming && fresh {
context.emit_incoming_msg(chat_id, *msg_id);
} else {
context.emit_msgs_changed(chat_id, *msg_id);
};
chat_id.emit_msg_event(context, *msg_id, incoming && fresh);
}
}