Skip to content

Commit 05ca367

Browse files
authored
Merge branch 'main' into rnons/bri-33277
2 parents f5971eb + 9482665 commit 05ca367

File tree

13 files changed

+94
-70
lines changed

13 files changed

+94
-70
lines changed

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
# v0.12.5 (unreleased)
1+
# v0.12.5 (2025-09-16)
22

33
* Removed legacy provisioning API and database legacy migration.
44
Upgrading directly from versions prior to v0.11.0 is not supported.
55
* If you've been using the bridge since before v0.11.0 and have prevented the
66
bridge from writing to the config, you must either update the config
77
manually or allow the bridge to update it for you **before** upgrading to
8-
this release.
8+
this release (i.e. run v0.12.4 once with config writing allowed).
9+
* Added support for changing group name/topic/avatar from Matrix
10+
(thanks to [@Petersmit27] in [#834]).
11+
* Added `RedactedPhone` placeholder for displayname templates. This allows
12+
community announcement groups (where you can't see participants phone numbers)
13+
to have better names than random numbers.
914
* Added support for `com.beeper.disappearing_timer` state event, which stores
1015
the disappearing setting of chats and allows changing the setting from Matrix.
1116
* Added lottieconverter to Docker images to enable converting animated stickers
1217
from WhatsApp.
18+
* Added support for creating WhatsApp groups.
1319
* Fixed sent PNGs not being rendered on WhatsApp iOS.
1420

21+
[@Petersmit27]: https://github.com/Petersmit27
22+
[#834]: https://github.com/mautrix/whatsapp/pull/834
23+
1524
# v0.12.4 (2025-08-16)
1625

1726
* Deprecated legacy provisioning API. The `/_matrix/provision/v1` endpoints will

cmd/mautrix-whatsapp/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var m = mxmain.BridgeMain{
1818
Name: "mautrix-whatsapp",
1919
URL: "https://github.com/mautrix/whatsapp",
2020
Description: "A Matrix-WhatsApp puppeting bridge.",
21-
Version: "0.12.4",
21+
Version: "0.12.5",
2222
Connector: &connector.WhatsAppConnector{},
2323
}
2424

go.mod

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ module go.mau.fi/mautrix-whatsapp
22

33
go 1.24.0
44

5-
toolchain go1.25.0
5+
toolchain go1.25.1
66

77
require (
88
github.com/lib/pq v1.10.9
99
github.com/rs/zerolog v1.34.0
10-
go.mau.fi/util v0.9.1-0.20250912114103-419604f95907
10+
go.mau.fi/util v0.9.1
1111
go.mau.fi/webp v0.2.0
12-
go.mau.fi/whatsmeow v0.0.0-20250915160606-03f180026b8f
13-
golang.org/x/image v0.30.0
14-
golang.org/x/net v0.43.0
15-
golang.org/x/sync v0.16.0
16-
google.golang.org/protobuf v1.36.7
12+
go.mau.fi/whatsmeow v0.0.0-20250919124702-c8bdfd36d05e
13+
golang.org/x/image v0.31.0
14+
golang.org/x/net v0.44.0
15+
golang.org/x/sync v0.17.0
16+
google.golang.org/protobuf v1.36.9
1717
gopkg.in/yaml.v3 v3.0.1
18-
maunium.net/go/mautrix v0.25.1-0.20250911181014-4603a344ce1d
18+
maunium.net/go/mautrix v0.25.2-0.20250924172949-cf29b07f32ce
1919
)
2020

2121
require (
2222
filippo.io/edwards25519 v1.1.0 // indirect
2323
github.com/beeper/argo-go v1.1.2 // indirect
24-
github.com/coder/websocket v1.8.13 // indirect
24+
github.com/coder/websocket v1.8.14 // indirect
2525
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
2626
github.com/elliotchance/orderedmap/v3 v3.1.0 // indirect
2727
github.com/google/uuid v1.6.0 // indirect
@@ -30,7 +30,7 @@ require (
3030
github.com/mattn/go-colorable v0.1.14 // indirect
3131
github.com/mattn/go-isatty v0.0.20 // indirect
3232
github.com/mattn/go-sqlite3 v1.14.32 // indirect
33-
github.com/petermattis/goid v0.0.0-20250813065127-a731cc31b4fe // indirect
33+
github.com/petermattis/goid v0.0.0-20250904145737-900bdf8bb490 // indirect
3434
github.com/rogpeppe/go-internal v1.10.0 // indirect
3535
github.com/rs/xid v1.6.0 // indirect
3636
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
@@ -42,10 +42,10 @@ require (
4242
github.com/yuin/goldmark v1.7.13 // indirect
4343
go.mau.fi/libsignal v0.2.0 // indirect
4444
go.mau.fi/zeroconfig v0.2.0 // indirect
45-
golang.org/x/crypto v0.41.0 // indirect
46-
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b // indirect
47-
golang.org/x/sys v0.35.0 // indirect
48-
golang.org/x/text v0.28.0 // indirect
45+
golang.org/x/crypto v0.42.0 // indirect
46+
golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
47+
golang.org/x/sys v0.36.0 // indirect
48+
golang.org/x/text v0.29.0 // indirect
4949
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
5050
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
5151
maunium.net/go/mauflag v1.0.0 // indirect

go.sum

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNg
88
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
99
github.com/beeper/argo-go v1.1.2 h1:UQI2G8F+NLfGTOmTUI0254pGKx/HUU/etbUGTJv91Fs=
1010
github.com/beeper/argo-go v1.1.2/go.mod h1:M+LJAnyowKVQ6Rdj6XYGEn+qcVFkb3R/MUpqkGR0hM4=
11-
github.com/coder/websocket v1.8.13 h1:f3QZdXy7uGVz+4uCJy2nTZyM0yTBj8yANEHhqlXZ9FE=
12-
github.com/coder/websocket v1.8.13/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
11+
github.com/coder/websocket v1.8.14 h1:9L0p0iKiNOibykf283eHkKUHHrpG7f65OE3BhhO7v9g=
12+
github.com/coder/websocket v1.8.14/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg=
1313
github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs=
1414
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
1515
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
@@ -42,8 +42,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
4242
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
4343
github.com/mattn/go-sqlite3 v1.14.32 h1:JD12Ag3oLy1zQA+BNn74xRgaBbdhbNIDYvQUEuuErjs=
4444
github.com/mattn/go-sqlite3 v1.14.32/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
45-
github.com/petermattis/goid v0.0.0-20250813065127-a731cc31b4fe h1:vHpqOnPlnkba8iSxU4j/CvDSS9J4+F4473esQsYLGoE=
46-
github.com/petermattis/goid v0.0.0-20250813065127-a731cc31b4fe/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
45+
github.com/petermattis/goid v0.0.0-20250904145737-900bdf8bb490 h1:QTvNkZ5ylY0PGgA+Lih+GdboMLY/G9SEGLMEGVjTVA4=
46+
github.com/petermattis/goid v0.0.0-20250904145737-900bdf8bb490/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
4747
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
4848
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
4949
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -59,8 +59,8 @@ github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
5959
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
6060
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
6161
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
62-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
63-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
62+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
63+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
6464
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
6565
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
6666
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
@@ -77,33 +77,33 @@ github.com/yuin/goldmark v1.7.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA=
7777
github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
7878
go.mau.fi/libsignal v0.2.0 h1:oRXj3OHhEJq51BFEM8/50UZblmWiTYH93hsNTPcbk90=
7979
go.mau.fi/libsignal v0.2.0/go.mod h1:tvjoDsMejgT38CXTXwqaYu8itBiY8O2Mb6biWvZBb9k=
80-
go.mau.fi/util v0.9.1-0.20250912114103-419604f95907 h1:VBApThdwZPIaNKt2sdfTk2Pal2Qqcaokjpq9e/LkVmg=
81-
go.mau.fi/util v0.9.1-0.20250912114103-419604f95907/go.mod h1:pdL3lg2aaeeHIreGXNnPwhJPXkXdc3ZxsI6le8hOWEA=
80+
go.mau.fi/util v0.9.1 h1:A+XKHRsjKkFi2qOm4RriR1HqY2hoOXNS3WFHaC89r2Y=
81+
go.mau.fi/util v0.9.1/go.mod h1:M0bM9SyaOWJniaHs9hxEzz91r5ql6gYq6o1q5O1SsjQ=
8282
go.mau.fi/webp v0.2.0 h1:QVMenHw7JDb4vall5sV75JNBQj9Hw4u8AKbi1QetHvg=
8383
go.mau.fi/webp v0.2.0/go.mod h1:VSg9MyODn12Mb5pyG0NIyNFhujrmoFSsZBs8syOZD1Q=
84-
go.mau.fi/whatsmeow v0.0.0-20250915160606-03f180026b8f h1:bXMRrrVw+W5dyOkqxn8Q1tIitH97Oe9S5AoVMlcQavQ=
85-
go.mau.fi/whatsmeow v0.0.0-20250915160606-03f180026b8f/go.mod h1:HSrGXWxbQ7nIBbLfl4d1XB/qGtEs7GXrQMjfnGLeymM=
84+
go.mau.fi/whatsmeow v0.0.0-20250919124702-c8bdfd36d05e h1:+o9+K5Qyo/490H4NyPVA0Es+aEzmmjaK37/437hV2LM=
85+
go.mau.fi/whatsmeow v0.0.0-20250919124702-c8bdfd36d05e/go.mod h1:dvltpCF0rOHbbur25DHbQ3Ovi747z2Pm11S2M7p1T74=
8686
go.mau.fi/zeroconfig v0.2.0 h1:e/OGEERqVRRKlgaro7E6bh8xXiKFSXB3eNNIud7FUjU=
8787
go.mau.fi/zeroconfig v0.2.0/go.mod h1:J0Vn0prHNOm493oZoQ84kq83ZaNCYZnq+noI1b1eN8w=
88-
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
89-
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
90-
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b h1:DXr+pvt3nC887026GRP39Ej11UATqWDmWuS99x26cD0=
91-
golang.org/x/exp v0.0.0-20250819193227-8b4c13bb791b/go.mod h1:4QTo5u+SEIbbKW1RacMZq1YEfOBqeXa19JeshGi+zc4=
92-
golang.org/x/image v0.30.0 h1:jD5RhkmVAnjqaCUXfbGBrn3lpxbknfN9w2UhHHU+5B4=
93-
golang.org/x/image v0.30.0/go.mod h1:SAEUTxCCMWSrJcCy/4HwavEsfZZJlYxeHLc6tTiAe/c=
94-
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
95-
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
96-
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
97-
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
88+
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
89+
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
90+
golang.org/x/exp v0.0.0-20250911091902-df9299821621 h1:2id6c1/gto0kaHYyrixvknJ8tUK/Qs5IsmBtrc+FtgU=
91+
golang.org/x/exp v0.0.0-20250911091902-df9299821621/go.mod h1:TwQYMMnGpvZyc+JpB/UAuTNIsVJifOlSkrZkhcvpVUk=
92+
golang.org/x/image v0.31.0 h1:mLChjE2MV6g1S7oqbXC0/UcKijjm5fnJLUYKIYrLESA=
93+
golang.org/x/image v0.31.0/go.mod h1:R9ec5Lcp96v9FTF+ajwaH3uGxPH4fKfHHAVbUILxghA=
94+
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
95+
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
96+
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
97+
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
9898
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
9999
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
100100
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
101-
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
102-
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
103-
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
104-
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
105-
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
106-
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
101+
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
102+
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
103+
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
104+
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
105+
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
106+
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
107107
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
108108
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
109109
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -113,5 +113,5 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
113113
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
114114
maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M=
115115
maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA=
116-
maunium.net/go/mautrix v0.25.1-0.20250911181014-4603a344ce1d h1:jKAn+2wwFC3aLdgE7IBSxhVjB4JisBOz2oCLzj928+c=
117-
maunium.net/go/mautrix v0.25.1-0.20250911181014-4603a344ce1d/go.mod h1:pDd6Ppg+1PbWrw/rg4ZQQfVYZICRGzH+DcliZ/BODvU=
116+
maunium.net/go/mautrix v0.25.2-0.20250924172949-cf29b07f32ce h1:sRBScG2xa66ERjgrX+7D//HorAhmNHwxB2Kzltg+aUg=
117+
maunium.net/go/mautrix v0.25.2-0.20250924172949-cf29b07f32ce/go.mod h1:iSueLJ/2fBaNrsTObGqi1j0cl/loxrtAjmjay1scYD8=

pkg/connector/backfill.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ func (wa *WhatsAppClient) convertHistorySyncMessage(
528528
// TODO use proper intent
529529
intent := wa.Main.Bridge.Bot
530530
wrapped := &bridgev2.BackfillMessage{
531-
ConvertedMessage: wa.Main.MsgConv.ToMatrix(ctx, portal, wa.Client, intent, msg, rawMsg, info, isViewOnce, nil),
531+
ConvertedMessage: wa.Main.MsgConv.ToMatrix(ctx, portal, wa.Client, intent, msg, rawMsg, info, isViewOnce, true, nil),
532532
Sender: wa.makeEventSender(ctx, info.Sender),
533533
ID: waid.MakeMessageID(info.Chat, info.Sender, info.ID),
534534
TxnID: networkid.TransactionID(waid.MakeMessageID(info.Chat, info.Sender, info.ID)),

pkg/connector/capabilities.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
var WhatsAppGeneralCaps = &bridgev2.NetworkGeneralCapabilities{
1717
DisappearingMessages: true,
1818
AggressiveUpdateInfo: true,
19+
ImplicitReadReceipts: true,
1920
Provisioning: bridgev2.ProvisioningCapabilities{
2021
ResolveIdentifier: bridgev2.ResolveIdentifierCapabilities{
2122
CreateDM: true,

pkg/connector/chatinfo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (wa *WhatsAppClient) addExtrasToWrapped(ctx context.Context, portalJID type
7575

7676
func updatePortalLastSyncAt(_ context.Context, portal *bridgev2.Portal) bool {
7777
meta := portal.Metadata.(*waid.PortalMetadata)
78-
forceSave := time.Since(meta.LastSync.Time) > 24*time.Hour
78+
forceSave := ResyncMinInterval < 24*time.Hour || time.Since(meta.LastSync.Time) > 24*time.Hour
7979
meta.LastSync = jsontime.UnixNow()
8080
return forceSave
8181
}

pkg/connector/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func (wa *WhatsAppClient) HandleMatrixViewingChat(ctx context.Context, msg *brid
423423
// Reset, but don't save, portal last sync time for immediate sync now
424424
msg.Portal.Metadata.(*waid.PortalMetadata).LastSync.Time = time.Time{}
425425
// Enqueue for the sync, don't block on it completing
426-
wa.EnqueuePortalResync(msg.Portal)
426+
wa.EnqueuePortalResync(msg.Portal, true)
427427

428428
if msg.Portal.OtherUserID != "" {
429429
// If this is a DM, also sync the ghost of the other user immediately

pkg/connector/events.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (evt *WAMessageEvent) ConvertEdit(ctx context.Context, portal *bridgev2.Por
188188

189189
ctx = context.WithValue(ctx, msgconv.ContextKeyEditTargetID, evt.Message.GetProtocolMessage().GetKey().GetID())
190190
cm := evt.wa.Main.MsgConv.ToMatrix(
191-
ctx, portal, evt.wa.Client, intent, editedMsg, evt.MsgEvent.RawMessage, &evt.Info, evt.isViewOnce(), previouslyConvertedPart,
191+
ctx, portal, evt.wa.Client, intent, editedMsg, evt.MsgEvent.RawMessage, &evt.Info, evt.isViewOnce(), false, previouslyConvertedPart,
192192
)
193193
if evt.isUndecryptableUpsertSubEvent && isFailedMedia(cm) {
194194
evt.postHandle = func() {
@@ -263,9 +263,9 @@ func (evt *WAMessageEvent) HandleExisting(ctx context.Context, portal *bridgev2.
263263
}
264264

265265
func (evt *WAMessageEvent) ConvertMessage(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI) (*bridgev2.ConvertedMessage, error) {
266-
evt.wa.EnqueuePortalResync(portal)
266+
evt.wa.EnqueuePortalResync(portal, false)
267267
converted := evt.wa.Main.MsgConv.ToMatrix(
268-
ctx, portal, evt.wa.Client, intent, evt.Message, evt.MsgEvent.RawMessage, &evt.Info, evt.isViewOnce(), nil,
268+
ctx, portal, evt.wa.Client, intent, evt.Message, evt.MsgEvent.RawMessage, &evt.Info, evt.isViewOnce(), false, nil,
269269
)
270270
if isFailedMedia(converted) {
271271
evt.postHandle = func() {

pkg/connector/handlewhatsapp.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func (wa *WhatsAppClient) handleWAEvent(rawEvt any) (success bool) {
8888
success = wa.handleWAUndecryptableMessage(ctx, evt)
8989

9090
case *events.CallOffer:
91-
success = wa.handleWACallStart(ctx, evt.GroupJID, evt.CallCreator, evt.CallID, "", evt.Timestamp)
91+
success = wa.handleWACallStart(ctx, evt.GroupJID, evt.CallCreator, evt.CallCreatorAlt, evt.CallID, "", evt.Timestamp)
9292
case *events.CallOfferNotice:
93-
success = wa.handleWACallStart(ctx, evt.GroupJID, evt.CallCreator, evt.CallID, evt.Type, evt.Timestamp)
93+
success = wa.handleWACallStart(ctx, evt.GroupJID, evt.CallCreator, evt.CallCreatorAlt, evt.CallID, evt.Type, evt.Timestamp)
9494
case *events.CallTerminate, *events.CallRelayLatency, *events.CallAccept, *events.UnknownCallEvent:
9595
// ignore
9696
case *events.IdentityChange:
@@ -486,10 +486,18 @@ func (wa *WhatsAppClient) handleWALogout(reason events.ConnectFailureReason, onC
486486

487487
const callEventMaxAge = 15 * time.Minute
488488

489-
func (wa *WhatsAppClient) handleWACallStart(ctx context.Context, group, sender types.JID, id, callType string, ts time.Time) bool {
489+
func (wa *WhatsAppClient) handleWACallStart(ctx context.Context, group, sender, senderAlt types.JID, id, callType string, ts time.Time) bool {
490490
if !wa.Main.Config.CallStartNotices || time.Since(ts) > callEventMaxAge {
491491
return true
492492
}
493+
if sender.Server == types.HiddenUserServer && senderAlt.Server == types.DefaultUserServer {
494+
wa.UserLogin.Log.Debug().
495+
Stringer("lid", sender).
496+
Stringer("pn", senderAlt).
497+
Str("call_id", id).
498+
Msg("Forced LID caller to phone number in incoming call")
499+
sender, senderAlt = senderAlt, sender
500+
}
493501
chat := group
494502
if chat.IsEmpty() {
495503
chat = sender

0 commit comments

Comments
 (0)