Address review: trace request size and contact-share translation
- Manual path trace validates the request that will actually be sent (round trips become 2n-1 hops, 3-byte hops go out as 4-byte prefixes) against the 172-byte frame and 64-hop firmware limits, and disables Run with an explanation when it does not fit. PathTraceMapScreen also refuses to send an oversized request. - Contact-share tokens are never passed through message translation, so the share cannot be mangled before sending.
This commit is contained in:
1 parent
c939f7a29c
commit
80ead2fc2d
45 files changed
+210
-2
No files matched your search
@@ -7,6 +7,7 @@ import 'package:flutter_langdetect/flutter_langdetect.dart';
|
||||
|
||||
import '../models/app_settings.dart';
|
||||
import '../models/translation_support.dart';
|
||||
import '../helpers/contact_share_message.dart';
|
||||
import '../helpers/gif_helper.dart';
|
||||
import '../utils/app_logger.dart';
|
||||
import 'app_settings_service.dart';
|
||||
@@ -573,6 +574,10 @@ class TranslationService extends ChangeNotifier {
|
||||
if (GifHelper.parseGif(trimmed) != null) {
|
||||
return false;
|
||||
}
|
||||
// A shared contact card is data: translating it would mangle the token.
|
||||
if (parseContactShare(trimmed) != null) {
|
||||
return false;
|
||||
}
|
||||
return !(trimmed.startsWith('m:') ||
|
||||
trimmed.startsWith('V1|') ||
|
||||
trimmed.startsWith('r:'));
|
||||
|
||||
Reference in new issue
Block a user