Chat Core Protocols
The Chat Core code used by Thunderbird has some abstractions to deal with the differences between protocols (e.g. IRC vs. XMPP).
Protocol Interfaces
Protocols are implemented in chat core using JavaScript.
Protocols must implement the proper interfaces and be registered with the category manager in order to be found. Protocols need to implement the prplI* interfaces(git link, searchfox link) (this can mostly be done using jsProtoHelper(git link, searchfox link)). The minimum set of interfaces to implement are:
prplIProtocol(git link, searchfox link)
prplIAccount(git link, searchfox link)
prplIConversation(git link, searchfox link)
Useful Code
imXPCOMUtils(git link, searchfox link): Additional XPCOM utilities.
JavaScript socket(git link, searchfox link): Simplified socket code.
jsProtoHelper(git link, searchfox link): Includes basic JavaScript implementations of the interfaces and some helper code.
XML HTTP Request helper(git link, searchfox link): Simplified HTTP request code
Example Implementations
The code for the JavaScript protocols we ship by default is here(git link, searchfox link).
IRC(git link, searchfox link): A full implementation, including private chats and MUCs, etc.
JavaScript Test Protocol(git link, searchfox link): An extremely simple example meant to serve as test code for the interfaces.
Matrix(git link, searchfox link): An implementation that heavily depends on an external SDK.
XMPP(git link, searchfox link): A full implementation, including private chats and MUCs, etc. There are also other protocols which inherit and customize XMPP:
GTalk(git link, searchfox link)
Odnoklassniki(git link, searchfox link)
There are also some stub implementations for protocols that Thunderbird used to support, but no longer does. These exist purely for the icons to show up and for a nice error message to appear when the account tries to connect.
Useful Code Snippets
Using Services.core.getProtocols() to list all protocols
This lists the protocol plugins that the core service knows about. You can copy the code (as it is), paste it in the error console (linebreaks will automatically be ignored) and press "Enter" to run it.
Last updated
Was this helpful?

