summaryrefslogtreecommitdiffstats
path: root/comm/chat/protocols/facebook
diff options
context:
space:
mode:
Diffstat (limited to 'comm/chat/protocols/facebook')
-rw-r--r--comm/chat/protocols/facebook/components.conf15
-rw-r--r--comm/chat/protocols/facebook/facebook.sys.mjs56
-rw-r--r--comm/chat/protocols/facebook/icons/prpl-facebook-32.pngbin0 -> 1193 bytes
-rw-r--r--comm/chat/protocols/facebook/icons/prpl-facebook-48.pngbin0 -> 1521 bytes
-rw-r--r--comm/chat/protocols/facebook/icons/prpl-facebook.pngbin0 -> 552 bytes
-rw-r--r--comm/chat/protocols/facebook/jar.mn9
-rw-r--r--comm/chat/protocols/facebook/moz.build14
7 files changed, 94 insertions, 0 deletions
diff --git a/comm/chat/protocols/facebook/components.conf b/comm/chat/protocols/facebook/components.conf
new file mode 100644
index 0000000000..b5a023f678
--- /dev/null
+++ b/comm/chat/protocols/facebook/components.conf
@@ -0,0 +1,15 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+Classes = [
+ {
+ 'cid': '{1d1d0bc5-610c-472f-b2cb-4b89857d80dc}',
+ 'contract_ids': ['@mozilla.org/chat/facebook;1'],
+ 'esModule': 'resource:///modules/facebook.sys.mjs',
+ 'constructor': 'FacebookProtocol',
+ 'categories': {'im-protocol-plugin': 'prpl-facebook'},
+ },
+]
diff --git a/comm/chat/protocols/facebook/facebook.sys.mjs b/comm/chat/protocols/facebook/facebook.sys.mjs
new file mode 100644
index 0000000000..048e81b4a9
--- /dev/null
+++ b/comm/chat/protocols/facebook/facebook.sys.mjs
@@ -0,0 +1,56 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
+import { l10nHelper } from "resource:///modules/imXPCOMUtils.sys.mjs";
+import {
+ GenericAccountPrototype,
+ GenericProtocolPrototype,
+} from "resource:///modules/jsProtoHelper.sys.mjs";
+
+const lazy = {};
+
+XPCOMUtils.defineLazyGetter(lazy, "_", () =>
+ l10nHelper("chrome://chat/locale/facebook.properties")
+);
+
+function FacebookAccount(aProtoInstance, aImAccount) {
+ this._init(aProtoInstance, aImAccount);
+}
+FacebookAccount.prototype = {
+ __proto__: GenericAccountPrototype,
+
+ connect() {
+ this.WARN(
+ "As Facebook deprecated its XMPP gateway, it is currently not " +
+ "possible to connect to Facebook Chat. See bug 1141674."
+ );
+ this.reportDisconnecting(
+ Ci.prplIAccount.ERROR_OTHER_ERROR,
+ lazy._("facebook.disabled")
+ );
+ this.reportDisconnected();
+ },
+
+ // Nothing to do.
+ unInit() {},
+ remove() {},
+};
+
+export function FacebookProtocol() {}
+FacebookProtocol.prototype = {
+ __proto__: GenericProtocolPrototype,
+ get normalizedName() {
+ return "facebook";
+ },
+ get name() {
+ return lazy._("facebook.chat.name");
+ },
+ get iconBaseURI() {
+ return "chrome://prpl-facebook/skin/";
+ },
+ getAccount(aImAccount) {
+ return new FacebookAccount(this, aImAccount);
+ },
+};
diff --git a/comm/chat/protocols/facebook/icons/prpl-facebook-32.png b/comm/chat/protocols/facebook/icons/prpl-facebook-32.png
new file mode 100644
index 0000000000..77e6d358b6
--- /dev/null
+++ b/comm/chat/protocols/facebook/icons/prpl-facebook-32.png
Binary files differ
diff --git a/comm/chat/protocols/facebook/icons/prpl-facebook-48.png b/comm/chat/protocols/facebook/icons/prpl-facebook-48.png
new file mode 100644
index 0000000000..2501acaab5
--- /dev/null
+++ b/comm/chat/protocols/facebook/icons/prpl-facebook-48.png
Binary files differ
diff --git a/comm/chat/protocols/facebook/icons/prpl-facebook.png b/comm/chat/protocols/facebook/icons/prpl-facebook.png
new file mode 100644
index 0000000000..bc42cf9b0b
--- /dev/null
+++ b/comm/chat/protocols/facebook/icons/prpl-facebook.png
Binary files differ
diff --git a/comm/chat/protocols/facebook/jar.mn b/comm/chat/protocols/facebook/jar.mn
new file mode 100644
index 0000000000..24c5e8fef6
--- /dev/null
+++ b/comm/chat/protocols/facebook/jar.mn
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+chat.jar:
+% skin prpl-facebook classic/1.0 %skin/classic/prpl/facebook/
+ skin/classic/prpl/facebook/icon32.png (icons/prpl-facebook-32.png)
+ skin/classic/prpl/facebook/icon48.png (icons/prpl-facebook-48.png)
+ skin/classic/prpl/facebook/icon.png (icons/prpl-facebook.png)
diff --git a/comm/chat/protocols/facebook/moz.build b/comm/chat/protocols/facebook/moz.build
new file mode 100644
index 0000000000..d07bb3a8f9
--- /dev/null
+++ b/comm/chat/protocols/facebook/moz.build
@@ -0,0 +1,14 @@
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+JAR_MANIFESTS += ["jar.mn"]
+
+EXTRA_JS_MODULES += [
+ "facebook.sys.mjs",
+]
+
+XPCOM_MANIFESTS += [
+ "components.conf",
+]