mirror of
https://github.com/thelounge/thelounge
synced 2024-11-30 07:50:34 +00:00
Remove unused notice event
This commit is contained in:
parent
dff6eb33c5
commit
7baf5f0f81
1 changed files with 0 additions and 33 deletions
|
@ -1,33 +0,0 @@
|
|||
var _ = require("lodash");
|
||||
var Msg = require("../../models/msg");
|
||||
|
||||
module.exports = function(irc, network) {
|
||||
var client = this;
|
||||
irc.on("notice", function(data) {
|
||||
var target = data.to;
|
||||
if (target.toLowerCase() === irc.me.toLowerCase()) {
|
||||
target = data.from;
|
||||
}
|
||||
|
||||
var chan = _.find(network.channels, {name: target});
|
||||
if (typeof chan === "undefined") {
|
||||
chan = network.channels[0];
|
||||
}
|
||||
|
||||
var from = data.from || "";
|
||||
if (data.to === "*" || data.from.indexOf(".") !== -1) {
|
||||
from = "";
|
||||
}
|
||||
var msg = new Msg({
|
||||
type: Msg.Type.NOTICE,
|
||||
mode: chan.getMode(from),
|
||||
from: from,
|
||||
text: data.message
|
||||
});
|
||||
chan.messages.push(msg);
|
||||
client.emit("msg", {
|
||||
chan: chan.id,
|
||||
msg: msg
|
||||
});
|
||||
});
|
||||
};
|
Loading…
Reference in a new issue