~singpolyma/cheogram

00ac243de52af47c48b90422c8cf2bbc718fede0 — Stephen Paul Weber 2 years ago 3249055
Allow x@x.tld forms in whispers
1 files changed, 2 insertions(+), 1 deletions(-)

M Util.hs
M Util.hs => Util.hs +2 -1
@@ 81,8 81,9 @@ unescapeJid txt = fromString result
			("20", ' '), ("22", '"'), ("26", '&'), ("27", '\''), ("2f", '/'), ("3a", ':'), ("3c", '<'), ("3e", '>'), ("40", '@'), ("5c", '\\')
		]

-- Matches any URL-ish text, but not x@x.tld forms
autolinkRegex :: PCRE.Regex
autolinkRegex = PCRE.compile (encodeUtf8 $ s"((http|https)://)?([a-z0-9-]+\\.)?[a-z0-9-]+(\\.[a-z]{2,6}){1,3}(/[a-z0-9.,_/~#&=;%+?-]*)?") [PCRE.caseless, PCRE.dotall]
autolinkRegex = PCRE.compile (encodeUtf8 $ s"(?<!@)(?<=\\b)(?:((http|https)://)?([a-z0-9-]+\\.)?[a-z0-9-]+(\\.[a-z]{2,6}){1,3}(/[a-z0-9.,_/~#&=;%+?-]*)?)") [PCRE.caseless, PCRE.dotall]

sanitizeSipLocalpart :: Text -> Maybe Text
sanitizeSipLocalpart localpart