mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
f5a2d5bf88
A fediverse handle such as `@name@server.tld` contains a substring that `Linkify.EMAIL_ADDRESSES` recognises as a valid address, so the timeline renders `name@server.tld` as a tappable `mailto:` link. Tapping it opens a mail composer addressed to an account that does not accept mail. Drop a newly added `mailto:` span when the character immediately before it is `@`. This mirrors what Android already does for web URLs, where `Linkify.sUrlMatchFilter` rejects a match preceded by `@` — which is why the handle currently produces exactly one stray mailto span and no partial link is left behind once it is removed. Author-supplied links are unaffected: spans that were already present before linkification are excluded from the check and restored as before. A genuine address written directly after an `@` — "mail me @support@element.io" — is no longer linkified, which is the same trade-off Android already makes for web URLs.