From: Vinicius Daly Felizardo Date: Fri, 14 Jun 2013 14:44:05 +0000 (-0400) Subject: Fixing code style X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b8c035b22b5eff05e981fbc662e9d6968c324521;p=KiwiIRC.git Fixing code style --- diff --git a/client/assets/src/models/channel.js b/client/assets/src/models/channel.js index cc9c99f..8a68d85 100644 --- a/client/assets/src/models/channel.js +++ b/client/assets/src/models/channel.js @@ -27,27 +27,19 @@ _kiwi.model.Channel = _kiwi.model.Panel.extend({ members.bind("remove", function (member, members, options) { var show_message = _kiwi.global.settings.get('show_joins_parts'); - - var msg = (options.message) ? '(' + options.message + ')' : ''; if (options.type === 'quit' && show_message) { - this.addMsg(' ', '== ' + member.displayNick(true) + ' has quit ' + msg, 'action quit'); - } else if(options.type === 'kick') { - - if (!options.kicked) { - - if (show_message || options.kicker) { - this.addMsg(' ', '== ' + member.displayNick(true) + ' was kicked by ' + options.by + ' ' + msg, 'action kick'); - + if (!options.current_user_kicked) { + //If user kicked someone, show the message regardless of settings. + if (show_message || options.current_user_initiated) { + this.addMsg(' ', '== ' + member.displayNick(true) + ' was kicked by ' + options.by + ' ' + msg, 'action kick'); + } + } else { + this.addMsg(' ', '== You have been kicked by ' + options.by + ' '+msg, 'action kick'); } - - } else { - this.addMsg(' ', '=== You have been kicked by ' + options.by + ' '+msg, 'action kick'); - } - } else if (show_message) { this.addMsg(' ', '== ' + member.displayNick(true) + ' has left ' + msg, 'action part'); } diff --git a/client/assets/src/models/network.js b/client/assets/src/models/network.js index a2330f8..89803dc 100644 --- a/client/assets/src/models/network.js +++ b/client/assets/src/models/network.js @@ -279,8 +279,8 @@ part_options.type = 'kick'; part_options.by = event.nick; part_options.message = event.message || ''; - part_options.kicked = (event.kicked == this.get('nick')) - part_options.kicker = (event.nick == this.get('nick')) + part_options.current_user_kicked = (event.kicked == this.get('nick')) + part_options.current_user_initiated = (event.nick == this.get('nick')) channel = this.panels.getByName(event.channel); if (!channel) return; @@ -294,7 +294,7 @@ members.remove(user, part_options); - if (part_options.kicked) { + if (part_options.current_user_kicked) { members.reset([]); } }