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
419impl MatrixRoom { 419impl MatrixRoom {
420 fn update_status_bar(&self) {
421 Weechat::bar_item_update("buffer_modes");
422 }
423
420 pub fn is_encrypted(&self) -> bool { 424 pub fn is_encrypted(&self) -> bool {
421 self.members 425 self.members
422 .runtime 426 .runtime
@@ -1090,7 +1094,9 @@ impl MatrixRoom {
1090 ambiguity_change, 1094 ambiguity_change,
1091 smart_filter_delay_ms, 1095 smart_filter_delay_ms,
1092 ) 1096 )
1093 .await 1097 .await;
1098
1099 self.update_status_bar();
1094 } 1100 }
1095 1101
1096 fn set_prev_batch(&self) { 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 UserId, 10 UserId,
11 }, 11 },
12}; 12};
13use weechat::Weechat;
13 14
14use crate::{ 15use crate::{
15 connection::Connection, 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 match &event { 813 match &event {
812 AnyToDeviceEvent::RoomKey(_) => {} 814 AnyToDeviceEvent::RoomKey(_) => {}
813 AnyToDeviceEvent::RoomKeyRequest(_) => {} 815 AnyToDeviceEvent::RoomKeyRequest(_) => {}
814 AnyToDeviceEvent::KeyVerificationRequest(e) => { 816 AnyToDeviceEvent::KeyVerificationRequest(e) => {
817 refresh_status_bar = true;
815 if let Some(client) = self.get_client() { 818 if let Some(client) = self.get_client() {
816 if let Some(request) = client 819 if let Some(request) = client
817 .encryption() 820 .encryption()
@@ -836,6 +839,7 @@ impl InnerServer {
836 } 839 }
837 } 840 }
838 AnyToDeviceEvent::KeyVerificationStart(e) => { 841 AnyToDeviceEvent::KeyVerificationStart(e) => {
842 refresh_status_bar = true;
839 if let Some(client) = self.get_client() { 843 if let Some(client) = self.get_client() {
840 use matrix_sdk::encryption::verification::Verification; 844 use matrix_sdk::encryption::verification::Verification;
841 match client 845 match client
@@ -892,20 +896,28 @@ impl InnerServer {
892 } 896 }
893 } 897 }
894 AnyToDeviceEvent::KeyVerificationCancel(e) => { 898 AnyToDeviceEvent::KeyVerificationCancel(e) => {
899 refresh_status_bar = true;
895 handle_event(&event, e.content.transaction_id.to_string()) 900 handle_event(&event, e.content.transaction_id.to_string())
896 .await; 901 .await;
897 } 902 }
898 AnyToDeviceEvent::KeyVerificationAccept(e) => { 903 AnyToDeviceEvent::KeyVerificationAccept(e) => {
904 refresh_status_bar = true;
899 handle_event(&event, e.content.transaction_id.to_string()).await 905 handle_event(&event, e.content.transaction_id.to_string()).await
900 } 906 }
901 AnyToDeviceEvent::KeyVerificationKey(e) => { 907 AnyToDeviceEvent::KeyVerificationKey(e) => {
908 refresh_status_bar = true;
902 handle_event(&event, e.content.transaction_id.to_string()).await 909 handle_event(&event, e.content.transaction_id.to_string()).await
903 } 910 }
904 AnyToDeviceEvent::KeyVerificationMac(e) => { 911 AnyToDeviceEvent::KeyVerificationMac(e) => {
912 refresh_status_bar = true;
905 handle_event(&event, e.content.transaction_id.to_string()).await 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 pub async fn receive_member( 923 pub async fn receive_member(