-
-
Save anonymous/26c550828ef2dad956db to your computer and use it in GitHub Desktop.
c9-server-client-com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ide.connection.send({ | |
command: "irc", | |
message: JSON.stringify({ | |
command: command, | |
data: data | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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