remove unused types "starred" and "in-creation"

both are not used in productive:
- chat-id "in-creation" was dropped completely already in core-c
  as it does not allow assigning messages to chats in time.
- message flag "starred" was added at some point and never used.
  ux-wise, "disappearing messages" promises to clean up a chat -
  this does not fit well with "starring" messages.
  "saved messages" chat seems to be superior in that regard.
  but anyway, it is not used but comes at maintainance costs,
  so it is better to delete its functionality for now.
  (the db entries, however, are left for now,
  that might be more tricky to remove)
This commit is contained in:
B. Petersen
2020-10-03 13:13:04 +02:00
committed by holger krekel
parent a0c92753a9
commit 5405bfbc8d
7 changed files with 1 additions and 129 deletions

View File

@@ -92,13 +92,6 @@ impl ChatId {
self.0 == DC_CHAT_ID_TRASH
}
// DC_CHAT_ID_MSGS_IN_CREATION seems unused?
/// Virtual chat showing all starred messages.
pub fn is_starred(self) -> bool {
self.0 == DC_CHAT_ID_STARRED
}
/// Chat ID signifying there are **any** number of archived chats.
///
/// This chat ID can be returned in a [Chatlist] and signals to
@@ -508,8 +501,6 @@ impl std::fmt::Display for ChatId {
write!(f, "Chat#Deadrop")
} else if self.is_trash() {
write!(f, "Chat#Trash")
} else if self.is_starred() {
write!(f, "Chat#Starred")
} else if self.is_archived_link() {
write!(f, "Chat#ArchivedLink")
} else if self.is_alldone_hint() {
@@ -610,8 +601,6 @@ impl Chat {
let tempname = context.stock_str(StockMessage::ArchivedChats).await;
let cnt = dc_get_archived_cnt(context).await;
chat.name = format!("{} ({})", tempname, cnt);
} else if chat.id.is_starred() {
chat.name = context.stock_str(StockMessage::StarredMsgs).await.into();
} else {
if chat.typ == Chattype::Single {
let contacts = get_chat_contacts(context, chat.id).await;
@@ -1731,23 +1720,6 @@ pub async fn get_chat_msgs(
process_rows,
)
.await
} else if chat_id.is_starred() {
context
.sql
.query_map(
"SELECT m.id AS id, m.timestamp AS timestamp
FROM msgs m
LEFT JOIN contacts ct
ON m.from_id=ct.id
WHERE m.starred=1
AND m.hidden=0
AND ct.blocked=0
ORDER BY m.timestamp,m.id;",
paramsv![],
process_row,
process_rows,
)
.await
} else {
context
.sql