1
0
Fork 0
mirror of https://github.com/mautrix/discord.git synced 2026-07-07 06:43:18 -04:00
Commit graph

72 commits

Author SHA1 Message Date
Skip R
37156a3ba2 connector: log amount of dms synced 2026-05-13 01:36:32 -07:00
Skip R
80a46e1fa7 connector: stop using RecipientIDs
This field is undocumented and the gateway doesn't always send it with
good data.
2026-04-20 20:36:09 -07:00
Skip R
d58edf7b65 handlediscord: respect friend nicknames 2026-04-08 23:53:31 -07:00
Skip R
af4cf49217 make method receiver names more consistent 2026-04-06 20:45:01 -07:00
Skip R
d138c12bbd connector: handle live relationship updates
discordgo should really be doing this
2026-03-31 01:13:37 -07:00
Skip R
d20451cea8 analytics: make last send attempt relationship type readable 2026-03-31 01:12:48 -07:00
Skip R
e824270244 analytics: send on auth invalidated
also simplify the call sites a bit
2026-03-31 00:18:52 -07:00
Skip R
6ccb507298 analytics: send when account requires verification 2026-03-31 00:16:51 -07:00
Skip R
1d77d59fd5 analytics: send when getting CAPTCHA challenge from discord
to help us find out which endpoints like to serve challenges
2026-03-31 00:15:49 -07:00
Skip R
672f4b8c23 handlediscord: make sure all parent spaces exist before their children
Using `QueueRemoteEvent` to blindly fire off the resyncing of spaces as
well as their child rooms effectively races, resulting in the child
rooms lacking a `network` in their `m.bridge` state.

To fix this, synchronously ensure that the spaces exist before bridging
their children.

This patch also makes it so that empty categories (categories that are
literally empty as well as categories exclusively consisting of channels
that can't be viewed by the user) are no longer bridged.
2026-03-18 22:38:06 -07:00
Skip R
c1b90ef84e downgrade log level of "Computed visibility of guild channel" logs
These are really noisy.
2026-03-18 22:19:50 -07:00
Skip R
7363538bae sync private channel deletions that occur while the bridge is offline 2026-03-11 19:13:51 -07:00
Skip R
edcad997ac client: don't set a up session if we lack a token entirely 2026-03-10 23:01:24 -07:00
Skip R
cd1f9ddd85 connector: check for nil session before disconnecting 2026-03-10 22:59:28 -07:00
Skip R
51473cf210 connector: check if we're logged out much more 2026-03-10 22:58:40 -07:00
Skip R
2e7e39a91c properly handle our credentials becoming invalidated
Further support cancellation (via concurrent Disconnect call) while
we're "sleeping" in connectRetrying. This is sorta half baked because we
don't handle cancellation post-Open, which should really be added so we
can avoid the sync.
2026-03-10 22:08:35 -07:00
Skip R
261d041ebb client: refuse to connect if token is empty
This is in preparation of us intentionally emptying the token if our
credentials become invalid.
2026-03-10 22:05:52 -07:00
Skip R
a06b09f201 handlediscord: add error constants 2026-03-10 22:04:07 -07:00
Skip R
2cd22e0100 properly handle 40002 errors 2026-03-10 21:04:23 -07:00
Skip R
9719c6d1d5 add proper support for remote profiles 2026-03-06 21:54:15 -08:00
Skip R
1bb9b0c244 chatinfo: bridge discord mute state to matrix
Note that mute_only_on_create in the config seems to default to true.
When that is the case, the remote mute state only makes a difference
during initial portal creation.
2026-03-05 16:29:41 -08:00
Skip R
35dcea1f03 client,handlediscord: keep track of user guild settings
These contain information about mutes, notification settings, etc.
2026-03-05 16:28:21 -08:00
Skip R
cfe1d24d19 connector: handle receivers correctly and consolidate thread routing
* The split_portals config option is finally respected.
* This should prevent future room duplication when migrating from the
  pre-bridgev2 version of the bridge, as we'll finally address guild
  channels properly (that is, without a Receiver set, unless
  split_portals is true).
2026-03-04 19:15:46 -08:00
Skip R
1ead5baf2f client: handle read states 2026-03-03 21:23:49 -08:00
Skip R
55c0272903 handlediscord: initial pass at threads support 2026-02-27 06:44:09 -08:00
Skip R
ea3052e567 handlediscord: sync roles from guilds 2026-02-27 06:44:09 -08:00
Skip R
91f8d2b269 support custom emojis 2026-02-17 19:45:12 -08:00
Skip R
dfa9c52974 discordid: make function names more explicit
These are fairly wordy but help maintain correctness. A channel portal
ID should not be confused with a guild portal ID.
2026-02-13 21:19:07 -08:00
Skip R
04c15d15a7 handlediscord: bridge categories with proper parenting 2026-02-13 21:05:35 -08:00
Skip R
40ae884e7f connector/client: refactor guild subscription, push log onto context 2026-02-11 19:23:19 -08:00
Skip R
07ba87f9d6 handlediscord: bridge guild delete 2026-02-11 17:42:25 -08:00
Skip R
c8561de9c4 connector: panic with a more useful message when creating nil sender 2026-02-09 15:05:07 -08:00
Skip R
2310d2c036 usercache: rename methods
"Update" better expresses what is being done to the cache.
2026-02-06 17:55:46 -08:00
Skip R
d8ca44ecd9 connector: implement user cache
* 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.
2026-02-06 15:43:51 -08:00
Skip R
4bdb0de559 discordid,connector: remember which guilds were bridged 2026-02-05 22:21:16 -08:00
Skip R
6adf319cfb connector: sync guild spaces via event instead of manually 2026-02-03 21:36:08 -08:00
Skip R
47095f1993 connector: instantiate http.Client from bridge settings 2026-02-03 21:00:35 -08:00
Skip R
2682175508 connector: fetch @me to create login before creating client
Creating the client before the actual UserLogin is bad form.
2026-02-02 22:52:14 -08:00
Skip R
92352ce603 discordid: remove all ID-related casts
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.
2026-02-01 21:09:17 -08:00
Skip R
5e0f9b909a connector: break out guild bridging logic into method 2026-01-26 11:33:13 -08:00
Skip R
b4fdd8b9ed connector: don't crash upon less than 10 private channels 2026-01-26 11:33:13 -08:00
Skip R
7849c09443 connector: send bridge state updates on gateway events
This also makes the account properly appear in client settings after
provisioning.
2026-01-20 16:08:16 -08:00
Skip R
5b7a7a430c connector: fix log messages when downloading guild avatars 2026-01-15 15:53:17 -08:00
Skip R
f5292e6a7d connector: first pass at bridging guilds
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.
2026-01-09 19:57:17 -08:00
Skip R
86544bc7af relocate dbmeta models to discordid
While we're about to introduce more metadata structs, it seems like
mautrix-slack keeps these in slackid, so let's keep ours in discordid.
2026-01-09 17:13:15 -08:00
Skip R
fdcfb2b083 chore: bump copyright year 2026-01-08 16:56:13 -08:00
Skip R
bfebeeb7e5 handlematrix: bridge outgoing typing events 2026-01-08 16:49:27 -08:00
Skip R
8a28fa0f95 connector: share session construction logic
So we can't forget to set up the logging handler.
2026-01-07 18:51:32 -08:00
Skip R
e71075cd0d handlematrix: bridge outgoing message attachments 2026-01-05 22:29:26 -08:00
Skip R
099b464f84 client: refactor boot logic into SetUp method
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...?
2025-12-18 19:34:50 -08:00