Add support for echo-message cap
This commit is contained in:
parent
116dbc07be
commit
84685acdcd
@ -174,6 +174,10 @@ Client.prototype.connect = function(args) {
|
||||
}
|
||||
|
||||
network.irc = new ircFramework.Client();
|
||||
network.irc.requestCap([
|
||||
"echo-message",
|
||||
"znc.in/self-message",
|
||||
]);
|
||||
network.irc.connect({
|
||||
host: network.host,
|
||||
port: network.port,
|
||||
|
@ -16,11 +16,15 @@ exports.input = function(network, chan, cmd, args) {
|
||||
text = text || args.join(" ");
|
||||
|
||||
irc.say(chan.name, "\u0001ACTION " + text + "\u0001");
|
||||
irc.emit("action", {
|
||||
nick: irc.user.nick,
|
||||
target: chan.name,
|
||||
message: text
|
||||
});
|
||||
|
||||
if (!network.irc.network.cap.isEnabled("echo-message")) {
|
||||
irc.emit("action", {
|
||||
nick: irc.user.nick,
|
||||
target: chan.name,
|
||||
message: text
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -19,13 +19,15 @@ exports.input = function(network, chan, cmd, args) {
|
||||
var msg = args.join(" ");
|
||||
irc.say(target, msg);
|
||||
|
||||
var channel = network.getChannel(target);
|
||||
if (typeof channel !== "undefined") {
|
||||
irc.emit("privmsg", {
|
||||
nick: irc.user.nick,
|
||||
target: channel.name,
|
||||
message: msg
|
||||
});
|
||||
if (!network.irc.network.cap.isEnabled("echo-message")) {
|
||||
var channel = network.getChannel(target);
|
||||
if (typeof channel !== "undefined") {
|
||||
irc.emit("privmsg", {
|
||||
nick: irc.user.nick,
|
||||
target: channel.name,
|
||||
message: msg
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -15,11 +15,13 @@ exports.input = function(network, chan, cmd, args) {
|
||||
targetChan = chan;
|
||||
}
|
||||
|
||||
irc.emit("notice", {
|
||||
nick: irc.user.nick,
|
||||
target: targetChan.name,
|
||||
message: message
|
||||
});
|
||||
if (!network.irc.network.cap.isEnabled("echo-message")) {
|
||||
irc.emit("notice", {
|
||||
nick: irc.user.nick,
|
||||
target: targetChan.name,
|
||||
message: message
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user