feat(chat): disallow links in messages

Local-first chat between people whose web of trust is still forming is a
natural phishing/scam vector, so messages may not contain URLs. A
conservative `containsUrl` rule (explicit scheme, www., or a common-TLD
domain — but not "3.5kg" or "12.30") gates it: the composer warns and
keeps the text for editing, and MessagesCubit.send drops any URL as a
backstop. Incoming text was already non-tappable (plain selectable text).
This commit is contained in:
vjrj 2026-07-11 07:14:58 +02:00
parent d481e62ff7
commit a461106dbf
14 changed files with 107 additions and 34 deletions

View file

@ -1443,6 +1443,9 @@ class Translations$chat$en {
/// en: 'Couldn't send check your connection'
String get sendError => 'Couldn\'t send — check your connection';
/// en: 'Links aren't allowed in messages'
String get noLinks => 'Links aren\'t allowed in messages';
}
// Path: trust
@ -2544,6 +2547,7 @@ extension on Translations {
'chat.today' => 'Today',
'chat.yesterday' => 'Yesterday',
'chat.sendError' => 'Couldn\'t send — check your connection',
'chat.noLinks' => 'Links aren\'t allowed in messages',
'trust.none' => 'No one vouches for them yet',
'trust.count' => ({required Object n}) => 'Vouched for by ${n}',
'trust.vouch' => 'I know this person',