mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
Merge pull request #1696 from deltachat/ephemeral-timer-modified-event
Ephemeral timer modified event fix
This commit is contained in:
@@ -401,7 +401,7 @@ pub unsafe extern "C" fn dc_event_get_data2_int(event: *mut dc_event_t) -> libc:
|
|||||||
| Event::MsgRead { msg_id, .. } => msg_id.to_u32() as libc::c_int,
|
| Event::MsgRead { msg_id, .. } => msg_id.to_u32() as libc::c_int,
|
||||||
Event::SecurejoinInviterProgress { progress, .. }
|
Event::SecurejoinInviterProgress { progress, .. }
|
||||||
| Event::SecurejoinJoinerProgress { progress, .. } => *progress as libc::c_int,
|
| Event::SecurejoinJoinerProgress { progress, .. } => *progress as libc::c_int,
|
||||||
Event::ChatEphemeralTimerModified { timer, .. } => *timer as libc::c_int,
|
Event::ChatEphemeralTimerModified { timer, .. } => timer.to_u32() as libc::c_int,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -674,11 +674,6 @@ async fn add_parts(
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.emit_event(Event::ChatEphemeralTimerModified {
|
|
||||||
chat_id: *chat_id,
|
|
||||||
timer: timer.to_u32(),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
warn!(
|
warn!(
|
||||||
|
|||||||
@@ -176,6 +176,11 @@ impl ChatId {
|
|||||||
paramsv![timer, self],
|
paramsv![timer, self],
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
context.emit_event(Event::ChatEphemeralTimerModified {
|
||||||
|
chat_id: self,
|
||||||
|
timer,
|
||||||
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use async_std::sync::{channel, Receiver, Sender, TrySendError};
|
|||||||
use strum::EnumProperty;
|
use strum::EnumProperty;
|
||||||
|
|
||||||
use crate::chat::ChatId;
|
use crate::chat::ChatId;
|
||||||
|
use crate::ephemeral::Timer as EphemeralTimer;
|
||||||
use crate::message::MsgId;
|
use crate::message::MsgId;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@@ -197,7 +198,10 @@ pub enum Event {
|
|||||||
|
|
||||||
/// Chat ephemeral timer changed.
|
/// Chat ephemeral timer changed.
|
||||||
#[strum(props(id = "2021"))]
|
#[strum(props(id = "2021"))]
|
||||||
ChatEphemeralTimerModified { chat_id: ChatId, timer: u32 },
|
ChatEphemeralTimerModified {
|
||||||
|
chat_id: ChatId,
|
||||||
|
timer: EphemeralTimer,
|
||||||
|
},
|
||||||
|
|
||||||
/// Contact(s) created, renamed, blocked or deleted.
|
/// Contact(s) created, renamed, blocked or deleted.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user