From ddcddb71055c7d7aa76350f4ffbb9ee0d4afea4e Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 27 Jan 2021 15:35:58 -0800 Subject: [PATCH] Minor messenger username fix. --- webserver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webserver.js b/webserver.js index 504c65ec..f2ee778e 100644 --- a/webserver.js +++ b/webserver.js @@ -2759,8 +2759,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if (idSplit.length == 7) { const user = obj.users[idSplit[4] + '/' + idSplit[5] + '/' + idSplit[6]]; if (user != null) { - if (domain.meshmessengertitle.indexOf('{0}') >= 0) { options.username = encodeURIComponent(user.realname ? user.realname : user._id.split('/')[2]).replace(/'/g, '%27'); } - if (domain.meshmessengertitle.indexOf('{1}') >= 0) { options.userid = encodeURIComponent(user._id.split('/')[2]).replace(/'/g, '%27'); } + if (domain.meshmessengertitle.indexOf('{0}') >= 0) { options.username = encodeURIComponent(user.realname ? user.realname : user.name).replace(/'/g, '%27'); } + if (domain.meshmessengertitle.indexOf('{1}') >= 0) { options.userid = encodeURIComponent(user.name); } } } }