Merge pull request #1696 from deltachat/ephemeral-timer-modified-event

Ephemeral timer modified event fix
This commit is contained in:
bjoern
2020-07-10 14:07:09 +02:00
committed by GitHub
4 changed files with 11 additions and 7 deletions

View File

@@ -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::SecurejoinInviterProgress { progress, .. }
| 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,
}
}

View File

@@ -674,11 +674,6 @@ async fn add_parts(
)
.await;
}
context.emit_event(Event::ChatEphemeralTimerModified {
chat_id: *chat_id,
timer: timer.to_u32(),
});
}
Err(err) => {
warn!(

View File

@@ -176,6 +176,11 @@ impl ChatId {
paramsv![timer, self],
)
.await?;
context.emit_event(Event::ChatEphemeralTimerModified {
chat_id: self,
timer,
});
Ok(())
}

View File

@@ -5,6 +5,7 @@ use async_std::sync::{channel, Receiver, Sender, TrySendError};
use strum::EnumProperty;
use crate::chat::ChatId;
use crate::ephemeral::Timer as EphemeralTimer;
use crate::message::MsgId;
#[derive(Debug)]
@@ -197,7 +198,10 @@ pub enum Event {
/// Chat ephemeral timer changed.
#[strum(props(id = "2021"))]
ChatEphemeralTimerModified { chat_id: ChatId, timer: u32 },
ChatEphemeralTimerModified {
chat_id: ChatId,
timer: EphemeralTimer,
},
/// Contact(s) created, renamed, blocked or deleted.
///