mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
fix archiving requests (#2563)
* add a test for archived requests * fix archived requests * move requests but the last one to "Archived Chats" this way, the app looks familiar after the contact request upgrade. the subselect was copied from the old get_last_deaddrop_fresh_msg() (which was removed by the contact request upgrade #2514) * just move all old requests to "Archived Chats" ux-wise, the advantage of keeping the last one is questionable, one may think, always the last one is shown in chatlist. showing _all_ fresh request is not doable as past cores did not really take care of that and the db-state is not consistent in that regard. that would make the already complicated code even more complicated, so we decided to go the easy way.
This commit is contained in:
@@ -4,7 +4,7 @@ use anyhow::{bail, ensure, Result};
|
||||
|
||||
use crate::chat::{update_special_chat_names, Chat, ChatId, ChatVisibility};
|
||||
use crate::constants::{
|
||||
Chattype, DC_CHAT_ID_ALLDONE_HINT, DC_CHAT_ID_ARCHIVED_LINK, DC_CONTACT_ID_DEVICE,
|
||||
Blocked, Chattype, DC_CHAT_ID_ALLDONE_HINT, DC_CHAT_ID_ARCHIVED_LINK, DC_CONTACT_ID_DEVICE,
|
||||
DC_CONTACT_ID_SELF, DC_CONTACT_ID_UNDEFINED, DC_GCL_ADD_ALLDONE_HINT, DC_GCL_ARCHIVED_ONLY,
|
||||
DC_GCL_FOR_FORWARDING, DC_GCL_NO_SPECIALS,
|
||||
};
|
||||
@@ -379,8 +379,8 @@ pub async fn dc_get_archived_cnt(context: &Context) -> Result<usize> {
|
||||
let count = context
|
||||
.sql
|
||||
.count(
|
||||
"SELECT COUNT(*) FROM chats WHERE blocked=0 AND archived=1;",
|
||||
paramsv![],
|
||||
"SELECT COUNT(*) FROM chats WHERE blocked!=? AND archived=?;",
|
||||
paramsv![Blocked::Manually, ChatVisibility::Archived],
|
||||
)
|
||||
.await?;
|
||||
Ok(count)
|
||||
|
||||
Reference in New Issue
Block a user