mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 15:06:30 +03:00
Replace some magic numbers with constants
This commit is contained in:
@@ -879,7 +879,7 @@ pub fn send_text_msg(
|
||||
) -> Result<MsgId, Error> {
|
||||
ensure!(
|
||||
chat_id > DC_CHAT_ID_LAST_SPECIAL,
|
||||
"bad chat_id = {} <= 9",
|
||||
"bad chat_id = {} <= DC_CHAT_ID_LAST_SPECIAL",
|
||||
chat_id
|
||||
);
|
||||
|
||||
@@ -1254,7 +1254,7 @@ pub fn get_next_media(
|
||||
pub fn archive(context: &Context, chat_id: u32, archive: bool) -> Result<(), Error> {
|
||||
ensure!(
|
||||
chat_id > DC_CHAT_ID_LAST_SPECIAL,
|
||||
"bad chat_id = {} <= 9",
|
||||
"bad chat_id = {} <= DC_CHAT_ID_LAST_SPECIAL",
|
||||
chat_id
|
||||
);
|
||||
|
||||
@@ -1289,7 +1289,7 @@ pub fn archive(context: &Context, chat_id: u32, archive: bool) -> Result<(), Err
|
||||
pub fn delete(context: &Context, chat_id: u32) -> Result<(), Error> {
|
||||
ensure!(
|
||||
chat_id > DC_CHAT_ID_LAST_SPECIAL,
|
||||
"bad chat_id = {} <= 9",
|
||||
"bad chat_id = {} <= DC_CHAT_ID_LAST_SPECIAL",
|
||||
chat_id
|
||||
);
|
||||
/* Up to 2017-11-02 deleting a group also implied leaving it, see above why we have changed this. */
|
||||
@@ -1578,7 +1578,7 @@ pub fn remove_contact_from_chat(
|
||||
) -> Result<(), Error> {
|
||||
ensure!(
|
||||
chat_id > DC_CHAT_ID_LAST_SPECIAL,
|
||||
"bad chat_id = {} <= 9",
|
||||
"bad chat_id = {} <= DC_CHAT_ID_LAST_SPECIAL",
|
||||
chat_id
|
||||
);
|
||||
ensure!(
|
||||
|
||||
Reference in New Issue
Block a user