fix mentions in the same message

This commit is contained in:
Salvatore Giordano
2021-01-19 11:01:59 +01:00
parent 25e3e49210
commit 55e2e75a0f
@@ -66,9 +66,9 @@ class MessageText extends StatelessWidget {
} }
String _replaceMentions(String text) { String _replaceMentions(String text) {
message.mentionedUsers?.forEach((u) { message.mentionedUsers?.map((u) => u.name)?.toSet()?.forEach((userName) {
text = text.replaceAll( text = text.replaceAll(
'@${u.name}', '[@${u.name}](@${u.name.replaceAll(' ', '')})'); '@${userName}', '[@${userName}](@${userName.replaceAll(' ', '')})');
}); });
return text; return text;
} }