mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 22:35:52 +01:00
Don't import appservice module from crypto
This commit is contained in:
parent
d9b06852a3
commit
87bfbbea2e
2 changed files with 10 additions and 5 deletions
|
|
@ -24,9 +24,9 @@ const (
|
|||
Sync
|
||||
)
|
||||
|
||||
type EventHandler func(evt *event.Event)
|
||||
type OTKHandler func(otk *mautrix.OTKCount)
|
||||
type DeviceListHandler func(otk *mautrix.DeviceLists, since string)
|
||||
type EventHandler = func(evt *event.Event)
|
||||
type OTKHandler = func(otk *mautrix.OTKCount)
|
||||
type DeviceListHandler = func(lists *mautrix.DeviceLists, since string)
|
||||
|
||||
type EventProcessor struct {
|
||||
ExecMode ExecMode
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import (
|
|||
|
||||
"github.com/rs/zerolog"
|
||||
|
||||
"maunium.net/go/mautrix/appservice"
|
||||
"maunium.net/go/mautrix/crypto/ssss"
|
||||
"maunium.net/go/mautrix/id"
|
||||
|
||||
|
|
@ -181,7 +180,13 @@ func (mach *OlmMachine) OwnIdentity() *id.Device {
|
|||
}
|
||||
}
|
||||
|
||||
func (mach *OlmMachine) AddAppserviceListener(ep *appservice.EventProcessor) {
|
||||
type asEventProcessor interface {
|
||||
On(evtType event.Type, handler func(evt *event.Event))
|
||||
OnOTK(func(otk *mautrix.OTKCount))
|
||||
OnDeviceList(func(lists *mautrix.DeviceLists, since string))
|
||||
}
|
||||
|
||||
func (mach *OlmMachine) AddAppserviceListener(ep asEventProcessor) {
|
||||
// ToDeviceForwardedRoomKey and ToDeviceRoomKey should only be present inside encrypted to-device events
|
||||
ep.On(event.ToDeviceEncrypted, mach.HandleToDeviceEvent)
|
||||
ep.On(event.ToDeviceRoomKeyRequest, mach.HandleToDeviceEvent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue