mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-13 17:13:11 +01:00
Add logging for custom puppets and save next batch properly
This commit is contained in:
parent
0db44d4cc7
commit
5346e01d2a
1 changed files with 7 additions and 3 deletions
|
@ -23,6 +23,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"maunium.net/go/mautrix"
|
"maunium.net/go/mautrix"
|
||||||
"maunium.net/go/mautrix-appservice"
|
"maunium.net/go/mautrix-appservice"
|
||||||
)
|
)
|
||||||
|
@ -64,6 +65,8 @@ func (puppet *Puppet) newCustomIntent() (*appservice.IntentAPI, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
client.Logger = puppet.bridge.AS.Log.Sub(puppet.CustomMXID)
|
||||||
|
client.Syncer = puppet
|
||||||
client.Store = puppet
|
client.Store = puppet
|
||||||
|
|
||||||
ia := puppet.bridge.AS.NewIntentAPI("custom")
|
ia := puppet.bridge.AS.NewIntentAPI("custom")
|
||||||
|
@ -123,7 +126,8 @@ func (puppet *Puppet) stopSyncing() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (puppet *Puppet) ProcessResponse(resp *mautrix.RespSync, since string) error {
|
func (puppet *Puppet) ProcessResponse(resp *mautrix.RespSync, since string) error {
|
||||||
puppet.log.Debugln("Sync data:", resp, since)
|
d, _ := json.Marshal(resp)
|
||||||
|
puppet.log.Debugln("Sync data:", string(d), since)
|
||||||
// TODO handle sync data
|
// TODO handle sync data
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -161,7 +165,7 @@ func (puppet *Puppet) GetFilterJSON(_ string) json.RawMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (puppet *Puppet) SaveFilterID(_, _ string) {}
|
func (puppet *Puppet) SaveFilterID(_, _ string) {}
|
||||||
func (puppet *Puppet) SaveNextBatch(_, nbt string) { puppet.NextBatch = nbt }
|
func (puppet *Puppet) SaveNextBatch(_, nbt string) { puppet.NextBatch = nbt; puppet.Update() }
|
||||||
func (puppet *Puppet) SaveRoom(room *mautrix.Room) {}
|
func (puppet *Puppet) SaveRoom(room *mautrix.Room) {}
|
||||||
func (puppet *Puppet) LoadFilterID(_ string) string { return "" }
|
func (puppet *Puppet) LoadFilterID(_ string) string { return "" }
|
||||||
func (puppet *Puppet) LoadNextBatch(_ string) string { return puppet.NextBatch }
|
func (puppet *Puppet) LoadNextBatch(_ string) string { return puppet.NextBatch }
|
||||||
|
|
Loading…
Reference in a new issue