swap away from lazymemstore
This commit is contained in:
parent
0d013bfe28
commit
ba048c35da
22
main.go
22
main.go
@ -25,11 +25,27 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
store := mbl.NewLazyMemStore(conf.Statefile)
|
||||
matrixClient, err := mbl.NewMatrixClient(conf, store)
|
||||
dataFilter := &mautrix.Filter{
|
||||
AccountData: mautrix.FilterPart{
|
||||
Limit: 20,
|
||||
NotTypes: []event.Type{
|
||||
event.NewEventType("nun.batch"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
matrixClient, err := mbl.NewMatrixClient(conf, nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
store := mautrix.NewAccountDataStore("nun.batch", matrixClient)
|
||||
_, err = matrixClient.CreateFilter(dataFilter)
|
||||
if err != nil {
|
||||
//don't want to continue if we can't keep state
|
||||
panic(err)
|
||||
}
|
||||
matrixClient.Store = store
|
||||
syncer := matrixClient.Syncer.(*mautrix.DefaultSyncer)
|
||||
mbl.AcceptAllRoomInvites(matrixClient)
|
||||
syncer.OnEventType(event.EventMessage, func(source mautrix.EventSource, evt *event.Event) {
|
||||
@ -43,7 +59,7 @@ func main() {
|
||||
}
|
||||
return
|
||||
}
|
||||
switch cmd[1] {
|
||||
switch cmd[0] {
|
||||
case "version":
|
||||
// print version
|
||||
if GitTag != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user