mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 06:26:30 +03:00
cleanup jobs and Params relicts
- the `jobs` table is no longer in use, no need to track files on housekeeping, no need to clear it from repl tool - some `Params` were used for jobs table only, they can be used freely for other purposes on other tables. param 'protection settings timestamp' was never used in practise, its code is removed as well, so we can free the Param as well.
This commit is contained in:
23
src/param.rs
23
src/param.rs
@@ -9,7 +9,6 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::blob::BlobObject;
|
||||
use crate::context::Context;
|
||||
use crate::message::MsgId;
|
||||
use crate::mimeparser::SystemMessage;
|
||||
|
||||
/// Available param keys.
|
||||
@@ -18,7 +17,7 @@ use crate::mimeparser::SystemMessage;
|
||||
)]
|
||||
#[repr(u8)]
|
||||
pub enum Param {
|
||||
/// For messages and jobs
|
||||
/// For messages
|
||||
File = b'f',
|
||||
|
||||
/// For messages: original filename (as shown in chat)
|
||||
@@ -107,18 +106,12 @@ pub enum Param {
|
||||
/// is used to also send all the forwarded messages.
|
||||
PrepForwards = b'P',
|
||||
|
||||
/// For Jobs
|
||||
/// For Messages
|
||||
SetLatitude = b'l',
|
||||
|
||||
/// For Jobs
|
||||
/// For Messages
|
||||
SetLongitude = b'n',
|
||||
|
||||
/// For Jobs
|
||||
AlsoMove = b'M',
|
||||
|
||||
/// For MDN-sending job
|
||||
MsgId = b'I',
|
||||
|
||||
/// For Groups
|
||||
///
|
||||
/// An unpromoted group has not had any messages sent to it and thus only exists on the
|
||||
@@ -173,9 +166,6 @@ pub enum Param {
|
||||
/// For Chats: timestamp of member list update.
|
||||
MemberListTimestamp = b'k',
|
||||
|
||||
/// For Chats: timestamp of protection settings update.
|
||||
ProtectionSettingsTimestamp = b'L',
|
||||
|
||||
/// For Webxdc Message Instances: Current document name
|
||||
WebxdcDocument = b'R',
|
||||
|
||||
@@ -190,6 +180,7 @@ pub enum Param {
|
||||
|
||||
/// For messages: Whether [crate::message::Viewtype::Sticker] should be forced.
|
||||
ForceSticker = b'X',
|
||||
// 'L' was defined as ProtectionSettingsTimestamp for Chats, however, never used in production.
|
||||
}
|
||||
|
||||
/// An object for handling key=value parameter lists.
|
||||
@@ -399,12 +390,6 @@ impl Params {
|
||||
Ok(Some(path))
|
||||
}
|
||||
|
||||
pub fn get_msg_id(&self) -> Option<MsgId> {
|
||||
self.get(Param::MsgId)
|
||||
.and_then(|x| x.parse().ok())
|
||||
.map(MsgId::new)
|
||||
}
|
||||
|
||||
/// Set the given parameter to the passed in `i32`.
|
||||
pub fn set_int(&mut self, key: Param, value: i32) -> &mut Self {
|
||||
self.set(key, format!("{value}"));
|
||||
|
||||
Reference in New Issue
Block a user