Commit graph

465 commits

Author SHA1 Message Date
Tulir Asokan
1b90f98961 Clamp sticker rendering suggestion 190px 2022-07-05 12:52:32 +03:00
Tulir Asokan
f8d6f712bd Get Matrix msgtype from WhatsApp type instead of mimetype 2022-07-05 12:46:34 +03:00
Tulir Asokan
c16af35d1b Make Portal.UpdateName work without a room 2022-07-05 11:08:21 +03:00
Tulir Asokan
87c4cd6c20 Simplify expression 2022-07-01 22:34:41 +03:00
Tulir Asokan
61f3aa9704 Add still_working field for status event on soft timeouts 2022-07-01 11:02:35 +03:00
Tulir Asokan
bf4c01648f Move most double puppet source key adding to mautrix-go 2022-06-30 20:56:26 +03:00
Tulir Asokan
2542f94e00 Add a warning log and more comments 2022-06-30 14:46:46 +03:00
Tulir Asokan
44768c9c93 Improve max message handling duration options 2022-06-30 14:41:37 +03:00
Tulir Asokan
d3d69d1a8a Add option for max message handling duration 2022-06-29 20:05:55 +03:00
Tulir Asokan
19b4c3093a Apply periodic resync for group chats too 2022-06-28 16:22:11 +03:00
Tulir Asokan
9f0901f560 Add periodic ghost avatar resync 2022-06-28 14:37:50 +03:00
Tulir Asokan
267799cbe0 Update dependencies 2022-06-28 12:09:12 +03:00
Tulir Asokan
68b0f3d0a4 Re-add support for resend_bridge_info 2022-06-27 11:46:30 +03:00
Tulir Asokan
e424382cc9 Add support for list messages 2022-06-24 23:25:38 +03:00
Tulir Asokan
a47ef45e29 Add support for template button reply messages 2022-06-24 22:37:27 +03:00
Tulir Asokan
443ff97e7a Add basic support for business messages 2022-06-24 21:50:58 +03:00
Tulir Asokan
40ea8a8324 Stop using SELECT * 2022-06-24 17:53:28 +03:00
Tulir Asokan
5b698b8c1c Move DualError to mautrix-go 2022-06-21 21:56:08 +03:00
Sumner Evans
e8c86d43d0
encryption: add ability to control rotation settings
Signed-off-by: Sumner Evans <sumner@beeper.com>
2022-06-21 12:33:04 -06:00
Tulir Asokan
aa0daceb85 Add config option to bundle caption with media message 2022-06-17 11:34:24 +03:00
Tulir Asokan
43d8fc5d2b Disallow sending status broadcast messages by default
Sending to big contact lists doesn't really work yet
2022-06-13 20:01:39 +03:00
Tulir Asokan
7f27c76659 Improve tracking errors in Matrix->WhatsApp bridging
Closes #231
2022-05-31 17:28:59 +03:00
Tulir Asokan
79fb0d49b3 Move bridge state stuff to mautrix-go 2022-05-31 00:27:44 +03:00
Tulir Asokan
49a445e10d Update mautrix-go and add log when room is created 2022-05-29 19:22:07 +03:00
Tulir Asokan
372929f454 Fix small things 2022-05-24 14:02:06 +03:00
Tulir Asokan
1185b4bb71 Add mutex to block new messages in specific backfill cases
Specifically, when sending events using the `com.beeper.new_messages`
query param, normal new messages shouldn't be processed, as ordering
might get messed up.

3a264b77ed
2022-05-24 13:39:29 +03:00
Tulir Asokan
91bab528f3 Mark incoming own messages as read after bridging 2022-05-23 10:18:01 +03:00
Tulir Asokan
15129c0acc Move permission config to mautrix-go 2022-05-22 22:03:08 +03:00
Tulir Asokan
73304cd400 Move Matrix event and command handling to mautrix-go 2022-05-22 16:15:54 +03:00
Tulir Asokan
a948ea0146 Move a bunch of stuff to mautrix-go
See d578d1a610

