diff --git a/client/index.html b/client/index.html index 09baadb5..af1fdeb1 100644 --- a/client/index.html +++ b/client/index.html @@ -785,6 +785,19 @@ +
/rejoin
+ + Leave and immediately rejoin the current channel. Useful to + quickly get op from ChanServ in an empty channel, for example. +
+Alias: /cycle
/query nick
diff --git a/client/js/constants.js b/client/js/constants.js
index f34c24a3..ec3745c4 100644
--- a/client/js/constants.js
+++ b/client/js/constants.js
@@ -28,6 +28,7 @@ const commands = [
"/collapse",
"/connect",
"/ctcp",
+ "/cycle",
"/deop",
"/devoice",
"/disconnect",
@@ -46,6 +47,7 @@ const commands = [
"/query",
"/quit",
"/raw",
+ "/rejoin",
"/say",
"/send",
"/server",
diff --git a/src/client.js b/src/client.js
index a7bb59cf..da9f4aac 100644
--- a/src/client.js
+++ b/src/client.js
@@ -41,6 +41,7 @@ var inputs = [
"ctcp",
"msg",
"part",
+ "rejoin",
"action",
"away",
"connect",
diff --git a/src/plugins/inputs/rejoin.js b/src/plugins/inputs/rejoin.js
new file mode 100644
index 00000000..a723caff
--- /dev/null
+++ b/src/plugins/inputs/rejoin.js
@@ -0,0 +1,21 @@
+"use strict";
+
+var Msg = require("../../models/msg");
+var Chan = require("../../models/chan");
+
+exports.commands = ["cycle", "rejoin"];
+
+exports.input = function(network, chan) {
+ if (chan.type !== Chan.Type.CHANNEL) {
+ chan.pushMessage(this, new Msg({
+ type: Msg.Type.ERROR,
+ text: "You can only rejoin channels."
+ }));
+ return;
+ }
+
+ network.irc.part(chan.name, "Rejoining");
+ network.irc.join(chan.name);
+
+ return true;
+};