mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +03:00
feat: For bots, wait with emitting IncomingMsg until the Post-Msg arrived
This commit is contained in:
@@ -1146,6 +1146,12 @@ ORDER BY m.timestamp DESC,m.id DESC",
|
||||
///
|
||||
/// Blocked contacts and chats are excluded,
|
||||
/// but self-sent messages and contact requests are included in the results.
|
||||
///
|
||||
/// Note that this returns the pre-message's id as soon as it arrives.
|
||||
/// The bot needs to wait for the post-message by itself if it wants to use this API
|
||||
/// to get fully downloaded messages.
|
||||
/// If the bot doesn't want this, then it should instead use the [`EventType::IncomingMsg`]
|
||||
/// event for getting notified about new messages.
|
||||
pub async fn get_next_msgs(&self) -> Result<Vec<MsgId>> {
|
||||
let last_msg_id = match self.get_config(Config::LastMsgId).await? {
|
||||
Some(s) => MsgId::new(s.parse()?),
|
||||
|
||||
Reference in New Issue
Block a user