Database upgrades from before v0.4.0 were squashed, users must update
to at least v0.4.0 before updating beyond this commit.
2022-05-22 01:06:30 +03:00
Tulir Asokan
24c2880b20 Adjust error response content log 2022-05-19 15:18:15 +03:00
Tulir Asokan
30cf85a3b1 Ignore media retry errors if the response contains a new URL 2022-05-19 15:14:22 +03:00
Tulir Asokan
962179fb75 Handle edge cases with missing senders in historical messages 2022-05-19 12:08:31 +03:00
Tulir Asokan
5bcc8d3741 Include undecryptable message type in segment event 2022-05-17 21:47:13 +03:00
Sumner Evans
5b73ba7efd
Merge pull request #494 from mautrix/sumner/bri-3309
backfill: remove intermediate queues and unblock re-checking DB
2022-05-16 17:13:29 -06:00
Sumner Evans
df46ca99f9
backfill: remove intermediate buffer for backfill 2022-05-16 14:04:22 -06:00
Tulir Asokan
46ba3981c1 Add Segment events for retry receipts and undecryptable messages 2022-05-16 13:49:43 +03:00
Sumner Evans
f3f6d88e55
backfill: perform batch finish in transaction 2022-05-15 21:43:12 -06:00
Tulir Asokan
0ed0f61ced Add command to change disappearing timer 2022-05-15 14:01:23 +03:00
Tulir Asokan
78fe69a578 Move media 404 error logs to debug level 2022-05-14 14:28:55 +03:00
Tulir Asokan
c00f74af3b Sync push name on message if it got dropped before somehow 2022-05-13 11:34:51 +03:00
Sumner Evans
8cb41b8949
Merge pull request #490 from mautrix/sumner/bri-3238
media backfill: allow media requests to be performed at a specific local time for the user
2022-05-12 11:31:54 -06:00
Sumner Evans
b42aa16684
media backfill: store media key in request
This way, we don't have to fetch the event from Matrix in these situations
2022-05-12 11:30:42 -06:00
Tulir Asokan
9ac8ae984d Always set power level required for reactions and redactions to 0 2022-05-12 10:45:23 +03:00
Sumner Evans
08e77fab29
media backfill: send retry requests at the configured time
Only does the batch send of requests if the request method is 'local_time'
2022-05-11 17:10:55 -06:00
Sumner Evans
b5551ee16a
database: add media requests buffer table 2022-05-11 17:10:55 -06:00
Sumner Evans
e362743f18
config: add settings for automatic media requests 2022-05-11 17:10:55 -06:00
Tulir Asokan
3f6fc27095 Remove GroupingKey from reactions as WhatsApp doesn't seem to use it 2022-05-07 11:25:16 +03:00
Tulir Asokan
289d410a4b Use consistent error message for media not found errors
Sometimes it's encrypted, sometimes it's not
2022-05-02 16:50:15 +03:00
Tulir Asokan
0665c74cce Merge incoming receipt and message channels
Otherwise receipts after downtime might be handled before the messages
those receipts point at.
2022-05-02 15:35:50 +03:00
Tulir Asokan
bf2eb84abb Update error message if media retry fails 2022-05-02 15:29:02 +03:00
Tulir Asokan
4bc4e92877 Remove media backfill queue and just request immediately 2022-05-02 15:00:57 +03:00
Tulir Asokan
387148849a Update mautrix-go again 2022-04-27 23:48:55 +03:00
Sumner Evans
2259b5007f
Merge pull request #483 from mautrix/sumner/bri-3038
backfill: skip chats if the user is not a participant
2022-04-27 08:32:35 -06:00
Sumner Evans
caf0a363c9
backfill: delete messages for rooms the user is not in
If the chat turns out to be not bridgable due to the user not being in
the room, delete the messages, and stop trying to backfill it.
2022-04-27 08:29:20 -06:00
Tulir Asokan
0b036204ca Update dependencies and reduce memory usage when encryping files 2022-04-27 14:31:57 +03:00
Sumner Evans
2afdf80937
backfill: don't create room if the user is not a participant
This can happen if the user gets kicked from a chat.
2022-04-26 12:10:30 -06:00
Sumner Evans
f32c5f2e9a
backfill: fix priority of backfills again
I think this finally has the correct logic for doing each stage for each
portal before going on to the next stage.
2022-04-23 21:50:47 -06:00
Sumner Evans
7772b7e15c
Merge pull request #479 from mautrix/fix-media-fail-error
improve error when media is not present on WA servers
2022-04-22 11:52:36 -06:00
Sumner Evans
159ece3e64
improve error when media is not present on WA servers 2022-04-22 11:49:50 -06:00
Tulir Asokan
3f8d6942d2 Store disappearing timer when creating portal 2022-04-22 16:45:30 +03:00
Sumner Evans
f2e762680c
media backfill: add ability to automatically request media not on WA server
This adds a new backfill type for media that sends a request to the
phone for every media that is not available on the WA servers. WA
deletes media from their servers after about two weeks, so you have to
ask the phone to re-upload it.

