style = formatToIrcMsg(_kiwi.app.text_theme[string_id]);
- // Bring member info back to first level of params
+ // Expand a member mask into its individual parts (nick, ident, hostname)
if (params['%M']) {
- _.each(params['%M'], function(val, key) {
- params[key] = val;
- });
+ params['%N'] = params['%M'].nick;
+ params['%J'] = params['%M'].ident;
+ params['%H'] = params['%M'].hostname;
}
// Do the magic. Use the shorthand syntax to produce output.
return;\r
}\r
\r
- this.addMsg(' ', styleText('channel_join', {'%M': member.getMemberMask(), '%T': translateText('client_models_channel_join'), '%C': name}), 'action join', {time: options.kiwi.time});\r
+ this.addMsg(' ', styleText('channel_join', {'%M': member.getMaskParts(), '%T': translateText('client_models_channel_join'), '%C': name}), 'action join', {time: options.kiwi.time});\r
}, this);\r
\r
members.bind("remove", function (member, members, options) {\r
var msg = (options.kiwi.message) ? '(' + options.kiwi.message + ')' : '';\r
\r
if (options.kiwi.type === 'quit' && show_message) {\r
- this.addMsg(' ', styleText('channel_quit', {'%M': member.getMemberMask(), '%T': translateText('client_models_channel_quit', [msg]), '%C': name}), 'action quit', {time: options.kiwi.time});\r
+ this.addMsg(' ', styleText('channel_quit', {'%M': member.getMaskParts(), '%T': translateText('client_models_channel_quit', [msg]), '%C': name}), 'action quit', {time: options.kiwi.time});\r
\r
} else if (options.kiwi.type === 'kick') {\r
\r
if (!options.kiwi.current_user_kicked) {\r
//If user kicked someone, show the message regardless of settings.\r
if (show_message || options.kiwi.current_user_initiated) {\r
- this.addMsg(' ', styleText('channel_kicked', {'%M': member.getMemberMask(), '%T': translateText('client_models_channel_kicked', [options.kiwi.by, msg]), '%C': name}), 'action kick', {time: options.kiwi.time});\r
+ this.addMsg(' ', styleText('channel_kicked', {'%M': member.getMaskParts(), '%T': translateText('client_models_channel_kicked', [options.kiwi.by, msg]), '%C': name}), 'action kick', {time: options.kiwi.time});\r
}\r
} else {\r
this.addMsg(' ', styleText('channel_selfkick', {'%T': translateText('client_models_channel_selfkick', [options.kiwi.by, msg]), '%C': name}), 'action kick', {time: options.kiwi.time});\r
}\r
} else if (show_message) {\r
- this.addMsg(' ', styleText('channel_part', {'%M': member.getMemberMask(), '%T': translateText('client_models_channel_part', [msg]), '%C': name}), 'action part', {time: options.kiwi.time});\r
+ this.addMsg(' ', styleText('channel_part', {'%M': member.getMaskParts(), '%T': translateText('client_models_channel_part', [msg]), '%C': name}), 'action part', {time: options.kiwi.time});\r
\r
}\r
}, this);\r
\r
return display;\r
},\r
- getMemberMask: function () {\r
- // Why to use %N and %H is quite clear here. %J is because %I is already for italic and %U for underlines. Better ideas ?\r
- return {'%N': this.get('nick'), '%J': this.get("ident"), '%H': this.get("hostname")};\r
+ getMaskParts: function () {\r
+ return {\r
+ nick: this.get('nick') || '',\r
+ ident: this.get('ident') || '',\r
+ hostname: this.get('hostname') || ''\r
+ };\r
},\r
/**\r
* With the modes set on the user, make note if we have some sort of op status\r