mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
change muted forever to -1
This commit is contained in:
@@ -1587,7 +1587,7 @@ int dc_set_chat_profile_image (dc_context_t* context, uint32_t ch
|
|||||||
*
|
*
|
||||||
* @memberof dc_context_t
|
* @memberof dc_context_t
|
||||||
* @param chat_id The chat ID to set the mute duration.
|
* @param chat_id The chat ID to set the mute duration.
|
||||||
* @param duration The duration (0 for no mute, 1 for forever mute, >1 unix timestamp it until it should be unmuted again)
|
* @param duration The duration (0 for no mute, -1 for forever mute, >0 unix timestamp it until it should be unmuted again)
|
||||||
* @param context The context as created by dc_context_new().
|
* @param context The context as created by dc_context_new().
|
||||||
* @return 1=success, 0=error
|
* @return 1=success, 0=error
|
||||||
*/
|
*/
|
||||||
@@ -2936,7 +2936,7 @@ int dc_chat_is_sending_locations (const dc_chat_t* chat);
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check wether the chat is currently muted
|
* Check whether the chat is currently muted
|
||||||
*
|
*
|
||||||
* @memberof dc_chat_t
|
* @memberof dc_chat_t
|
||||||
* @param chat The chat object.
|
* @param chat The chat object.
|
||||||
@@ -2950,7 +2950,7 @@ int dc_chat_is_muted (const dc_chat_t* chat);
|
|||||||
*
|
*
|
||||||
* @memberof dc_chat_t
|
* @memberof dc_chat_t
|
||||||
* @param chat The chat object.
|
* @param chat The chat object.
|
||||||
* @return 0=not muted, 1=muted, (x>1)=unix timestamp until mute is lifted
|
* @return 0=not muted, -1=forever muted, (x>0)=unix timestamp until mute is lifted
|
||||||
*/
|
*/
|
||||||
int64_t dc_chat_get_mute_duration (const dc_chat_t* chat);
|
int64_t dc_chat_get_mute_duration (const dc_chat_t* chat);
|
||||||
|
|
||||||
|
|||||||
@@ -980,7 +980,7 @@ pub struct ChatInfo {
|
|||||||
/// simple `has_draft` bool instead.
|
/// simple `has_draft` bool instead.
|
||||||
pub draft: String,
|
pub draft: String,
|
||||||
|
|
||||||
/// Wether the chat is muted
|
/// Whether the chat is muted
|
||||||
///
|
///
|
||||||
/// The exact time its muted can be found out via the `chat.mute_duration` property
|
/// The exact time its muted can be found out via the `chat.mute_duration` property
|
||||||
pub is_muted: bool,
|
pub is_muted: bool,
|
||||||
@@ -1929,7 +1929,7 @@ impl MuteDuration {
|
|||||||
pub fn serialize(&self) -> i64 {
|
pub fn serialize(&self) -> i64 {
|
||||||
match &self {
|
match &self {
|
||||||
MuteDuration::NotMuted => 0,
|
MuteDuration::NotMuted => 0,
|
||||||
MuteDuration::Forever => 1,
|
MuteDuration::Forever => -1,
|
||||||
MuteDuration::MutedUntilTimestamp(timestamp) => *timestamp as i64, // TODO make this pretier?
|
MuteDuration::MutedUntilTimestamp(timestamp) => *timestamp as i64, // TODO make this pretier?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1937,7 +1937,7 @@ impl MuteDuration {
|
|||||||
pub fn deserialize(value: i64) -> MuteDuration {
|
pub fn deserialize(value: i64) -> MuteDuration {
|
||||||
match value {
|
match value {
|
||||||
0 => MuteDuration::NotMuted,
|
0 => MuteDuration::NotMuted,
|
||||||
1 => MuteDuration::Forever,
|
-1 => MuteDuration::Forever,
|
||||||
_ => MuteDuration::MutedUntilTimestamp(value),
|
_ => MuteDuration::MutedUntilTimestamp(value),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user