mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-30 23:33:01 +10:00
Notification rate limiting (#110)
* Add notification rate limiting with privacy-safe debug logging - Add batching system to prevent notification storms (3s rate limit, 5s batch window) - Queue rapid notifications and show batch summaries - Debug logs show device names for adverts, sender/channel for messages (no content leaks) - Remove unused _maxBatchSize constant Context: Added after getting notification-flooded while evaluating RF flood management. The irony. * Update notification_service.dart I made a mistake and removed this * Add l10n support for notification strings Addresses PR #110 review feedback to use the translations system: - Add notification strings to app_en.arb (plurals for batch summary) - Update NotificationService to use lookupAppLocalizations() - Wire locale from MaterialApp to NotificationService - Regenerate localization files New strings added (English only, translations needed): - notification_activityTitle: "MeshCore Activity" - notification_messagesCount: "{count} message(s)" - notification_channelMessagesCount: "{count} channel message(s)" - notification_newNodesCount: "{count} new node(s)" - notification_newTypeDiscovered: "New {type} discovered" - notification_receivedNewMessage: "Received new message" * Add notification string translations for all supported languages Translated notification_activityTitle, notification_messagesCount, notification_channelMessagesCount, notification_newNodesCount, notification_newTypeDiscovered, and notification_receivedNewMessage to: bg, de, es, fr, it, nl, pl, pt, ru, sk, sl, sv, uk, zh Includes proper ICU plural forms for Slavic languages (few/many/other) and Slovenian dual form. * Apply dart format to notification_service.dart --------- Co-authored-by: Winston Lowe <wel97459@gmail.com>
This commit is contained in:
@@ -2773,6 +2773,50 @@ class AppLocalizationsPt extends AppLocalizations {
|
||||
String get contacts_contactAdvertCopyFailed =>
|
||||
'Cópia do anúncio para a Área de Transferência falhou.';
|
||||
|
||||
@override
|
||||
String get notification_activityTitle => 'Atividade MeshCore';
|
||||
|
||||
@override
|
||||
String notification_messagesCount(int count) {
|
||||
String _temp0 = intl.Intl.pluralLogic(
|
||||
count,
|
||||
locale: localeName,
|
||||
other: 'mensagens',
|
||||
one: 'mensagem',
|
||||
);
|
||||
return '$count $_temp0';
|
||||
}
|
||||
|
||||
@override
|
||||
String notification_channelMessagesCount(int count) {
|
||||
String _temp0 = intl.Intl.pluralLogic(
|
||||
count,
|
||||
locale: localeName,
|
||||
other: 'mensagens de canal',
|
||||
one: 'mensagem de canal',
|
||||
);
|
||||
return '$count $_temp0';
|
||||
}
|
||||
|
||||
@override
|
||||
String notification_newNodesCount(int count) {
|
||||
String _temp0 = intl.Intl.pluralLogic(
|
||||
count,
|
||||
locale: localeName,
|
||||
other: 'novos nós',
|
||||
one: 'novo nó',
|
||||
);
|
||||
return '$count $_temp0';
|
||||
}
|
||||
|
||||
@override
|
||||
String notification_newTypeDiscovered(String contactType) {
|
||||
return 'Novo $contactType descoberto';
|
||||
}
|
||||
|
||||
@override
|
||||
String get notification_receivedNewMessage => 'Nova mensagem recebida';
|
||||
|
||||
@override
|
||||
String get settings_gpxExportRepeaters =>
|
||||
'Exportar repetidores / servidor de sala para GPX';
|
||||
|
||||
Reference in New Issue
Block a user