| @@ -183,6 +183,7 @@ pub struct TunableValues { |
| 183 | pub typing_notice_send: bool, |
183 | pub typing_notice_send: bool, |
| 184 | pub typing_notice_display: bool, |
184 | pub typing_notice_display: bool, |
| 185 | pub users: UserOverrides, |
185 | pub users: UserOverrides, |
| |
186 | pub default_room: Option<String>, |
| 186 | } |
187 | } |
| 187 | |
188 | |
| 188 | #[derive(Clone, Default, Deserialize)] |
189 | #[derive(Clone, Default, Deserialize)] |
| @@ -192,6 +193,7 @@ pub struct Tunables { |
| 192 | pub typing_notice_send: Option<bool>, |
193 | pub typing_notice_send: Option<bool>, |
| 193 | pub typing_notice_display: Option<bool>, |
194 | pub typing_notice_display: Option<bool>, |
| 194 | pub users: Option<UserOverrides>, |
195 | pub users: Option<UserOverrides>, |
| |
196 | pub default_room: Option<String>, |
| 195 | } |
197 | } |
| 196 | |
198 | |
| 197 | impl Tunables { |
199 | impl Tunables { |
| @@ -202,6 +204,7 @@ impl Tunables { |
| 202 | typing_notice_send: self.typing_notice_send.or(other.typing_notice_send), |
204 | typing_notice_send: self.typing_notice_send.or(other.typing_notice_send), |
| 203 | typing_notice_display: self.typing_notice_display.or(other.typing_notice_display), |
205 | typing_notice_display: self.typing_notice_display.or(other.typing_notice_display), |
| 204 | users: merge_users(self.users, other.users), |
206 | users: merge_users(self.users, other.users), |
| |
207 | default_room: self.default_room.or(other.default_room), |
| 205 | } |
208 | } |
| 206 | } |
209 | } |
| 207 | |
210 | |
| @@ -212,6 +215,7 @@ impl Tunables { |
| 212 | typing_notice_send: self.typing_notice_send.unwrap_or(true), |
215 | typing_notice_send: self.typing_notice_send.unwrap_or(true), |
| 213 | typing_notice_display: self.typing_notice_display.unwrap_or(true), |
216 | typing_notice_display: self.typing_notice_display.unwrap_or(true), |
| 214 | users: self.users.unwrap_or_default(), |
217 | users: self.users.unwrap_or_default(), |
| |
218 | default_room: self.default_room, |
| 215 | } |
219 | } |
| 216 | } |
220 | } |
| 217 | } |
221 | } |