zulip_api/message/realm_message_edit_history_visibility_policy.rs
1use serde::{Deserialize, Serialize};
2
3use crate::{impl_default, impl_display};
4
5/// What typesof message edit history are accessible to users via [message edit history](https://zulip.com/help/view-a-messages-edit-history).
6///
7/// Present if `realm` is present in `fetch_event_types`.
8///
9/// - \"all\": All edit history is visible.
10/// - \"moves\": Only moves are visible.
11/// - \"none\": No edit history is visible.
12///
13/// **Changes**: New in Zulip 10.0 (feature level 358), replacing the previous `allow_edit_history` boolean setting; `true` corresponds to `all`, and `false` to `none`.
14#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
15#[serde(rename_all = "lowercase")]
16pub enum RealmMessageEditHistoryVisibilityPolicy {
17 /// All edit history is visible.
18 All,
19 /// Only moves are visible.
20 Moves,
21 /// No edit history is visible.
22 None,
23}
24
25impl RealmMessageEditHistoryVisibilityPolicy {
26 /// Creates a new [Self].
27 pub const fn new() -> Self {
28 Self::All
29 }
30}
31
32impl_default!(RealmMessageEditHistoryVisibilityPolicy);
33impl_display!(RealmMessageEditHistoryVisibilityPolicy);