Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add !quit command to admin rooms #253

Merged
merged 3 commits into from
Oct 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/bridge/MatrixHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ MatrixHandler.prototype._onAdminMessage = Promise.coroutine(function*(req, event
yield this.ircBridge.sendMatrixAction(adminRoom, botUser, notice, req);
return;
}
else if (cmd === "!quit") {
clientList.filter(
(bridgedClient) => bridgedClient.server.domain === ircServer.domain
).forEach((bridgedClient) => {
bridgedClient.kill();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No success/failure message sent back?

Copy link
Contributor Author

@lukebarnard1 lukebarnard1 Oct 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They will see metadata about their connection being lost. I could add even more feedback but it would feel redundant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay.

}
else if (cmd === "!cmd" && args[0]) {
req.log.info(`No valid (old form) admin command, will try new format`);

Expand Down
6 changes: 5 additions & 1 deletion lib/irc/BridgedClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ BridgedClient.prototype.connect = Promise.coroutine(function*() {
"Connecting to IRC server %s as %s (user=%s)",
server.domain, this.nick, nameInfo.username
);
this._eventBroker.sendMetadata(this,
`Connecting to the IRC network '${this.server.domain}' as ${this.nick}...`
);

let connInst = yield ConnectionInstance.create(server, {
nick: this.nick,
username: nameInfo.username,
Expand Down Expand Up @@ -571,7 +575,7 @@ BridgedClient.prototype._onConnectionCreated = function(connInst, nameInfo) {
self.emit("client-disconnected", self);
self._eventBroker.sendMetadata(self,
"Your connection to the IRC network '" + self.server.domain +
"' has been lost. Reconnecting."
"' has been lost. "
);
};

Expand Down