kiwiirc / irc-framework

🛠️ A better IRC framework for node.js. For bots and full clients.
MIT License
181 stars 64 forks source link

Dont crash when server (ex irslackd) doesn't actually send modes #222

Closed halkeye closed 4 years ago

halkeye commented 4 years ago

When I tried to join a irslackd (https://github.com/adsr/irslackd) server, thelounge crashed

I've added debugging to the server, looks like its not sending any flags after mode

irc_out: joinChannel #production
irc_out :gavin JOIN #production
irc_out :irslackd 353 gavin = #production :gavin gavin
irc_out :irslackd MODE #production
irc_in MODE #production

I think mode should be populated but empty with based on https://tools.ietf.org/html/rfc1459#section-4.2.3.1 but I figure not crashing is a good plan

xPaw commented 4 years ago

Perhaps the mode event shouldn't be emitted? Because raw_mode will be undefined instead of being an empty string.

halkeye commented 4 years ago

do you mean irc-framework shouldn't emit a mode event? or that the server is broken for even sending it?

xPaw commented 4 years ago

I meant irc-fw (probably channel info event too?)

I think the server isn't up to the spec by sending an empty mode though.

halkeye commented 4 years ago

oh! i totally see why your concerned - https://github.com/thelounge/thelounge/compare/30595ed23f56%5E...813b49d7b14c

the join would break then.

xPaw commented 4 years ago

It won't break in lounge, it will just print undefined there instead of an empty string. raw_params will be an empty array as expected.