Skip to content

Instantly share code, notes, and snippets.

/client.js Secret

Created December 9, 2012 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/26c550828ef2dad956db to your computer and use it in GitHub Desktop.
Save anonymous/26c550828ef2dad956db to your computer and use it in GitHub Desktop.
c9-server-client-com
ide.connection.send({
command: "irc",
message: JSON.stringify({
command: command,
data: data
})
});
"use strict";
var util = require("util");
var Plugin = require("../cloud9.core/plugin");
var name = "irc";
module.exports = function setup(options, imports, register) {
imports.ide.register(name, GitPlugin, register);
};
var GitPlugin = function(ide, workspace) {
Plugin.call(this, ide, workspace);
this.workspaceId = workspace.workspaceId;
this.channel = this.workspaceId + "::irc";
this.hooks = ["command"];
this.name = "irc";
};
util.inherits(GitPlugin, Plugin);
(function() {
this.init = function() {
var self = this;
};
this.command = function(user, message, $client) {
var cmd = message.command ? message.command.toLowerCase() : "";
if (cmd !== "irc") return false;
if (typeof message.protocol == "undefined") message.protocol = "client";
client.send({
command: "irc",
action:"join",
data:channels
});
}
this.canShutdown = function() {
return true;
};
}).call(GitPlugin.prototype);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment