Commit 0f69fddeb3
0f69fddeb31e176a85e907645b586d7a02aba9a5
parent: 513c30591c
Unsigned
Darafei Praliaskouski <me@komzpa.net> · 2026-06-23 19:32 UTC
committer: <strk@kbt.io>
fix: refresh room verification status
Layout: unified · split
src/room/mod.rs
+9 −1
| @@ -417,6 +417,10 @@ impl BufferInputCallbackAsync for MatrixRoom { |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | impl MatrixRoom { |
| 420 | fn update_status_bar(&self) { |
| 421 | Weechat::bar_item_update("buffer_modes"); |
| 422 | } |
| 423 | |
| 420 | 424 | pub fn is_encrypted(&self) -> bool { |
| 421 | 425 | self.members |
| 422 | 426 | .runtime |
| @@ -1090,7 +1094,9 @@ impl MatrixRoom { |
| 1090 | 1094 | ambiguity_change, |
| 1091 | 1095 | smart_filter_delay_ms, |
| 1092 | 1096 | ) |
| 1093 | | .await |
| 1097 | .await; |
| 1098 | |
| 1099 | self.update_status_bar(); |
| 1094 | 1100 | } |
| 1095 | 1101 | |
| 1096 | 1102 | fn set_prev_batch(&self) { |
| @@ -1178,5 +1184,7 @@ impl MatrixRoom { |
| 1178 | 1184 | } |
| 1179 | 1185 | _ => (), |
| 1180 | 1186 | } |
| 1187 | |
| 1188 | self.update_status_bar(); |
| 1181 | 1189 | } |
| 1182 | 1190 | } |
src/room/verification.rs
+3
| @@ -10,6 +10,7 @@ use matrix_sdk::{ |
| 10 | 10 | UserId, |
| 11 | 11 | }, |
| 12 | 12 | }; |
| 13 | use weechat::Weechat; |
| 13 | 14 | |
| 14 | 15 | use crate::{ |
| 15 | 16 | connection::Connection, |
| @@ -222,5 +223,7 @@ impl Verification { |
| 222 | 223 | } |
| 223 | 224 | _ => {} |
| 224 | 225 | } |
| 226 | |
| 227 | Weechat::bar_item_update("buffer_modes"); |
| 225 | 228 | } |
| 226 | 229 | } |
src/server.rs
+12
| @@ -808,10 +808,13 @@ impl InnerServer { |
| 808 | 808 | } |
| 809 | 809 | }; |
| 810 | 810 | |
| 811 | let mut refresh_status_bar = false; |
| 812 | |
| 811 | 813 | match &event { |
| 812 | 814 | AnyToDeviceEvent::RoomKey(_) => {} |
| 813 | 815 | AnyToDeviceEvent::RoomKeyRequest(_) => {} |
| 814 | 816 | AnyToDeviceEvent::KeyVerificationRequest(e) => { |
| 817 | refresh_status_bar = true; |
| 815 | 818 | if let Some(client) = self.get_client() { |
| 816 | 819 | if let Some(request) = client |
| 817 | 820 | .encryption() |
| @@ -836,6 +839,7 @@ impl InnerServer { |
| 836 | 839 | } |
| 837 | 840 | } |
| 838 | 841 | AnyToDeviceEvent::KeyVerificationStart(e) => { |
| 842 | refresh_status_bar = true; |
| 839 | 843 | if let Some(client) = self.get_client() { |
| 840 | 844 | use matrix_sdk::encryption::verification::Verification; |
| 841 | 845 | match client |
| @@ -892,20 +896,28 @@ impl InnerServer { |
| 892 | 896 | } |
| 893 | 897 | } |
| 894 | 898 | AnyToDeviceEvent::KeyVerificationCancel(e) => { |
| 899 | refresh_status_bar = true; |
| 895 | 900 | handle_event(&event, e.content.transaction_id.to_string()) |
| 896 | 901 | .await; |
| 897 | 902 | } |
| 898 | 903 | AnyToDeviceEvent::KeyVerificationAccept(e) => { |
| 904 | refresh_status_bar = true; |
| 899 | 905 | handle_event(&event, e.content.transaction_id.to_string()).await |
| 900 | 906 | } |
| 901 | 907 | AnyToDeviceEvent::KeyVerificationKey(e) => { |
| 908 | refresh_status_bar = true; |
| 902 | 909 | handle_event(&event, e.content.transaction_id.to_string()).await |
| 903 | 910 | } |
| 904 | 911 | AnyToDeviceEvent::KeyVerificationMac(e) => { |
| 912 | refresh_status_bar = true; |
| 905 | 913 | handle_event(&event, e.content.transaction_id.to_string()).await |
| 906 | 914 | } |
| 907 | 915 | _ => {} |
| 908 | 916 | } |
| 917 | |
| 918 | if refresh_status_bar { |
| 919 | Weechat::bar_item_update("buffer_modes"); |
| 920 | } |
| 909 | 921 | } |
| 910 | 922 | |
| 911 | 923 | pub async fn receive_member( |