Minor messenger username fix.

This commit is contained in:
Ylian Saint-Hilaire 2021-01-27 15:35:58 -08:00
parent 7bbba5215a
commit ddcddb7105

View File

@ -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); }
}
}
}