fix: do not send sync messages if bcc_self is disabled

This commit is contained in:
link2xt
2024-06-19 16:42:27 +00:00
parent 13f58e0ca5
commit 8953c2a7de
2 changed files with 26 additions and 5 deletions

View File

@@ -493,6 +493,14 @@ impl Context {
.is_some())
}
/// Returns true if sync messages should be sent.
///
/// This requires that both `SyncMsgs` and `BccSelf` settings are enabled.
pub(crate) async fn should_send_sync_msgs(&self) -> Result<bool> {
Ok(self.get_config_bool(Config::SyncMsgs).await?
&& self.get_config_bool(Config::BccSelf).await?)
}
/// Gets configured "delete_server_after" value.
///
/// `None` means never delete the message, `Some(0)` means delete