Commit graph

316 commits

Author SHA1 Message Date
Tulir Asokan 79fb0d49b3 Move bridge state stuff to mautrix-go 2022-05-31 00:27:44 +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
Sumner Evans ec8f75e50e
backfill: add option to mark unread using account data 2022-05-18 10:40:29 -06:00
Tulir Asokan e062ddc51a Include obfuscated phone number in retry receipt metrics 2022-05-17 19:30:46 +03:00
Tulir Asokan 6634f004ed Include message ID in not found retry receipts 2022-05-17 17:35:29 +03:00
Tulir Asokan 46ba3981c1 Add Segment events for retry receipts and undecryptable messages 2022-05-16 13:49:43 +03:00
Tulir Asokan 3ee7c8527a Send a valid request when doing hacky phone pings 2022-05-16 11:22:41 +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 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
Tulir Asokan 8ff1896b18 Update whatsmeow and add bridge state events for keepalive timeouts 2022-05-11 14:04:59 +03:00
Tulir Asokan 625e110aab Improve logging when phone is seen again 2022-05-04 11:17:34 +03:00
Tulir Asokan 7c579ad972 Update whatsmeow for new xml-not-well-formed debugging 2022-05-03 15:35:02 +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 4bc4e92877 Remove media backfill queue and just request immediately 2022-05-02 15:00:57 +03:00
Tulir Asokan 4b22e786f5 Make signal store retry if postgres dies 2022-04-29 19:38:44 +03:00
Tulir Asokan 66f505303d Update 403 error message
Apparently it happens when switching phones, not only when banned
2022-04-28 20:09:44 +03:00
Tulir Asokan 54ad27f644 Add separate config option for status broadcast room tag 2022-04-27 12:46:11 +03:00
Sumner Evans 5aee338561
Merge pull request #481 from mautrix/fix-backfill-priority-again
backfill: fix priority of backfills again
2022-04-25 08:42:43 -06:00
Tulir Asokan ea3bcec1cf Add option to maybe detect xml-not-well-formed errors 2022-04-25 17:21:43 +03: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
Tulir Asokan 82472a76df Add queue for bridge state updates 2022-04-22 13:26:37 +03:00
Tulir Asokan a99ced14fd Send bridge state if connection fails 2022-04-20 13:50:06 +03:00
Sumner Evans 1035956e4c
history sync: only start after the user is connected 2022-04-19 12:02:50 -06: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
Tulir Asokan 7f2d12aa5f Update mautrix-go to switch to /v3 paths 2022-04-17 13:09:54 +03:00
Sumner Evans 78c6d57299
historysync: only save when backfill is enabled 2022-04-06 09:00:48 -06:00
Sumner Evans c664e5f107
Updates from CR
Co-authored-by: Tulir Asokan <tulir@maunium.net>
2022-04-06 08:56:58 -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
Sumner Evans 12a23e2ca5
historysync: refactor to utilize backfill queue
Also sends the `m.room.marker` event when a backfill stage is complete.
2022-03-29 19:26:11 -06:00
Tulir Asokan 73241b6f21 Add proper bridge state errors for different logout types 2022-03-15 16:04:10 +02:00
Tulir Asokan 7322f78d56 Delete connection and update JID map on remote logout 2022-03-10 22:21:24 +02:00
Tulir Asokan dcfa9e1b34 Update hacky workaround for transient disconnect states
The previous version didn't handle the case where the reconnect is what
triggers the `wa-phone-offline` state in the first place.
2022-03-08 12:51:26 +02:00
Tulir Asokan 9b6ca8d6f1 Don't send normal transient disconnect state when phone is offline 2022-03-07 22:45:19 +02:00
Tulir Asokan 1eb210c249 Add support for bridging reactions 2022-03-05 21:22:31 +02:00
Tulir Asokan 8e5442300c Add endpoints to list groups and open group portals 2022-03-01 20:25:46 +02:00
Tulir Asokan f36b4c18f2 Add config option for always sending active delivery receipts 2022-02-25 01:27:24 +02:00
Tulir Asokan be68203056 Always wait for offline sync to finish before sending connected state 2022-02-18 13:18:29 +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 3c274e6d35 Add proper error message for outdated client errors 2022-02-17 15:33:31 +02:00
Tulir Asokan 66d0817081 Add provisioning API endpoints to list contacts and start chats 2022-02-17 15:14:53 +02:00
Tulir Asokan 1a1fd68812 Improve connection error handling 2022-02-17 14:09:40 +02:00
Tulir Asokan 528fbda53f Add initial support for requesting media retries from phone 2022-02-10 19:18:49 +02:00
Tulir Asokan 7e6c645f19 Add some simple metrics for retry receipts 2022-01-28 15:06:19 +02:00
Tulir Asokan e8c77c7ec6 Try to track when the phone is online and warn user if it's offline for too long 2022-01-25 14:26:24 +02: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 1ebfeedcb7 Send fully read marker too when bridging read receipts to Matrix 2022-01-17 22:56:18 +02:00
Tulir Asokan cd29b36a07 Send not logged in bridge status before clearing JID 2022-01-17 16:58:19 +02:00
Tulir Asokan 4a49de388c Update mautrix-go to fix state store not being updated in some cases 2022-01-17 15:44:00 +02:00
Tulir Asokan c4a7943775 Add logs to debug read receipts 2022-01-17 10:38:44 +02:00
Tulir Asokan 7f636e6aef Update whatsmeow to read group disappearing message timer 2022-01-07 15:05:09 +02:00
Tulir Asokan 2ce9947130 Fix double puppet marker in read receipts 2022-01-07 14:38:44 +02:00
Tulir Asokan b63b37177d Make user moderator in personal filtering space 2021-12-30 12:30:29 +02:00
Tulir Asokan 7e5c2769c6 Clean up personal filtering space support 2021-12-29 21:40:08 +02:00
Helder Ferreira dfa845efb4
Fix concurrency issues creating/getting the space 2021-12-29 12:19:16 +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
Helder Ferreira 863c375be0
Init space creation
Co-authored-by: clmnin <clament.john.k@gmail.com>
2021-12-29 08:37:24 +00:00
Tulir Asokan ca5fcc42ba Reroute broadcast list messages to correct DM portal. Fixes #411 2021-12-25 20:50:36 +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 1d8ef6cb89 Add support for MSC2409 2021-12-07 16:02:51 +02:00
Tulir Asokan efd6e1a84f Add support for whatsapp-side read receipt privacy 2021-12-07 15:30:08 +02:00
Tulir Asokan c55cad980d Fix handling read receipts where target is unknown 2021-12-01 14:15:39 +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 231691ebbd Update whatsmeow to maybe fix retry receipts 2021-11-30 15:14:56 +02:00
Tulir Asokan a61ef492cf Fix status broadcast check accidentally muting all chats 2021-11-22 11:03:09 +02:00
Tulir Asokan 0d6af45dcf Fix small mistakes 2021-11-15 14:42:06 +02:00
Tulir Asokan ed58449544 Add option to mute the status broadcast room by default 2021-11-15 14:06:31 +02:00
Tulir Asokan 6b260dceda Fix bridging receipts with multiple message IDs 2021-11-10 20:26:28 +02:00
Tulir Asokan e81b5ae405 Update whatsmeow to handle identity changes in prekey messages 2021-11-09 23:12:10 +02:00
Tulir Asokan cae2b8afa1 Make showing identity change notices configurable 2021-11-09 22:57:36 +02:00
Tulir Asokan a8beec8754 Handle identity changes properly. Fixes #384 2021-11-09 17:49:34 +02:00
Tulir Asokan 01c1648c07 Add sync command 2021-11-08 20:57:04 +02:00
Tulir Asokan 8e25088d8b Don't try to set WA presence before PushName is known 2021-11-08 13:04:54 +02:00
Tulir Asokan f5ae637ffd Resync all puppets after app state sync completes 2021-11-08 13:04:39 +02:00
Tulir Asokan de9977b7d2 Add support for automatic double puppeting from other servers 2021-11-06 13:57:35 +02:00
Tulir Asokan 752aff48f1 Prioritize backfilling recent messages and fix some bugs 2021-11-03 21:34:06 +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 146efa9e94 Ignore old call start events 2021-11-03 10:56:16 +02:00
Tulir Asokan b11a1664dd Sort chats by timestamp when handling history sync 2021-11-02 19:19:11 +02:00
Tulir Asokan 2977994f74 Fix incoming group call text 2021-11-02 15:52:12 +02:00
Tulir Asokan e0d79f2de1 Re-add call start notices 2021-11-02 15:46:31 +02:00
Tulir Asokan 817cd21550 Create all portals before backfilling when handling history syncs 2021-11-02 14:06:21 +02:00
Tulir Asokan 4ac445a868 Fix checking if message contains interesting things 2021-11-01 15:30:56 +02:00
Tulir Asokan a438e1e53d Update whatsmeow 2021-11-01 11:44:25 +02:00
Tulir Asokan 345244fedb Reimplement open command 2021-11-01 11:28:52 +02:00
Sumner Evans 96cf814848
Add option to disable federation on portal rooms (#362) 2021-11-01 11:17:44 +02:00
Tulir Asokan 1e5d5c1a3e Implement joining groups and checking invite links 2021-10-31 19:59:30 +02:00
Tulir Asokan e3aed76f7a Add option to limit age of chats to create portals for 2021-10-30 21:54:35 +03:00
Tulir Asokan c6ff126151 Add some logs for history sync handling 2021-10-29 22:07:40 +03:00
Tulir Asokan 745dd1cd63 Fix incorrect bridge state after logging out 2021-10-29 22:03:00 +03:00
Tulir Asokan 3d384a6db7 Clean up and fix some things 2021-10-29 16:50:29 +03:00
Tulir Asokan b2e6a614b9 Update delete-all-portals and remove commented code 2021-10-28 14:27:59 +03:00
Tulir Asokan b1baa0a0a1 Rename relay permission level 2021-10-28 14:03:55 +03:00
Tulir Asokan bb9a0f6528 Make relay mode more like the Signal bridge 2021-10-28 13:57:15 +03:00
Tulir Asokan 149e9bc8af Implement WhatsApp->Matrix group info updates 2021-10-28 12:59:22 +03:00
Tulir Asokan 92c9ec6203 Remove some commented code and add note about future code to remove 2021-10-27 19:48:14 +03:00
Tulir Asokan 2cd6713cc4 Add typing notification bridging in both directions 2021-10-27 19:30:34 +03:00