In order to use this, you need to enable
bridge.history_sync.backfill_media and configure the requests that will
be made per portal using bridge.history_sync.media (which is similar to
the deferred backfill config).

If you already have backfilled portals, but want to do a one-off media
backfill for all existing portals, you can set
bridge.history_sync.enqueue_backfill_media_next_start to true.
2022-04-19 08:12:51 -06:00
Sumner Evans
7a77b1976c
reactions: send checkpoints for matrix reactions (#472) 2022-04-18 11:14:43 +03:00
Sumner Evans
37b8065db5
Merge pull request #461 from mautrix/sumner/bri-2227
history sync: implement prioritized backfill
2022-04-07 09:28:25 -06:00
Tulir Asokan
d4318d54a4 Add missing return 2022-04-07 10:48:36 +03:00
Sumner Evans
83d397900f
media: add better error when media couldn't be retrieved due to WA deleting it from their servers 2022-04-05 15:35:02 -06:00
Sumner Evans
8a49fea812
backfill: backfill conversation when started
This applies to when the conversation is started via the provisioning
API (start new chat) or when a new message comes in to that portal.
2022-03-29 23:40:22 -06:00
Tulir Asokan
f79ca422e8 Add option to use async media uploads
https://github.com/matrix-org/matrix-spec-proposals/pull/2246
2022-03-21 21:08:48 +02:00
Tulir Asokan
3a6c314878 Normalize variation selectors in emojis in both directions
Remove for WhatsApp, add for Matrix
2022-03-18 01:12:25 +02:00
Tulir Asokan
973f80d7a7 Fix accepting group invites in encrypted rooms 2022-03-14 13:15:52 +02:00
Tulir Asokan
c82a96dccc Handle incoming reaction removals 2022-03-12 19:47:47 +02:00
Tulir Asokan
031d712905 Update whatsmeow 2022-03-09 16:44:25 +02:00
Tulir Asokan
1eb210c249 Add support for bridging reactions 2022-03-05 21:22:31 +02:00
Tulir Asokan
8da6e14bf8
Merge pull request #452 from abmantis/presence_on_typing
Send presence when typing changes
2022-03-01 20:27:28 +02:00
Tulir Asokan
3479e1ccfc Avoid division by zero 2022-02-28 21:41:44 +02:00
abmantis
50a6e383e7 Send presence when typing changes 2022-02-26 22:47:19 +00:00
Tulir Asokan
77bef42ace Use dynamic multiplier when bridging waveform 2022-02-21 14:34:20 +02:00
Tulir Asokan
b389354bcc Send blank protocol message if phone is offline for too long 2022-02-18 12:12:15 +02:00
Tulir Asokan
1a1fd68812 Improve connection error handling 2022-02-17 14:09:40 +02:00
Tulir Asokan
e215850fcf Get displayname when converting mentions of Matrix users. Fixes #338 2022-02-16 01:00:49 +02:00
Tulir Asokan
10a7c781e6 Add support for asking homeserver for URL previews 2022-02-15 16:28:20 +02:00
Tulir Asokan
d257c80327 Only clear custom keys for encrypted events 2022-02-15 13:36:44 +02:00
Tulir Asokan
eee404c62d Fix formatting not being parsed in incoming messages 2022-02-15 13:15:41 +02:00
Tulir Asokan
7aab7870fa Move custom keys to m.new_content in media retry handler 2022-02-10 19:56:30 +02:00
Tulir Asokan
1fbbe7fa06 Remove unused gob register 2022-02-10 19:50:49 +02:00
Tulir Asokan
9a9414db34 Add some extra metadata for gifs 2022-02-10 19:26:16 +02:00
Tulir Asokan
528fbda53f Add initial support for requesting media retries from phone 2022-02-10 19:18:49 +02:00
Tulir Asokan
7ae5791aa3 Bridge audio message waveforms in both directions 2022-02-10 12:50:04 +02:00
Tulir Asokan
94e880c2cc Add support for setting group avatar from Matrix 2022-02-10 12:46:25 +02:00
Sumner Evans
b6352c4991
link previews: only include in Matrix event when there's an actual link 2022-02-06 22:30:00 -07:00
Sumner Evans
711548c0ba
link previews: update to support a list
Uses com.beeper.linkpreviews instead of com.beeper.linkpreview
2022-02-04 18:17:01 -07:00
Tulir Asokan
d4334f5df8 Clean up embedded link preview code 2022-02-04 22:19:55 +02:00
Adam Van Ymeren
779e591e60 fix formatting 2022-02-04 06:56:32 +00:00
Adam Van Ymeren
3ab04e65c8 Add support for bridging embedded link previews
Uses experimental com.beeper.linkpreview content extension
2022-02-04 04:02:03 +00:00
Tulir Asokan
9e39ce565b Move read receipt handling to portal loop
This ensures that read receipts are only handled after the message
they're pointing at, even if the read receipt is sent immediately
(e.g. when the user has WhatsApp open on their phone).
2022-01-19 14:18:34 +02:00
Tulir Asokan
f151dc4e9e Fix wrong log message 2022-01-19 14:13:06 +02:00
Tulir Asokan
a093b7f157 Remove redundant double-inviting of users 2022-01-17 16:26:26 +02:00
Tulir Asokan
abdfcdc8a6 Handle incoming Matrix messages as implicit read receipts 2022-01-17 12:00:02 +02:00
Tulir Asokan
c4a7943775 Add logs to debug read receipts 2022-01-17 10:38:44 +02:00
Tulir Asokan
b3e0d7afbb Reject ghost user invites from non-logged-in users 2022-01-15 13:59:20 +02:00
Tulir Asokan
7f636e6aef Update whatsmeow to read group disappearing message timer 2022-01-07 15:05:09 +02:00
Tulir Asokan
18ea5af45e Add support for disappearing messages 2022-01-07 14:32:00 +02:00
Tulir Asokan
a6adf61417 Ignore file length mismatches again 2022-01-05 22:10:10 +02:00
Sumner Evans
a0a1c0fd45
voice messages: bridge from WhatsApp to native Matrix voice messages
Co-authored-by: Tulir Asokan <tulir@maunium.net>
2022-01-04 10:54:22 -07:00
Tulir Asokan
6a9d5714c0 Log unsupported message type instead of content. Closes #419 2022-01-04 15:21:55 +02:00
Tulir Asokan
e2b0879f16 Add support for multi-contact messages 2022-01-03 16:11:39 +02:00
Tulir Asokan
7e5c2769c6 Clean up personal filtering space support 2021-12-29 21:40:08 +02:00
Helder Ferreira
3ec67ed434
make the bridge homeserver the default on via key space state 2021-12-29 14:25:12 +00:00
Helder Ferreira
727b11e7ef
add newly created channels to the space
Co-authored-by: clmnin <clament.john.k@gmail.com>
2021-12-29 08:37:41 +00:00
Tulir Asokan
7b5764919a Add some sanity overrides for mime -> extension mapping 2021-12-25 22:40:10 +02:00
Tulir Asokan
ca5fcc42ba Reroute broadcast list messages to correct DM portal. Fixes #411 2021-12-25 20:50:36 +02:00
Sumner Evans
ef24e20902
checkpoints: send UNSUPPORTED for broadcast list unsupported 2021-12-21 13:40:08 -07:00
Sumner Evans
cb3a9a381c
Merge pull request #408 from mautrix/double-puppeting-key-for-redactions
double puppeting: add flag to redaction events
2021-12-16 09:21:03 -07:00
Sumner Evans
76530f5774
double puppeting: add flag to redaction events 2021-12-16 09:06:51 -07:00
Tulir Asokan
0d977bc610 Don't send read receipts for fake JIDs 2021-12-16 10:38:12 +02:00
Tulir Asokan
c2520c14db Create portals for incoming undecryptable messages
They might not be actual chat messages, but if we don't create a portal,
the user has no indication that something might have went wrong.
2021-12-16 10:38:12 +02:00
Tulir Asokan
5e2b54f97e Add constant for double puppet value 2021-12-15 13:51:20 +02:00
Sumner Evans
c15b963748
double puppeting: use fi.mau.double_puppet_source 2021-12-15 02:51:26 -07:00
Tulir Asokan
e38b0bf545 Use channel for Matrix events to prevent concurrent sending to WhatsApp 2021-12-14 17:47:30 +02:00
Tulir Asokan
be05d7d4a9 Pass through media dimensions from WhatsApp 2021-12-09 19:20:52 +02:00
Tulir Asokan
9dc1b7911f Fix relay check in DMs 2021-12-09 15:32:11 +02:00
Tulir Asokan
86cb0f221e Fix some logs 2021-12-08 16:00:01 +02:00
Tulir Asokan
0106c5ccf2 Merge remote-tracking branch 'origin/checkpoint-retry-num' 2021-12-07 16:13:48 +02:00
Tulir Asokan
1d8ef6cb89 Add support for MSC2409 2021-12-07 16:02:51 +02:00
Tulir Asokan
00d16bea19 Add notification for live location messages. Fixes #403 2021-12-07 14:51:56 +02:00
Sumner Evans
ed2bb3ac5f
checkpoints: send retry_num 2021-12-03 17:50:55 -07:00
Tulir Asokan
7bb629d199 Fix Matrix read receipt handling too 2021-12-01 21:14:37 +02:00
Tulir Asokan
a909750dcc Mark all messages as read instead of only last one 2021-11-30 16:38:37 +02:00
Tulir Asokan
04ab823a4d Fix some things 2021-11-30 15:27:15 +02:00
Tulir Asokan
0a8cc8fd39 Add checkpoints for ignored redactions. Closes #399 2021-11-30 12:11:23 +02:00
Tulir Asokan
a61ef492cf Fix status broadcast check accidentally muting all chats 2021-11-22 11:03:09 +02:00
Sumner Evans
139a0bd679
Send checkpoints using new API and send DECRYPTED step checkpoints 2021-11-18 08:46:14 -07:00
Sumner Evans
52f09001a7
portal: send checkpoint for matrix messages 2021-11-18 08:46:14 -07:00
Tulir Asokan
91de4fe70e Make proper thumbnails for images when sending to WhatsApp 2021-11-11 20:33:22 +02:00
Tulir Asokan
a8beec8754 Handle identity changes properly. Fixes #384 2021-11-09 17:49:34 +02:00
Tulir Asokan
445da09e1d Simplify reaction error notices 2021-11-09 15:26:37 +02:00
abmantis
b652281682 Send portal notice on reactions
Closes #373
2021-11-09 15:23:55 +02:00
Tulir Asokan
f5ae637ffd Resync all puppets after app state sync completes 2021-11-08 13:04:39 +02:00
Tulir Asokan
19104d857b Remove unused variable and fix formatting 2021-11-06 21:30:27 +02:00
Tulir Asokan
ea045160a2 Never return nil in IntentFor(). Fixes #379 2021-11-06 14:20:56 +02:00
Tulir Asokan
64db9c9c9b Fix displayname not being html-escaped in relay mode templates 2021-11-05 20:08:49 +02:00
Tulir Asokan
433aaf3829 Reimplement more things 2021-11-05 12:17:56 +02:00
Tulir Asokan
7e20452783 Move all SetReply calls to one place 2021-11-05 11:47:51 +02:00
Tulir Asokan
752aff48f1 Prioritize backfilling recent messages and fix some bugs 2021-11-03 21:34:06 +02:00
Tulir Asokan
c42f2123fb Use bridge info content struct from mautrix-go 2021-11-03 20:41:34 +02:00
Tulir Asokan
2d90295488 Use partial info from history sync if latest group info not found 2021-11-03 14:43:53 +02:00
Tulir Asokan
ab4f16328e Send a dummy event for initial history backfill too 2021-11-02 19:09:52 +02:00
Tulir Asokan
e0d79f2de1 Re-add call start notices 2021-11-02 15:46:31 +02:00
Tulir Asokan
7218f9ad76 Adjust logic for adding members in backfill 2021-11-02 12:28:53 +02:00
Tulir Asokan
9994a04f79 Allow redacting through relaybot. Fixes #298 2021-11-01 16:46:03 +02:00