Skip to content

Commit 6654949

Browse files
committed
Default quit/part/kick default message as empty string
1 parent 1698e7c commit 6654949

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/commands/handlers/channel.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,19 +161,13 @@ var handlers = {
161161

162162
PART: function(command) {
163163
var time = command.getServerTime();
164-
var channel = command.params[0];
165-
var message;
166-
167-
if (command.params.length > 1) {
168-
message = command.params[command.params.length - 1];
169-
}
170164

171165
this.emit('part', {
172166
nick: command.nick,
173167
ident: command.ident,
174168
hostname: command.hostname,
175-
channel: channel,
176-
message: message,
169+
channel: command.params[0],
170+
message: command.params[command.params.length - 1] || '',
177171
time: time
178172
});
179173
},
@@ -188,7 +182,7 @@ var handlers = {
188182
ident: command.ident,
189183
hostname: command.hostname,
190184
channel: command.params[0],
191-
message: command.params[command.params.length - 1],
185+
message: command.params[command.params.length - 1] || '',
192186
time: time
193187
});
194188
},
@@ -201,7 +195,7 @@ var handlers = {
201195
nick: command.nick,
202196
ident: command.ident,
203197
hostname: command.hostname,
204-
message: command.params[command.params.length - 1],
198+
message: command.params[command.params.length - 1] || '',
205199
time: time
206200
});
207201
},

0 commit comments

Comments
 (0)