aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Kavlie <akavlie@gmail.com>2011-11-16 20:41:50 -0700
committerAaron Kavlie <akavlie@gmail.com>2011-11-16 20:41:50 -0700
commit15f9be42123929b732a1d52b2b5e83f7323ac69d (patch)
tree86df5e3aff00faf1d36a9b394511fe85df98befe
parent8b76b19dba433a365b59a684881c91377c98b342 (diff)
downloadreevo-webirc-15f9be42123929b732a1d52b2b5e83f7323ac69d.tar.gz
reevo-webirc-15f9be42123929b732a1d52b2b5e83f7323ac69d.zip
Fix private messages initiated by user.
-rw-r--r--public/app.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/public/app.js b/public/app.js
index 861cddd..701ef90 100644
--- a/public/app.js
+++ b/public/app.js
@@ -378,14 +378,13 @@ $(function() {
378 input = this.input.val(); 378 input = this.input.val();
379 379
380 if (input.indexOf('/') === 0) { 380 if (input.indexOf('/') === 0) {
381 console.log('IRC command detected -- sending to server'); 381 var parsed = this.parse(input.substr(1));
382 var parsed = this.parse(input.substr(1))
383 socket.emit('command', parsed); 382 socket.emit('command', parsed);
384 // special case -- no output emitted, yet we want a new frame 383 // special case -- no output emitted, yet we want a new frame
385 var msgParts = parsed.split(' '); 384 var msgParts = parsed.split(' ');
386 if (msgParts[0].toLowerCase() === 'privmsg') { 385 if (msgParts[0].toLowerCase() === 'privmsg') {
387 pm = frames.getByName(msgParts[1]) || new Frame({type: 'pm', name: msg.nick}); 386 pm = frames.getByName(msgParts[1]) || new Frame({type: 'pm', name: msgParts[1]});
388 pm.stream.add({sender: msg.nick, raw: msg.text}) 387 pm.stream.add({sender: irc.me.get('nick'), raw: msgParts[2]})
389 frames.add(pm); 388 frames.add(pm);
390 } 389 }
391 } else { 390 } else {