Skip to content

Commit d60894e

Browse files
committed
* 'master' of https://github.com/kiwiirc/irc-framework: Fix nick collisions where uuid's are sent from the server Force \r\n for all network rights, as per RFC Fix documentation links Add documentation links
2 parents dc5a4df + 513085b commit d60894e

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# irc-framework
2-
A better IRC framework for node.js. For bots and full clients
2+
A better IRC framework for node.js. For bots and full clients. Read the [documentation](https://github.com/kiwiirc/irc-framework/blob/master/docs/clientapi.md).
33

44
### Aims
55
* Lightweight

docs/clientapi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### irc-framework Client instance API
22

3-
Inherits EventEmitter (https://nodejs.org/api/events.html)
3+
Inherits [EventEmitter](https://nodejs.org/api/events.html). Read more on the Events available [here](https://github.com/kiwiirc/irc-framework/blob/master/docs/events.md).
44

55
#### Constructor
66
~~~javascript

src/client.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ module.exports = class IrcClient extends EventEmitter {
225225

226226
commands.on('nick', function(event) {
227227
if (client.user.nick === event.nick) {
228+
// nicks starting with numbers are reserved for uuids
229+
// we dont want to store these as they cannot be used
230+
if (event.new_nick.match(/^\d/)) {
231+
return;
232+
}
228233
client.user.nick = event.new_nick;
229234
}
230235
});

src/transports/net.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ module.exports = class Connection extends EventEmitter {
3737
writeLine(line, cb) {
3838
if (this.socket && this.isConnected()) {
3939
if (this.encoding !== 'utf8') {
40-
this.socket.write(iconv.encode(line + '\n', this.encoding), cb);
40+
this.socket.write(iconv.encode(line + '\r\n', this.encoding), cb);
4141
} else {
42-
this.socket.write(line + '\n', cb);
42+
this.socket.write(line + '\r\n', cb);
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)