From d1698b0e9afb45d47e62e441e2569d0cb7419944 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 24 May 2022 00:08:28 +0300 Subject: [PATCH] Update whatsmeow --- go.mod | 2 +- go.sum | 4 ++-- main.go | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index eb63bf0..7fb97c2 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/prometheus/client_golang v1.12.2-0.20220514081015-5d584e2717ef github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/tidwall/gjson v1.14.1 - go.mau.fi/whatsmeow v0.0.0-20220519090423-468ee95de7e7 + go.mau.fi/whatsmeow v0.0.0-20220523210036-5bdf3d4640af golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 golang.org/x/net v0.0.0-20220513224357-95641704303c google.golang.org/protobuf v1.28.0 diff --git a/go.sum b/go.sum index 1cdf4ab..939cdef 100644 --- a/go.sum +++ b/go.sum @@ -62,8 +62,8 @@ github.com/yuin/goldmark v1.4.12 h1:6hffw6vALvEDqJ19dOJvJKOoAOKe4NDaTqvd2sktGN0= github.com/yuin/goldmark v1.4.12/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.mau.fi/libsignal v0.0.0-20220425070825-c40c839ee6a0 h1:3IQF2bgAyibdo77hTejwuJe4jlypj9QaE4xCQuxrThM= go.mau.fi/libsignal v0.0.0-20220425070825-c40c839ee6a0/go.mod h1:kBOXTvYyDG/q1Ihgvd4J6WenGPh7wtEGvPKF6vmf5ak= -go.mau.fi/whatsmeow v0.0.0-20220519090423-468ee95de7e7 h1:08FioJlQ6/50fAp+hRkTWhDuoBeg1UFt3yrNnsWPKuM= -go.mau.fi/whatsmeow v0.0.0-20220519090423-468ee95de7e7/go.mod h1:iUBgOLNaqShLrR17u0kIiRptIGFH+nbT1tRhaWBEX/c= +go.mau.fi/whatsmeow v0.0.0-20220523210036-5bdf3d4640af h1:8NCovyS9FJRliRnOM89WOLfNVszoa8Hl4K1I+P0mY0w= +go.mau.fi/whatsmeow v0.0.0-20220523210036-5bdf3d4640af/go.mod h1:iUBgOLNaqShLrR17u0kIiRptIGFH+nbT1tRhaWBEX/c= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220513210258-46612604a0f9 h1:NUzdAbFtCJSXU20AOXgeqaUwg8Ypg4MPYmL+d+rsB5c= golang.org/x/crypto v0.0.0-20220513210258-46612604a0f9/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= diff --git a/main.go b/main.go index 444ef14..8e19cf0 100644 --- a/main.go +++ b/main.go @@ -25,12 +25,13 @@ import ( "sync" "time" + "google.golang.org/protobuf/proto" + "go.mau.fi/whatsmeow" waProto "go.mau.fi/whatsmeow/binary/proto" "go.mau.fi/whatsmeow/store" "go.mau.fi/whatsmeow/store/sqlstore" "go.mau.fi/whatsmeow/types" - "google.golang.org/protobuf/proto" "maunium.net/go/mautrix/bridge" "maunium.net/go/mautrix/bridge/commands" @@ -106,20 +107,20 @@ func (br *WABridge) Init() { store.BaseClientPayload.UserAgent.OsVersion = proto.String(br.WAVersion) store.BaseClientPayload.UserAgent.OsBuildNumber = proto.String(br.WAVersion) - store.CompanionProps.Os = proto.String(br.Config.WhatsApp.OSName) - store.CompanionProps.RequireFullSync = proto.Bool(br.Config.Bridge.HistorySync.RequestFullSync) + store.DeviceProps.Os = proto.String(br.Config.WhatsApp.OSName) + store.DeviceProps.RequireFullSync = proto.Bool(br.Config.Bridge.HistorySync.RequestFullSync) versionParts := strings.Split(br.WAVersion, ".") if len(versionParts) > 2 { primary, _ := strconv.Atoi(versionParts[0]) secondary, _ := strconv.Atoi(versionParts[1]) tertiary, _ := strconv.Atoi(versionParts[2]) - store.CompanionProps.Version.Primary = proto.Uint32(uint32(primary)) - store.CompanionProps.Version.Secondary = proto.Uint32(uint32(secondary)) - store.CompanionProps.Version.Tertiary = proto.Uint32(uint32(tertiary)) + store.DeviceProps.Version.Primary = proto.Uint32(uint32(primary)) + store.DeviceProps.Version.Secondary = proto.Uint32(uint32(secondary)) + store.DeviceProps.Version.Tertiary = proto.Uint32(uint32(tertiary)) } platformID, ok := waProto.CompanionProps_CompanionPropsPlatformType_value[strings.ToUpper(br.Config.WhatsApp.BrowserName)] if ok { - store.CompanionProps.PlatformType = waProto.CompanionProps_CompanionPropsPlatformType(platformID).Enum() + store.DeviceProps.PlatformType = waProto.CompanionProps_CompanionPropsPlatformType(platformID).Enum() } }