@@ -7,7 +7,9 @@ use std::path::{Path, PathBuf};
77
88use edit:: edit_with_builder as external_edit;
99use edit:: Builder ;
10+ use matrix_sdk:: EncryptionState ;
1011use modalkit:: editing:: store:: RegisterError ;
12+ use ratatui:: style:: { Color , Style } ;
1113use std:: process:: Command ;
1214use tokio;
1315use url:: Url ;
@@ -975,7 +977,16 @@ impl StatefulWidget for Chat<'_> {
975977 Paragraph :: new ( desc_spans) . render ( descarea, buf) ;
976978 }
977979
978- let prompt = if self . focused { "> " } else { " " } ;
980+ let prompt = match ( self . focused , state. room ( ) . encryption_state ( ) ) {
981+ ( false , _) => Span :: raw ( " " ) ,
982+ ( _, EncryptionState :: Encrypted ) => {
983+ Span :: styled ( "\u{1F512} \u{FE0E} " , Style :: new ( ) . fg ( Color :: LightGreen ) )
984+ } ,
985+ ( _, EncryptionState :: NotEncrypted ) => {
986+ Span :: styled ( "\u{1F513} \u{FE0E} " , Style :: new ( ) . fg ( Color :: Red ) )
987+ } ,
988+ ( _, EncryptionState :: Unknown ) => Span :: styled ( "> " , Style :: new ( ) . fg ( Color :: Red ) ) ,
989+ } ;
979990
980991 let tbox = TextBox :: new ( ) . prompt ( prompt) ;
981992 tbox. render ( textarea, buf, & mut state. tbox ) ;
0 commit comments