Fix username regex

This commit is contained in:
Robert Long
2022-01-18 13:52:16 -08:00
parent c71f37a8f8
commit 98355edf92

View File

@@ -49,9 +49,11 @@ function shouldCollapse({ name, src, type, namespace }) {
} }
function getUserName(userId) { function getUserName(userId) {
const match = userId.match("@(.+):"); const match = userId.match(/@([^\:]+):/);
return match && match.length > 0 ? match[1].replace("-", " ") : userId; return match && match.length > 0
? match[1].replace("-", " ").replace("W", "")
: userId.replace("W", "");
} }
function formatContent(type, content) { function formatContent(type, content) {