matrix-hacks / matrix-puppet-slack

puppet style slack bridge for matrix
47 stars 17 forks source link

Failed to register AS #83

Closed pztrn closed 5 years ago

pztrn commented 5 years ago

After following guide from README.md I get:

chat node[21376]: { [M_EXCLUSIVE: This application service has not reserved this kind of alias.]
chat node[21376]:   name: 'M_EXCLUSIVE',
chat node[21376]:   message:
chat node[21376]:    'This application service has not reserved this kind of alias.',
chat node[21376]:   data:
chat node[21376]:    { errcode: 'M_EXCLUSIVE',
chat node[21376]:      error:
chat node[21376]:       'This application service has not reserved this kind of alias.' },
chat node[21376]:   httpStatus: 400 }
thomas-profitt commented 5 years ago

As I understand it, this error is sent by the homeserver when the bridge tries to create a room alias that begins with a prefix, or matches a regex, that hasn't been reserved in the registration.yaml file for the appservice.

pztrn commented 5 years ago

Actually I've solved that with that patch:

diff --git a/index.js b/index.js
index 450881f..ba781ff 100644
--- a/index.js
+++ b/index.js
@@ -24,7 +24,7 @@ new Cli({
       reg.setAppServiceToken(AppServiceRegistration.generateToken());
       reg.setSenderLocalpart(`slack_bot`);
       reg.addRegexPattern("users", `@slack_.*`, true);
-      reg.addRegexPattern("aliases", `@slack_.*`, false);
+      reg.addRegexPattern("aliases", `#slack_.*`, false);
       callback(reg);
     }).catch(err=>{
       console.error(err.message);

Found somewhere around here, by the way.

thomas-profitt commented 5 years ago

Oh, good! That change is part of 1.12.0, so it sounds like we can close this. Thanks for filing the issue!