Commit 70adcb05a7

70adcb05a78033a8e427d31aade14cc72e2698fb

parent: d00ecd4d6b

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2021-08-13 12:05 UTC

feat(room): Add a sign indicating the verification state of the room

Layout: unified · split

src/bar_items/status.rs +10
@@ -28,6 +28,16 @@ impl BarItemCallback for Status {
2828 signs.push(
2929 server.config().borrow().look().encrypted_room_sign(),
3030 );
31
32 if !room.contains_only_verified_devices() {
33 signs.push(
34 server
35 .config()
36 .borrow()
37 .look()
38 .encryption_warning_sign(),
39 );
40 }
3141 }
3242
3343 if room.is_public() {
src/config.rs +7
@@ -93,6 +93,13 @@ config!(
9393 "🔒",
9494 },
9595
96 encryption_warning_sign: String {
97 // Description.
98 "A sign that is used to show that the current room contains unverified devices",
99 // Default value.
100 "❗",
101 },
102
96103 public_room_sign: String {
97104 // Description.
98105 "A sign indicating that the current room is public",
src/room/mod.rs +4
@@ -360,6 +360,10 @@ impl MatrixRoom {
360360 self.room.is_encrypted()
361361 }
362362
363 pub fn contains_only_verified_devices(&self) -> bool {
364 block_on(self.room.contains_only_verified_devices()).unwrap_or_default()
365 }
366
363367 pub fn is_public(&self) -> bool {
364368 self.room.is_public()
365369 }