* Fixes the totally broken UserInfo resolution in guilds.
* Adds support for USER_UPDATE from the gateway.
Design considerations behind the user cache:
* Explicitly handle deleted user IDs by short circuiting the lookup
logic and returning a singleton.
* The cache map is protected during HTTP requests to the Discord API.
* The nonexistence of a user is cached. This is to prevent excessive
requests (a user can't suddenly begin existing at a given ID).
The user cache is upserted on READY, incoming messages, backfill, etc.
In the same vein as mautrix-whatsapp, -slack and others, do not make
assumptions about how the ID is represented in the connector code. Let
the discordid package be entirely responsible.
For each guild specified in the config, create a space and bridge all
contained text channels that the user has permissions to view.
* Finally add a custom config struct where we accept a list of guild IDs
to bridge. This is intended to be temporary as we flesh out the proper
interfaces for managing which guilds to bridge.
* Defined a custom meta type for portals that holds the containing guild
ID of the channel (if any).
* Transferred the responsibility of building a channel's ChatInfo and
ChatMemberList to the DiscordChatResync event itself.
This method only has heartbeat session population logic for now, so it's
actually a no-op during provisioning. However, there's probably some
value in "mandating" that clients call this shortly after construction,
so we have a chance to run any setup logic that we might need in the
future.
This _feels_ unidiomatic...?
I don't have the logs anymore unfortunately, but I witnessed a
(seemingly?) rare nil dereference _within discordgo's event handling
code_ after Disconnect on the client was called (caused by SIGINT). My
thinking is that this caused the Session to get garbage collected, so
the method receiver became nil out from under it.
To let discordgo clean up after itself, keep a reference to it in the
client.
This comment seems to imply that specifying this function is a shortcut
of sorts, when it's actually required and mautrix-go doesn't fallback to
the connector in the way described.