modes = _.reject(modes, function (m) {\r
return (modes_to_remove.indexOf(m) !== -1);\r
});\r
- \r
+\r
this.set({"prefix": this.getPrefix(modes), "modes": modes});\r
},\r
getPrefix: function (modes) {\r
}\r
\r
return tmp.substr(i);\r
+ },\r
+ displayNick: function (full) {\r
+ var display = this.get('nick');\r
+\r
+ if (full) {\r
+ if (this.get("ident")) {\r
+ display += ' [' + this.get("ident") + '@' + this.get("hostname") + ']';\r
+ }\r
+ }\r
+\r
+ return display;\r
}\r
});\r
\r
"topic": ""\r
}, {"silent": true});\r
\r
- //this.addMsg(' ', '--> You have joined ' + name, 'action join', {style: 'color:#009900;'});\r
-\r
members = this.get("members");\r
members.bind("add", function (member) {\r
- var disp = member.get("nick") + ' [' + member.get("ident") + '@' + member.get("hostname") + ']';\r
- this.addMsg(' ', '--> ' + disp + ' has joined', 'action join');\r
+ this.addMsg(' ', '--> ' + member.displayNick(true) + ' has joined', 'action join');\r
}, this);\r
\r
members.bind("remove", function (member, options) {\r
- var disp = member.get("nick") + ' [' + member.get("ident") + '@' + member.get("hostname") + ']';\r
- this.addMsg(' ', '<-- ' + disp + ' has left ' + ((options.message) ? '(' + options.message + ')' : ''), 'action part');\r
+ this.addMsg(' ', '<-- ' + member.displayNick(true) + ' has left ' + ((options.message) ? '(' + options.message + ')' : ''), 'action part');\r
}, this);\r
\r
members.bind("quit", function (args) {\r
- var disp = member.get("nick") + ' [' + member.get("ident") + '@' + member.get("hostname") + ']';\r
- this.addMsg(' ', '<-- ' + disp + ' has quit ' + ((args.message) ? '(' + args.message + ')' : ''), 'action quit');\r
+ this.addMsg(' ', '<-- ' + member.displayNick(true) + ' has quit ' + ((args.message) ? '(' + args.message + ')' : ''), 'action quit');\r
}, this);\r
}\r
});\r