]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Add status display in channel text.
authorChris Porter <redacted>
Thu, 4 Dec 2008 23:57:57 +0000 (23:57 +0000)
committerChris Porter <redacted>
Thu, 4 Dec 2008 23:57:57 +0000 (23:57 +0000)
TODO.txt
js/irc/commandparser.js
js/irc/ircclient.js
js/ui/optionspane.js
js/ui/theme.js

index 4a0b8cace81b9cdac0e022cd91489f194207c0d4..59ab58905a0689869f6a501113b49b5d66f1d737 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -21,8 +21,6 @@ Options pane:
   same with embedded wizard\r
   Various options:\r
     - notices going to active window\r
-    - query behaviour\r
-    - @+ in nick shown in chantext\r
   Sound\r
   Last position line\r
   Store options server side when logged in.\r
index f445bf351970dfd8d77863c5ffddf4f93fd7ec25..57a57ec747b4a69e7ee502f69612dcdc8e87bef3 100644 (file)
@@ -164,7 +164,7 @@ qwebirc.irc.CommandParser = new Class({
     if(!this.parentObject.isChannel(target))
       this.parentObject.pushLastNick(target);
     if(this.send("PRIVMSG " + target + " :" + message))
-      this.newQueryLine(target, "MSG", message, {});  
+      this.newQueryLine(target, "MSG", message, {"@": this.parentObject.getNickStatus(target, this.parentObject.nickname)});  
   }],
   cmd_NOTICE: [false, 2, 2, function(args) {
     var target = args[0];
index 3739f2c454dde3213c2dcbf4af1121c2ae0cc05b..7aebca27fb81653e5c91043e03f530b1b30d7b9e 100644 (file)
@@ -325,9 +325,21 @@ qwebirc.irc.IRCClient = new Class({
     
     this.newTargetOrActiveLine(nick, "CTCPREPLY", {"m": args, "x": type, "h": host, "n": nick, "-": this.nickname});
   },
+  getNickStatus: function(channel, nick) {
+    var n = this.tracker.getNickOnChannel(nick, channel);
+    if(!$defined(n))
+      return "";
+      
+    if(n.prefixes.length == 0)
+      return "";
+      
+    return n.prefixes.charAt(0);
+  },
   channelPrivmsg: function(user, channel, message) {
-    this.tracker.updateLastSpoke(user.hostToNick(), channel, new Date().getTime()); 
-    this.newChanLine(channel, "CHANMSG", user, {"m": message});
+    var nick = user.hostToNick();
+    
+    this.tracker.updateLastSpoke(nick, channel, new Date().getTime()); 
+    this.newChanLine(channel, "CHANMSG", user, {"m": message, "@": this.getNickStatus(channel, nick)});
   },
   channelNotice: function(user, channel, message) {
     this.newChanLine(channel, "CHANNOTICE", user, {"m": message});
index bada8e1cf6060e201c2a9ad0fddd6e19afe0f201..8d963ee06ac6a35c743e03f4e23c212cc52981e5 100644 (file)
@@ -16,7 +16,7 @@ qwebirc.config.DEFAULT_OPTIONS = [
     }
   }],
   [2, "DEDICATED_MSG_WINDOW", "Use dedicated messages window", false],
-  [3, "TEXT_STATUS", "Show status (@/+) before nicknames", true]
+  [3, "NICK_OV_STATUS", "Show status (@/+) before nicknames", true]
 ];
 
 qwebirc.config.DefaultOptions = null;
index 98af54ac55e83e4a291bfe6eaaa4487dfb04e3c4..d04523235d0ea7a2fecd84bef236fff7bbb9b34c 100644 (file)
@@ -28,11 +28,11 @@ qwebirc.ui.themes.Default = {
   "INVITE": ["$N invites you to join $c", true],
   "HILIGHT": ["$C4"],
   "HILIGHTEND": ["$O"],
-  "CHANMSG": ["<$($N$)> $m"],
+  "CHANMSG": ["<$@$($N$)> $m"],
   "PRIVMSG": ["<$($N$)> $m"],
   "CHANNOTICE": ["-$($N$):$c- $m"],
   "PRIVNOTICE": ["-$($N$)- $m"],
-  "OURCHANMSG": ["<$N> $m"],
+  "OURCHANMSG": ["<$@$N> $m"],
   "OURPRIVMSG": ["<$N> $m"],
   "OURTARGETEDMSG": ["*$[$t$]* $m"],
   "OURTARGETEDNOTICE": ["[notice($[$t$])] $m"],