@ -29,6 +29,7 @@ import '../services/message_retry_service.dart';
import ' ../services/path_history_service.dart ' ;
import ' ../services/mesh_topology_service.dart ' ;
import ' ../services/app_settings_service.dart ' ;
import ' ../services/block_service.dart ' ;
import ' ../services/background_service.dart ' ;
import ' ../services/timeout_prediction_service.dart ' ;
import ' ../services/translation_service.dart ' ;
@ -367,6 +368,7 @@ class MeshCoreConnector extends ChangeNotifier {
PathHistoryService ? _pathHistoryService ;
MeshTopologyService ? _topologyService ;
AppSettingsService ? _appSettingsService ;
BlockService ? _blockService ;
BackgroundService ? _backgroundService ;
final NotificationService _notificationService = NotificationService ( ) ;
BleDebugLogService ? _bleDebugLogService ;
@ -1009,6 +1011,7 @@ class MeshCoreConnector extends ChangeNotifier {
AppDebugLogService ? appDebugLogService ,
BackgroundService ? backgroundService ,
TimeoutPredictionService ? timeoutPredictionService ,
BlockService ? blockService ,
} ) {
_retryService = retryService ;
_pathHistoryService = pathHistoryService ;
@ -1019,6 +1022,7 @@ class MeshCoreConnector extends ChangeNotifier {
_appDebugLogService = appDebugLogService ;
_backgroundService = backgroundService ;
_timeoutPredictionService = timeoutPredictionService ;
_blockService = blockService ;
_usbManager . setDebugLogService ( _appDebugLogService ) ;
_tcpConnector . setDebugLogService ( _appDebugLogService ) ;
@ -4754,7 +4758,9 @@ class MeshCoreConnector extends ChangeNotifier {
/ / Show notification for new contact ( advertisement )
if ( isNewContact & & _appSettingsService ! = null ) {
final settings = _appSettingsService ! . settings ;
if ( settings . notificationsEnabled & & settings . notifyOnNewAdvert ) {
if ( settings . notificationsEnabled & &
settings . notifyOnNewAdvert & &
! ( _blockService ? . isBlocked ( contact . publicKeyHex ) ? ? false ) ) {
_notificationService . showAdvertNotification (
contactName: contact . name ,
contactType: contact . typeLabelRaw ,
@ -4832,7 +4838,9 @@ class MeshCoreConnector extends ChangeNotifier {
/ / Show notification for new contact ( advertisement )
if ( isNewContact & & _appSettingsService ! = null ) {
final settings = _appSettingsService ! . settings ;
if ( settings . notificationsEnabled & & settings . notifyOnNewAdvert ) {
if ( settings . notificationsEnabled & &
settings . notifyOnNewAdvert & &
! ( _blockService ? . isBlocked ( contact . publicKeyHex ) ? ? false ) ) {
_notificationService . showAdvertNotification (
contactName: contact . name ,
contactType: contact . typeLabelRaw ,
@ -5005,6 +5013,14 @@ class MeshCoreConnector extends ChangeNotifier {
return ;
}
/ / Blocked sender: drop the DM entirely — no thread entry , no unread , no
/ / notification , no lastMessage bump . Adverts still flow for name self - heal .
if ( ! message . isOutgoing & &
( _blockService ? . isBlocked ( message . senderKeyHex ) ? ? false ) ) {
_handleQueuedMessageReceived ( ) ;
return ;
}
final contact = _contacts . cast < Contact ? > ( ) . firstWhere (
( c ) = > c ? . publicKeyHex = = message ! . senderKeyHex ,
orElse: ( ) = > null ,
@ -6960,7 +6976,9 @@ class MeshCoreConnector extends ChangeNotifier {
/ / Show notification for new contact ( advertisement )
if ( _appSettingsService ! = null & & ! noNotify ) {
final settings = _appSettingsService ! . settings ;
if ( settings . notificationsEnabled & & settings . notifyOnNewAdvert ) {
if ( settings . notificationsEnabled & &
settings . notifyOnNewAdvert & &
! ( _blockService ? . isBlocked ( contact . publicKeyHex ) ? ? false ) ) {
_notificationService . showAdvertNotification (
contactName: contact . name ,
contactType: contact . typeLabelRaw ,