Browse Source

Let the bridge appear in the thirdparty/protocols API

In order to be listed in the thirdparty/protocols API, the
resigtration file must set the protocols setting.  Optionally an icon
can be set in the bridge configuration, that is used in the
thirdparty/protocols API accodingly. This makes the bridged network
to show up in the network pull-down list in the riot room directory,
for instance.
tags/0.8.0
Sven Anderson 3 years ago
parent
commit
1abd472e00
2 changed files with 8 additions and 0 deletions
  1. +4
    -0
      config.sample.yaml
  2. +4
    -0
      lib/main.js

+ 4
- 0
config.sample.yaml View File

@@ -48,6 +48,10 @@ ircService:
# An ID for uniquely identifying this server amongst other servers being bridged.
# networkId: "example"

# URL to an icon used as the network icon whenever this network appear in
# a network list. (Like in the riot room directory, for instance.)
# icon: https://example.com/images/hash.png

# The port to connect to. Optional.
port: 6697
# Whether to use SSL or not. Default: false.


+ 4
- 0
lib/main.js View File

@@ -110,6 +110,10 @@ module.exports.generateRegistration = Promise.coroutine(function*(reg, config) {
// connect, for example on startup.
reg.setRateLimited(false);

// Set protocols to IRC, so that the bridge appears in the list of
// thirdparty protocols
reg.setProtocols(["irc"]);

let serverDomains = Object.keys(config.ircService.servers);
serverDomains.sort().forEach(function(domain) {
let server = _toServer(domain, config.ircService.servers[domain], config.homeserver.domain);


Loading…
Cancel
Save