1
0
Fork 0

add appservice listener

This commit is contained in:
Cadence Ember 2023-06-29 08:08:17 +12:00
parent 740ddc36d1
commit d70199f890
4 changed files with 23 additions and 1 deletions

8
m2d/appservice.js Normal file
View file

@ -0,0 +1,8 @@
const reg = require("../matrix/read-registration")
const AppService = require("matrix-appservice").AppService
const as = new AppService({
homeserverToken: reg.hs_token
})
as.listen(+(new URL(reg.url).port))
module.exports = as

8
m2d/event-dispatcher.js Normal file
View file

@ -0,0 +1,8 @@
const assert = require("assert").strict
const {sync, as} = require("../passthrough")
// Grab Matrix events we care about for the bridge, check them, and pass them on
sync.addTemporaryListener(as, "type:m.room.message", event => {
console.log(event)
})