diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:44:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:44:51 +0000 |
commit | 9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/chat/protocols/twitter | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | comm/chat/protocols/twitter/components.conf | 15 | ||||
-rw-r--r-- | comm/chat/protocols/twitter/icons/prpl-twitter-32.png | bin | 0 -> 554 bytes | |||
-rw-r--r-- | comm/chat/protocols/twitter/icons/prpl-twitter-48.png | bin | 0 -> 721 bytes | |||
-rw-r--r-- | comm/chat/protocols/twitter/icons/prpl-twitter-left.png | bin | 0 -> 563 bytes | |||
-rw-r--r-- | comm/chat/protocols/twitter/icons/prpl-twitter.png | bin | 0 -> 319 bytes | |||
-rw-r--r-- | comm/chat/protocols/twitter/jar.mn | 10 | ||||
-rw-r--r-- | comm/chat/protocols/twitter/moz.build | 14 | ||||
-rw-r--r-- | comm/chat/protocols/twitter/twitter.sys.mjs | 62 |
8 files changed, 101 insertions, 0 deletions
diff --git a/comm/chat/protocols/twitter/components.conf b/comm/chat/protocols/twitter/components.conf new file mode 100644 index 0000000000..d39639f09d --- /dev/null +++ b/comm/chat/protocols/twitter/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': '{31082ff6-1de8-422b-ab60-ca0ac0b2af13}', + 'contract_ids': ['@mozilla.org/chat/twitter;1'], + 'esModule': 'resource:///modules/twitter.sys.mjs', + 'constructor': 'TwitterProtocol', + 'categories': {'im-protocol-plugin': 'prpl-twitter'}, + }, +] diff --git a/comm/chat/protocols/twitter/icons/prpl-twitter-32.png b/comm/chat/protocols/twitter/icons/prpl-twitter-32.png Binary files differnew file mode 100644 index 0000000000..61f6c703f1 --- /dev/null +++ b/comm/chat/protocols/twitter/icons/prpl-twitter-32.png diff --git a/comm/chat/protocols/twitter/icons/prpl-twitter-48.png b/comm/chat/protocols/twitter/icons/prpl-twitter-48.png Binary files differnew file mode 100644 index 0000000000..166ba27160 --- /dev/null +++ b/comm/chat/protocols/twitter/icons/prpl-twitter-48.png diff --git a/comm/chat/protocols/twitter/icons/prpl-twitter-left.png b/comm/chat/protocols/twitter/icons/prpl-twitter-left.png Binary files differnew file mode 100644 index 0000000000..fc1906da07 --- /dev/null +++ b/comm/chat/protocols/twitter/icons/prpl-twitter-left.png diff --git a/comm/chat/protocols/twitter/icons/prpl-twitter.png b/comm/chat/protocols/twitter/icons/prpl-twitter.png Binary files differnew file mode 100644 index 0000000000..3f36dabcaf --- /dev/null +++ b/comm/chat/protocols/twitter/icons/prpl-twitter.png diff --git a/comm/chat/protocols/twitter/jar.mn b/comm/chat/protocols/twitter/jar.mn new file mode 100644 index 0000000000..cb2ed81c0d --- /dev/null +++ b/comm/chat/protocols/twitter/jar.mn @@ -0,0 +1,10 @@ +# 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-twitter classic/1.0 %skin/classic/prpl/twitter/ + skin/classic/prpl/twitter/icon32.png (icons/prpl-twitter-32.png) + skin/classic/prpl/twitter/icon48.png (icons/prpl-twitter-48.png) + skin/classic/prpl/twitter/icon.png (icons/prpl-twitter.png) + skin/classic/prpl/twitter/icon-left.png (icons/prpl-twitter-left.png) diff --git a/comm/chat/protocols/twitter/moz.build b/comm/chat/protocols/twitter/moz.build new file mode 100644 index 0000000000..c3b11e5de6 --- /dev/null +++ b/comm/chat/protocols/twitter/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/. + +EXTRA_JS_MODULES += [ + "twitter.sys.mjs", +] + +JAR_MANIFESTS += ["jar.mn"] + +XPCOM_MANIFESTS += [ + "components.conf", +] diff --git a/comm/chat/protocols/twitter/twitter.sys.mjs b/comm/chat/protocols/twitter/twitter.sys.mjs new file mode 100644 index 0000000000..96f856ea0f --- /dev/null +++ b/comm/chat/protocols/twitter/twitter.sys.mjs @@ -0,0 +1,62 @@ +/* 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/twitter.properties") +); + +function Account(aProtocol, aImAccount) { + this._init(aProtocol, aImAccount); +} +Account.prototype = { + __proto__: GenericAccountPrototype, + + connect() { + this.WARN( + "Twitter is no longer supported due to Twitter disabling the streaming " + + "support in their API. See bug 1445778." + ); + this.reportDisconnecting( + Ci.prplIAccount.ERROR_OTHER_ERROR, + lazy._("twitter.disabled") + ); + this.reportDisconnected(); + }, + + // Nothing to do. + unInit() {}, + remove() {}, +}; + +export function TwitterProtocol() { + this.registerCommands(); +} + +TwitterProtocol.prototype = { + __proto__: GenericProtocolPrototype, + get normalizedName() { + return "twitter"; + }, + get name() { + return lazy._("twitter.protocolName"); + }, + get iconBaseURI() { + return "chrome://prpl-twitter/skin/"; + }, + get noPassword() { + return true; + }, + getAccount(aImAccount) { + return new Account(this, aImAccount); + }, +}; |