@ -27,6 +27,7 @@ import '../models/app_settings.dart';
import ' ../models/path_history.dart ' ;
import ' ../models/path_history.dart ' ;
import ' ../models/translation_support.dart ' ;
import ' ../models/translation_support.dart ' ;
import ' ../services/app_settings_service.dart ' ;
import ' ../services/app_settings_service.dart ' ;
import ' ../services/block_service.dart ' ;
import ' ../services/chat_text_scale_service.dart ' ;
import ' ../services/chat_text_scale_service.dart ' ;
import ' ../services/path_history_service.dart ' ;
import ' ../services/path_history_service.dart ' ;
import ' ../services/translation_service.dart ' ;
import ' ../services/translation_service.dart ' ;
@ -353,8 +354,22 @@ class _ChatScreenState extends State<ChatScreen> {
if ( value = = ' clearChat ' ) {
if ( value = = ' clearChat ' ) {
connector . clearMessagesForContact ( widget . contact ) ;
connector . clearMessagesForContact ( widget . contact ) ;
}
}
if ( value = = ' block ' ) {
context . read < BlockService > ( ) . block (
widget . contact . publicKeyHex ,
) ;
}
if ( value = = ' unblock ' ) {
context . read < BlockService > ( ) . unblock (
widget . contact . publicKeyHex ,
) ;
}
} ,
} ,
itemBuilder: ( context ) = > [
itemBuilder: ( context ) {
final isBlocked = context . read < BlockService > ( ) . isBlocked (
widget . contact . publicKeyHex ,
) ;
return [
PopupMenuItem (
PopupMenuItem (
value: ' info ' ,
value: ' info ' ,
child: Row (
child: Row (
@ -398,7 +413,28 @@ class _ChatScreenState extends State<ChatScreen> {
] ,
] ,
) ,
) ,
) ,
) ,
PopupMenuItem (
value: isBlocked ? ' unblock ' : ' block ' ,
child: Row (
children: [
Icon (
isBlocked
? Icons . check_circle_outline
: Icons . block ,
size: 20 ,
color: isBlocked ? null : Colors . red . shade700 ,
) ,
const SizedBox ( width: 12 ) ,
Text (
isBlocked
? context . l10n . block_unblock
: context . l10n . block_block ,
) ,
] ,
] ,
) ,
) ,
] ;
} ,
) ;
) ;
} ,
} ,
) ,
) ,