mirror of
https://github.com/chatmail/core.git
synced 2026-05-18 22:36:29 +03:00
Don't add the webxdc twice if the setting is set twice
This commit is contained in:
@@ -340,9 +340,15 @@ impl Context {
|
|||||||
{
|
{
|
||||||
message::delete_msgs(self, &[MsgId::new(webxdc_message_id)]).await?;
|
message::delete_msgs(self, &[MsgId::new(webxdc_message_id)]).await?;
|
||||||
}
|
}
|
||||||
self.sql.set_raw_config(key, value).await?;
|
self.sql.set_raw_config(key, None).await?;
|
||||||
self.debug_logging.store(0, atomic::Ordering::Relaxed);
|
self.debug_logging.store(0, atomic::Ordering::Relaxed);
|
||||||
} else {
|
} else if self
|
||||||
|
.sql
|
||||||
|
.get_raw_config_u32(Config::DebugLogging)
|
||||||
|
.await?
|
||||||
|
.unwrap_or(0)
|
||||||
|
== 0
|
||||||
|
{
|
||||||
// the unbundled version lives at https://github.com/webxdc/webxdc_logging
|
// the unbundled version lives at https://github.com/webxdc/webxdc_logging
|
||||||
let data: &[u8] = include_bytes!("../assets/webxdc_logging.xdc");
|
let data: &[u8] = include_bytes!("../assets/webxdc_logging.xdc");
|
||||||
|
|
||||||
|
|||||||
@@ -1286,7 +1286,7 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
|
|||||||
if context.get_config(Config::DebugLogging).await? == Some(msg_id.to_u32().to_string()) {
|
if context.get_config(Config::DebugLogging).await? == Some(msg_id.to_u32().to_string()) {
|
||||||
context
|
context
|
||||||
.sql
|
.sql
|
||||||
.set_raw_config(Config::DebugLogging, Some("0"))
|
.set_raw_config(Config::DebugLogging, None)
|
||||||
.await?;
|
.await?;
|
||||||
context.debug_logging.store(0, atomic::Ordering::Relaxed);
|
context.debug_logging.store(0, atomic::Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user