mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 02:16:29 +03:00
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:
committed by
holger krekel
parent
a0c92753a9
commit
5405bfbc8d
@@ -263,7 +263,6 @@ pub struct Message {
|
||||
pub(crate) server_folder: Option<String>,
|
||||
pub(crate) server_uid: u32,
|
||||
pub(crate) is_dc_message: MessengerMessage,
|
||||
pub(crate) starred: bool,
|
||||
pub(crate) chat_blocked: Blocked,
|
||||
pub(crate) location_id: u32,
|
||||
pub(crate) error: String,
|
||||
@@ -307,7 +306,6 @@ impl Message {
|
||||
" m.msgrmsg AS msgrmsg,",
|
||||
" m.txt AS txt,",
|
||||
" m.param AS param,",
|
||||
" m.starred AS starred,",
|
||||
" m.hidden AS hidden,",
|
||||
" m.location_id AS location,",
|
||||
" c.blocked AS blocked",
|
||||
@@ -357,7 +355,6 @@ impl Message {
|
||||
msg.text = Some(text);
|
||||
|
||||
msg.param = row.get::<_, String>("param")?.parse().unwrap_or_default();
|
||||
msg.starred = row.get("starred")?;
|
||||
msg.hidden = row.get("hidden")?;
|
||||
msg.location_id = row.get("location")?;
|
||||
msg.chat_blocked = row
|
||||
@@ -582,10 +579,6 @@ impl Message {
|
||||
self.state as i32 >= MessageState::OutDelivered as i32
|
||||
}
|
||||
|
||||
pub fn is_starred(&self) -> bool {
|
||||
self.starred
|
||||
}
|
||||
|
||||
pub fn is_forwarded(&self) -> bool {
|
||||
0 != self.param.get_int(Param::Forwarded).unwrap_or_default()
|
||||
}
|
||||
@@ -1303,23 +1296,6 @@ pub async fn update_msg_state(context: &Context, msg_id: MsgId, state: MessageSt
|
||||
.is_ok()
|
||||
}
|
||||
|
||||
pub async fn star_msgs(context: &Context, msg_ids: Vec<MsgId>, star: bool) -> bool {
|
||||
if msg_ids.is_empty() {
|
||||
return false;
|
||||
}
|
||||
context
|
||||
.sql
|
||||
.with_conn(move |conn| {
|
||||
let mut stmt = conn.prepare("UPDATE msgs SET starred=? WHERE id=?;")?;
|
||||
for msg_id in msg_ids.into_iter() {
|
||||
stmt.execute(paramsv![star as i32, msg_id])?;
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
.await
|
||||
.is_ok()
|
||||
}
|
||||
|
||||
/// Returns a summary text.
|
||||
pub async fn get_summarytext_by_raw(
|
||||
viewtype: Viewtype,
|
||||
|
||||
Reference in New Issue
Block a user