# Pastebin tRsTkG42 # HG changeset patch # User Pavan # Parent e92c8681d759b014d1209412a39f6d7fa1e8f6b6 diff --git a/chat/protocols/matrix/matrix.js b/chat/protocols/matrix/matrix.js --- a/chat/protocols/matrix/matrix.js +++ b/chat/protocols/matrix/matrix.js @@ -235,16 +235,18 @@ MatrixAccount.prototype = { createConversation: function(aName) { throw Cr.NS_ERROR_NOT_IMPLEMENTED; }, get userId() { return this._client.credentials.userId; }, _client: null, _roomList: new Map(), } function MatrixProtocol() { + Cu.import("resource:///modules/matrixCommands.jsm", this); + this.registerCommands(); } MatrixProtocol.prototype = { __proto__: GenericProtocolPrototype, get normalizedName() { return "matrix"; }, get name() { return "Matrix"; }, get iconBaseURI() { return "chrome://prpl-matrix/skin/"; }, getAccount: function(aImAccount) { return new MatrixAccount(this, aImAccount); }, diff --git a/chat/protocols/matrix/matrixCommands.jsm b/chat/protocols/matrix/matrixCommands.jsm new file mode 100644 --- /dev/null +++ b/chat/protocols/matrix/matrixCommands.jsm @@ -0,0 +1,15 @@ + +this.EXPORTED_SYMBOLS = ["commands"]; + +var commands = [ + { + name: "command1", + run: function(aMsg, aConv) { + } + }, + { + name: "command2", + run: function(aMsg, aConv) { + } + } +]; diff --git a/chat/protocols/matrix/moz.build b/chat/protocols/matrix/moz.build --- a/chat/protocols/matrix/moz.build +++ b/chat/protocols/matrix/moz.build @@ -11,13 +11,14 @@ DIRS += [ EXTRA_COMPONENTS += [ 'matrix.js', 'matrix.manifest', ] EXTRA_JS_MODULES += [ 'matrix-sdk.jsm', + 'matrixCommands.jsm', ] JAR_MANIFESTS += [ 'jar.mn', ]