Commit Graph

2273 Commits

Author SHA1 Message Date
Toni Spets 849f3c6f1e Bump gotd with sticky DC hack 2025-04-29 06:38:42 +03: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
Toni Spets 75964a00ed dependencies: update mautrix-go 2025-04-15 12:19:28 +03: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
Tulir Asokan 28d8276554 dependencies: update mautrix-go 2025-03-25 17:00:55 +02:00
Sumner Evans 09b1e69c0f backfill: fix NPE if no messages found
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-03-13 11:58:18 -06:00
Sumner Evans 854f66cb04 store: make finding by username case-insensitive
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-03-05 18:17:30 -07:00
Sumner Evans 1bc3a2538e treewide: add copyright/license notices
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-03-05 10:16:50 -07:00
Sumner Evans dcc8689835 emojis: properly handle inline emojis on local
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-03-04 11:27:09 -07:00
Sumner Evans ebc1aa05b1 connector/login: fix a context issue on phone number login
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-26 11:22:48 -07:00
Sumner Evans a56f2977b4 login: fix contexts
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-25 08:35:31 -07:00
Sumner Evans 36bb741c68 client: refetch message during conversion if file reference expired
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-24 11:45:21 -07:00
Sumner Evans f0f92c9dd9 gitattributes: mark humanise/errors.go as generated
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-21 09:56:27 -07:00
Sumner Evans e8ee5f174e connector/tomatrix: include previewed URL in hash
This will hopefully make it so that if the preview gets edited in by
Telegram at a later time, it will be bridged.

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-17 14:14:15 -07:00
Sumner Evans f86ebad162 pre-commit: update all
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-17 14:14:15 -07:00
Sumner Evans 0712ca5d0c dependencies: update go
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-17 14:13:12 -07:00
Sumner Evans dad34f9a3c connector: fix getting media filename fallback
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-02-17 13:53:16 -07:00
Tulir Asokan c2e07d5e3f push: add APNs push parsing 2025-02-06 15:13:31 +02:00
Tulir Asokan 255c1e2e57 push: fix types 2025-02-04 19:14:57 +02:00
Tulir Asokan a680036177 push: fix parsing decrypted json 2025-02-04 18:08:23 +02:00
Tulir Asokan 94789daed3 capabilities: fix image mime types 2025-02-04 18:06:25 +02:00
Tulir Asokan e0841e252d dependencies: update 2025-02-04 15:57:33 +02:00
Tulir Asokan ab9ff87815 push: log data if it's not json 2025-02-04 15:46:58 +02:00
Tulir Asokan 4b08ab6ac0 push: implement ConnectBackground (#88)
* push: implement ConnectBackground

* push: disable background resync by default
2025-01-29 15:35:54 +02:00
Tulir Asokan 823eda7589 push: implement parsing native notifications (#87) 2025-01-24 15:34:34 +02:00
Tulir Asokan b158ba6b8b capabilities: add default emoji list hash to ID
The list can change, so it should change the ID too
2025-01-14 14:57:58 +02:00
Tulir Asokan 571152cb41 capabilities: update reaction settings 2025-01-14 14:56:22 +02:00
Sumner Evans c82b273155 connector/reactions: return error if not logged in
Previously, the getAvailableReactions function was only called with a
logged in client. However, now that it is called in the GetCapabilities
call, the client is no longer guaranteed to be logged in.

This was causing an NPE due to the (*TelegramClient).client being nil.

This commit makes the getAvailableReactions function not panic when the
client is not logged in.

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-13 21:28:26 -07:00
Sumner Evans 4bef6ea09e connector/tomatrix: add timeout for getting webpage preview
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-13 11:00:15 -07:00
Tulir Asokan 386cfa4cfb capabilities: update to new format 2025-01-10 21:17:10 +02:00
Sumner Evans f4052dcfd3 connector: set IsSuperGroup on dialog sync
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-09 18:59:13 -07:00
Sumner Evans 664d6050df backfill: manually skip too-new messages in backwards backfill
For some reason, even though we provide an offset, Telegram sometimes
sends us more events than we request, including newer events than the
offset ID. Messages beyond the offset are then chopped off by the
bridgev2 code, but we continue trying to backfill the portal thinking
that there is more to backfill. This causes infinite backfill loops.

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-09 17:46:36 -07:00
Sumner Evans 9e868e4614 connector: fix linking to premium messages
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-09 17:46:36 -07:00
Sumner Evans 2743d5375a connector/tomatrix: fix broadcast messages with no From user
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-09 17:46:18 -07:00
Sumner Evans c3fc77c2a8 connector: always use channel sender in broadcast rooms and add per-message profile
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-09 12:52:43 -07:00
Sumner Evans 6c7727d6b5 connector/media: fix comment
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-07 22:56:32 -07:00
Tulir Asokan 3ef2cbe102 push: extract app sandbox flag to global variable 2025-01-07 18:32:33 +02:00
Sumner Evans 487f11ffd7 connector/tomatrix: strip filename unconditionally on stickers
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-06 10:44:17 -07:00
Sumner Evans 655cd98f27 connector/tomatrix: fix video stickers
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2025-01-06 10:26:02 -07:00
Sumner Evans f14c90dc87 deps/td: upgrade
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
2024-12-19 08:36:01 -07:00