mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 21:29:52 -07:00
Add configuration option for hiding state events (#447)
This commit is contained in:
parent
ba7d0392d8
commit
c420c9dd65
3 changed files with 20 additions and 11 deletions
|
@ -561,6 +561,7 @@ pub struct TunableValues {
|
|||
pub read_receipt_display: bool,
|
||||
pub request_timeout: u64,
|
||||
pub sort: SortValues,
|
||||
pub state_event_display: bool,
|
||||
pub typing_notice_send: bool,
|
||||
pub typing_notice_display: bool,
|
||||
pub users: UserOverrides,
|
||||
|
@ -586,6 +587,7 @@ pub struct Tunables {
|
|||
pub request_timeout: Option<u64>,
|
||||
#[serde(default)]
|
||||
pub sort: SortOverrides,
|
||||
pub state_event_display: Option<bool>,
|
||||
pub typing_notice_send: Option<bool>,
|
||||
pub typing_notice_display: Option<bool>,
|
||||
pub users: Option<UserOverrides>,
|
||||
|
@ -615,6 +617,7 @@ impl Tunables {
|
|||
read_receipt_display: self.read_receipt_display.or(other.read_receipt_display),
|
||||
request_timeout: self.request_timeout.or(other.request_timeout),
|
||||
sort: merge_sorts(self.sort, other.sort),
|
||||
state_event_display: self.state_event_display.or(other.state_event_display),
|
||||
typing_notice_send: self.typing_notice_send.or(other.typing_notice_send),
|
||||
typing_notice_display: self.typing_notice_display.or(other.typing_notice_display),
|
||||
users: merge_maps(self.users, other.users),
|
||||
|
@ -642,6 +645,7 @@ impl Tunables {
|
|||
read_receipt_display: self.read_receipt_display.unwrap_or(true),
|
||||
request_timeout: self.request_timeout.unwrap_or(DEFAULT_REQ_TIMEOUT),
|
||||
sort: self.sort.values(),
|
||||
state_event_display: self.state_event_display.unwrap_or(true),
|
||||
typing_notice_send: self.typing_notice_send.unwrap_or(true),
|
||||
typing_notice_display: self.typing_notice_display.unwrap_or(true),
|
||||
users: self.users.unwrap_or_default(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue