Commit Graph

319 Commits

Author SHA1 Message Date
Tulir Asokan 03fe8bf782 from-matrix: don't expect mute timestamp to be max int32 2025-07-23 13:43:06 +03:00
Adam Van Ymeren 840788c1e5 auth: fix cloud auth (#113) 2025-07-19 08:39:48 -07:00
Tulir Asokan d4f6be8155 sync: fix handling chats with no messages 2025-07-17 18:26:16 +03:00
Adam Van Ymeren e9abeda916 Rework telegram client lifecycle to hopefully fix not stopping issues (#112) 2025-07-17 09:56:11 -04:00
Tulir Asokan 3fb554b934 client: add todo for usernames in links
[skip ci]
2025-07-15 16:39:50 +03:00
Tulir Asokan a7aa96ef2b tomatrix: add more nil safety to media id hashing 2025-07-15 14:53:12 +03:00
Adam Van Ymeren a501042f1d updates: don't error on edit if not tg.Message, just warn 2025-07-14 11:34:49 -07:00
Adam Van Ymeren 7970a678fc updates: elevate start/stop logs to debug bridge not stopping 2025-07-14 11:33:23 -07:00
Toni Spets cb98833590 directmedia: handle custom emojis 2025-07-10 09:15:58 +03:00
Adam Van Ymeren e6c3454e9f updates: don't try to fetch one more difference when context has been cancelled 2025-07-08 11:43:32 -07:00
Adam Van Ymeren 4c9555eded HandleMute: property set silent and MuteUntil 2025-07-07 14:44:59 -07:00
Tulir Asokan 9e2e2421d2 gotd: remove _tools package that was breaking pre-commit 2025-07-07 17:19:33 +03:00
Adam Van Ymeren 10bc44d17d scoped_store: Fix user access hash fetching 2025-07-04 15:03:59 -07:00
Adam Van Ymeren 125be97201 conn/rpc: Don't bother sending RPCDrop requests to server 2025-07-04 14:16:20 -07:00
Adam Van Ymeren d4239d520a backfill: fix forward backfill
only skip too new messages if we're actually doing backwards backfill
2025-07-03 21:42:33 -07:00
Adam Van Ymeren 399cd5585a ScopedStore: fix GetAccessHash always returning found: false 2025-07-02 14:10:50 -07:00
Adam Van Ymeren ac3ce3c097 don't error on unsupported peer type in settings handler 2025-06-27 21:53:42 -07:00
Adam Van Ymeren 6280a7bae7 updates: don't error just warn on unknown messages/actions 2025-06-27 20:34:30 -07:00
Adam Van Ymeren af630ecbd1 updates: don't die when deleting a message we don't have in db, just log and ignore 2025-06-27 20:20:53 -07:00
Adam Van Ymeren 7a04f298d2 move gotd fork into repo. (#111)
- update to latest telegram layer
- remove some references to fields in tg.Entities that don't exist in
the schema
- originally added here:
https://github.com/beeper/td/commit/820929062a2ba0104397bc01235ab58a9cff780e
  - referenced here
-
https://github.com/mautrix/telegramgo/commit/124f0967ed195b5a380c9bd02e170ada9710dde3
-
https://github.com/mautrix/telegramgo/commit/4205047aab2e0639217148b5d125bfaab668bd8e
2025-06-27 20:03:37 -07:00
Adam Van Ymeren 0952df0244 all: respect/propagate errors from QueueRemoteEvent (#110) 2025-06-26 13:43:35 -07:00
Toni Spets 8ac519d1e5 connector: Disconnect in a goroutine on auth error
If we get bad creds on initial connect the lock is being held when the
callback is called.
2025-06-25 08:55:36 +03:00
Tulir Asokan a49818b863 dependencies: update mautrix-go 2025-06-17 20:35:16 +03:00
Toni Spets fa237a20f7 logging: Move gotd debug logs to trace
Zap doesn't have trace level logging so to make it less noisy we need to
shift them to trace.
2025-06-09 15:01:25 +03:00
Toni Spets e7b87835b6 Fix a race between connect and disconnect
If we get an auth error during connect we did deadlock.
2025-06-06 10:57:07 +03:00
Toni Spets 3c3c3f1dec client: Prefer contact name if exists
Don't allow TG user to override your own contact name for them after
they have been made a contact.
2025-05-30 13:22:57 +03:00
Toni Spets a9a267bc0d directmedia: handle webpage previews as well 2025-05-27 14:39:47 +03:00
Tulir Asokan 05b1eb1214 handletelegram: provide stream order in read receipts (#102) 2025-05-27 11:45:39 +03:00
Toni Spets 0f36833e89 Revert "Revert "client: unblock connect without network""
This reverts commit ea4626107c.

Adds waiting support for initial connection established to avoid locking
up gotd. This isn't extremely pretty but should do the job for now.
2025-05-27 07:40:38 +03:00
Toni Spets ea4626107c Revert "client: unblock connect without network"
This reverts commit 14c784f2a2.
2025-05-23 10:32:51 +03:00
Toni Spets 39c1b685d6 client: logout with timeout to API call to unblock it 2025-05-23 09:28:32 +03:00
Toni Spets 14c784f2a2 client: unblock connect without network
It'll still probably not race too much if disconnect gets called while
connecting is still stuck doing something.
2025-05-23 09:20:38 +03:00
Toni Spets 11f105c0e7 media: convert png and jpeg stickers to webp without ffmpeg 2025-05-22 13:52:51 +03:00
Toni Spets 9e719429e7 Fix handle channel photo edits as well as group chats 2025-05-21 08:15:23 +03:00
Tulir Asokan d2bb02b259 handlematrix: use client-generated transaction IDs 2025-05-09 16:42:44 +03:00
Toni Spets 7e75c8ef83 media: make all media direct downloadable
The only exception is emojis.

Also changed direct download encoding field names to be more generic
when used in mixed manner depending on peer type.

Direct downloads are still somewhat inefficient as they require an API
round trip to succeed but we can cache things in the database if needed.
2025-05-07 06:43:51 +03:00
Brad Murray 9d3e9df57e Merge pull request #98 from mautrix/dont-500-on-resolve-identifier-not-resolving
Use 404 status when not matching a valid identifier
2025-05-06 13:16:13 -04:00
Toni Spets 483816cc2b media: Request 1MB chunks for direct media streaming
The default is 512kB and the RPC request overhead has more impact
on download speed than having half smaller chunks.

Next level speed improvement would be to use parallel downloads and
have an on-disk buffer to stream out the rebuilt file on-the-fly when
we consistent stream of data available.
2025-04-28 12:38:02 +03:00
Toni Spets 7c13481ede client: Handle connect/disconnect/auth races properly
When logging out, we should first handle network level logout and after
that ensure the client is disconnected before removing state to avoid
having event handling during disconnect from touching anything anymore.

I don't know why we nilled the client but since so many places use it
we'd rather get errors rather than panics if it's being used after
logging out but previous lifecycle fixes should avoid that.
2025-04-26 08:19:33 +03:00
Adam Van Ymeren eb5ae65402 reactions: fix db race when handling reactions on newly received old messages (#100) 2025-04-25 13:19:50 -07:00
Toni Spets 53e89441b7 media: fix lottie mime type for direct download 2025-04-25 07:38:06 +03:00
Tulir Asokan 48d91fdf76 media/sticker: fix lottie mime type
It's always gunzipped, so should never send the application/x-tgsticker mime.
Also, video/lottie+json was recently registered with IANA, so use that instead
of the old image/lottie+json: <https://www.iana.org/assignments/media-types/video/lottie+json>
2025-04-24 15:56:44 +03:00
Brad Murray bdae6dd620 Use 404 status when not matching a valid identifier 2025-04-17 13:10:34 -04:00
Toni Spets 224b01e7a4 client: Wait for updates manager to finish on disconnect 2025-04-15 12:19:28 +03:00
Tulir Asokan 5421de8e76 handlematrix: include stream order in response 2025-04-11 23:01:06 +03:00
Toni Spets a64a178dc3 client: Don't try to reconnect with canceled context 2025-04-10 10:13:02 +03:00
Toni Spets 538f2a2ec0 client: Wait before returning from disconnect 2025-04-09 10:49:45 +03:00
Nick Mills-Barrett 10b8c4b635 chatinfo: log when chats have no or unknown photo types 2025-04-07 13:58:53 +01:00
Sumner Evans b955252a6a backfill: add stream order
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-03-28 08:33:33 -06:00
Tulir Asokan 6347383788 tomatrix: fix refetching channel media when bridging messages 2025-03-27 18:31:48 +02:00