Port /reply to the client (#773)

This commit is contained in:
Bär Halberkamp
2016-10-03 22:28:20 +02:00
committed by Guangcong Luo
parent f58656cb1b
commit bce03c4f6e
2 changed files with 9 additions and 0 deletions

View File

@@ -148,6 +148,12 @@
e.preventDefault();
e.stopPropagation();
}
} else if (app.user.lastPM && (textbox.value === '/reply' || textbox.value === '/r') && e.keyCode === 32) { // '/reply ' is being written
e.preventDefault();
e.stopPropagation();
var val = '/pm ' + app.user.lastPM + ', ';
textbox.value = val;
e.setSelectionRange(val.length, val.length);
}
},
clickUsername: function (e) {

View File

@@ -957,6 +957,9 @@
parts = dataLines[i].slice(1).split('|');
var message = parts.slice(3).join('|');
this.rooms[''].addPM(parts[1], message, parts[2]);
if (toUserid(parts[1]) !== app.user.get('userid')) {
app.user.lastPM = toUserid(parts[1]);
}
}
break;