fix: stop using leftgrps table

This commit is contained in:
link2xt
2025-10-28 18:05:55 +00:00
committed by l
parent b920552fc3
commit 2ada3cd613
4 changed files with 44 additions and 39 deletions

View File

@@ -3881,7 +3881,6 @@ pub async fn remove_contact_from_chat(
if contact_id == ContactId::SELF {
res?;
set_group_explicitly_left(context, &chat.grpid).await?;
} else if let Err(e) = res {
warn!(
context,
@@ -3935,25 +3934,6 @@ async fn send_member_removal_msg(
send_msg(context, chat.id, &mut msg).await
}
async fn set_group_explicitly_left(context: &Context, grpid: &str) -> Result<()> {
if !is_group_explicitly_left(context, grpid).await? {
context
.sql
.execute("INSERT INTO leftgrps (grpid) VALUES(?);", (grpid,))
.await?;
}
Ok(())
}
pub(crate) async fn is_group_explicitly_left(context: &Context, grpid: &str) -> Result<bool> {
let exists = context
.sql
.exists("SELECT COUNT(*) FROM leftgrps WHERE grpid=?;", (grpid,))
.await?;
Ok(exists)
}
/// Sets group or mailing list chat name.
pub async fn set_chat_name(context: &Context, chat_id: ChatId, new_name: &str) -> Result<()> {
rename_ex(context, Sync, chat_id, new_name).await