* Fix Via parsing

* Use LIKE for real name lookup
This commit is contained in:
Bryan Ashby 2018-01-01 18:43:05 -07:00
parent 84a1f70fc2
commit b97f96ce18
2 changed files with 8 additions and 6 deletions

View File

@ -397,10 +397,10 @@ function Packet(options) {
// We have to special case INTL/TOPT/FMPT as they don't contain
// a ':' name/value separator like the rest of the kludge lines... because stupdity.
//
let key = line.substr(0, 4);
let key = line.substr(0, 4).trim();
let value;
if( ['INTL', 'TOPT', 'FMPT' ].includes(key)) {
value = line.substr(4).trim();
if( ['INTL', 'TOPT', 'FMPT', 'Via' ].includes(key)) {
value = line.substr(key.length).trim();
} else {
const sepIndex = line.indexOf(':');
key = line.substr(0, sepIndex).toUpperCase();
@ -709,6 +709,7 @@ function Packet(options) {
case 'PATH' :
break; // skip & save for last
case 'Via' :
case 'FMPT' :
case 'TOPT' :
case 'INTL' :
@ -856,6 +857,7 @@ function Packet(options) {
switch(k) {
case 'PATH' : break; // skip & save for last
case 'Via' :
case 'FMPT' :
case 'TOPT' :
case 'INTL' : appendMeta(`\x01${k}`, message.meta.FtnKludge[k], ''); break; // no sepChar

View File

@ -427,7 +427,7 @@ module.exports = class User {
WHERE id = (
SELECT user_id
FROM user_property
WHERE prop_name='real_name' AND prop_value=?
WHERE prop_name='real_name' AND prop_value LIKE ?
);`,
[ realName ],
(err, row) => {