You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use client.Store to inspect the joined rooms and memebers without sending explicit requests that are prone to race conditions. However, I also need my bot not to answer to old messages so I use mautrix.OldEventIgnorer for that purpose like this:
var oei mautrix.OldEventIgnorer
oei.Register(client.Syncer.(mautrix.ExtensibleSyncer))
Then I access the room list later after sync (in response to a user command) like this:
client.Store.(*mautrix.InMemoryStore).Rooms
And this map is empty because the initial sync gets skipped completely according to the OldEventIgnorer logic. The bot will only update the room states for new rooms that it joins after launch but not for everything that happened before. Is there any way to make it work?
PS: for now I made it work with this simple handler:
It simply removes all message events from the initial sync but leaves everything else intact so the other handlers can populate the initial state. It can't handle more complex situations when the bot leaves and rejoins later (unlike the vanilla implementation) but currently I don't need this functionality. Maybe these two approaches can be combined?
The text was updated successfully, but these errors were encountered:
I'd like to use
client.Store
to inspect the joined rooms and memebers without sending explicit requests that are prone to race conditions. However, I also need my bot not to answer to old messages so I usemautrix.OldEventIgnorer
for that purpose like this:Then I register store updates:
Then I access the room list later after sync (in response to a user command) like this:
And this map is empty because the initial sync gets skipped completely according to the
OldEventIgnorer
logic. The bot will only update the room states for new rooms that it joins after launch but not for everything that happened before. Is there any way to make it work?PS: for now I made it work with this simple handler:
It simply removes all message events from the initial sync but leaves everything else intact so the other handlers can populate the initial state. It can't handle more complex situations when the bot leaves and rejoins later (unlike the vanilla implementation) but currently I don't need this functionality. Maybe these two approaches can be combined?
The text was updated successfully, but these errors were encountered: