UNPKG

coffea

Version:

event based and extensible nodejs irc client library with multi-network support

21 lines (18 loc) 674 B
/*jslint node: true*/ "use strict"; var utils = require('../utils'); module.exports = function () { return function (irc) { irc.on('data', function (err, msg) { var network = msg.network; if (msg.command === 'ACCOUNT') { irc.getUser(utils.nick(msg), network).accountname = msg.params === "*" ? null : msg.params; utils.emit(irc, network, 'account-login', { "user": irc.getUser(utils.nick(msg), network), "account": msg.params === "*" ? null : msg.params, "tags": msg.tags ? msg.tags : [] }); } }); }; };