Update whatsmeow

This commit is contained in:
Tulir Asokan 2022-07-30 11:30:44 +03:00
parent 2a44a2bf7d
commit 3617b991c8
5 changed files with 17 additions and 18 deletions

View File

@ -22,9 +22,10 @@ import (
"fmt"
"time"
waProto "go.mau.fi/whatsmeow/binary/proto"
"google.golang.org/protobuf/proto"
waProto "go.mau.fi/whatsmeow/binary/proto"
_ "github.com/mattn/go-sqlite3"
log "maunium.net/go/maulogger/v2"
@ -48,8 +49,8 @@ type HistorySyncConversation struct {
MuteEndTime time.Time
Archived bool
Pinned uint32
DisappearingMode waProto.DisappearingMode_DisappearingModeInitiator
EndOfHistoryTransferType waProto.Conversation_ConversationEndOfHistoryTransferType
DisappearingMode waProto.DisappearingMode_Initiator
EndOfHistoryTransferType waProto.Conversation_EndOfHistoryTransferType
EphemeralExpiration *uint32
MarkedAsUnread bool
UnreadCount uint32
@ -71,8 +72,8 @@ func (hsq *HistorySyncQuery) NewConversationWithValues(
muteEndTime uint64,
archived bool,
pinned uint32,
disappearingMode waProto.DisappearingMode_DisappearingModeInitiator,
endOfHistoryTransferType waProto.Conversation_ConversationEndOfHistoryTransferType,
disappearingMode waProto.DisappearingMode_Initiator,
endOfHistoryTransferType waProto.Conversation_EndOfHistoryTransferType,
ephemeralExpiration *uint32,
markedAsUnread bool,
unreadCount uint32) *HistorySyncConversation {

2
go.mod
View File

@ -10,7 +10,7 @@ require (
github.com/prometheus/client_golang v1.12.2-0.20220613221938-ebd77f036066
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/tidwall/gjson v1.14.1
go.mau.fi/whatsmeow v0.0.0-20220715134127-5e6b9804193a
go.mau.fi/whatsmeow v0.0.0-20220730081540-aaaedc8d029a
golang.org/x/image v0.0.0-20220617043117-41969df76e82
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e
google.golang.org/protobuf v1.28.0

6
go.sum
View File

@ -64,10 +64,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-20220628090436-4d18b66b087e h1:ByHDg+D+dMIGuBA2n+1xOUf4xr3FJFYg8yxl06s1YBE=
go.mau.fi/libsignal v0.0.0-20220628090436-4d18b66b087e/go.mod h1:RCdzkTWSJv0AKGqurzPXJsEGIVMuQps3E/h7CMUPous=
go.mau.fi/whatsmeow v0.0.0-20220711111122-6340068d67de h1:ZrxHSdpUGODtCtq/0A6CXisEgWtcNwK6BGG4f+WVTlM=
go.mau.fi/whatsmeow v0.0.0-20220711111122-6340068d67de/go.mod h1:hsjqq2xLuoFew8vbsDCJcGf5EbXCRcR/yoQ+87w6m3k=
go.mau.fi/whatsmeow v0.0.0-20220715134127-5e6b9804193a h1:Ki4Y9d+qW/ED+7gsQ26AlQxUUyZOQ9bQEiVyjTWRmCQ=
go.mau.fi/whatsmeow v0.0.0-20220715134127-5e6b9804193a/go.mod h1:hsjqq2xLuoFew8vbsDCJcGf5EbXCRcR/yoQ+87w6m3k=
go.mau.fi/whatsmeow v0.0.0-20220730081540-aaaedc8d029a h1:qcvm6PdqfmNmO/Kg2BFqFCt5tNZa4acptVebNVyq6i4=
go.mau.fi/whatsmeow v0.0.0-20220730081540-aaaedc8d029a/go.mod h1:hsjqq2xLuoFew8vbsDCJcGf5EbXCRcR/yoQ+87w6m3k=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d h1:sK3txAijHtOK88l68nt020reeT1ZdKLIYetKl95FzVY=
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/image v0.0.0-20220617043117-41969df76e82 h1:KpZB5pUSBvrHltNEdK/tw0xlPeD13M6M6aGP32gKqiw=

View File

@ -119,9 +119,9 @@ func (br *WABridge) Init() {
store.DeviceProps.Version.Secondary = proto.Uint32(uint32(secondary))
store.DeviceProps.Version.Tertiary = proto.Uint32(uint32(tertiary))
}
platformID, ok := waProto.DeviceProps_DevicePropsPlatformType_value[strings.ToUpper(br.Config.WhatsApp.BrowserName)]
platformID, ok := waProto.DeviceProps_PlatformType_value[strings.ToUpper(br.Config.WhatsApp.BrowserName)]
if ok {
store.DeviceProps.PlatformType = waProto.DeviceProps_DevicePropsPlatformType(platformID).Enum()
store.DeviceProps.PlatformType = waProto.DeviceProps_PlatformType(platformID).Enum()
}
}

View File

@ -1823,15 +1823,15 @@ func (portal *Portal) convertTemplateMessage(intent *appservice.IntentAPI, sourc
var convertedTitle *ConvertedMessage
switch title := tpl.GetTitle().(type) {
case *waProto.HydratedFourRowTemplate_DocumentMessage:
case *waProto.TemplateMessage_HydratedFourRowTemplate_DocumentMessage:
convertedTitle = portal.convertMediaMessage(intent, source, info, title.DocumentMessage, "file attachment", false)
case *waProto.HydratedFourRowTemplate_ImageMessage:
case *waProto.TemplateMessage_HydratedFourRowTemplate_ImageMessage:
convertedTitle = portal.convertMediaMessage(intent, source, info, title.ImageMessage, "photo", false)
case *waProto.HydratedFourRowTemplate_VideoMessage:
case *waProto.TemplateMessage_HydratedFourRowTemplate_VideoMessage:
convertedTitle = portal.convertMediaMessage(intent, source, info, title.VideoMessage, "video attachment", false)
case *waProto.HydratedFourRowTemplate_LocationMessage:
case *waProto.TemplateMessage_HydratedFourRowTemplate_LocationMessage:
content = fmt.Sprintf("Unsupported location message\n\n%s", content)
case *waProto.HydratedFourRowTemplate_HydratedTitleText:
case *waProto.TemplateMessage_HydratedFourRowTemplate_HydratedTitleText:
content = fmt.Sprintf("%s\n\n%s", title.HydratedTitleText, content)
}
@ -2646,7 +2646,7 @@ func (portal *Portal) handleMediaRetry(retry *events.MediaRetry, source *User) {
portal.sendMediaRetryFailureEdit(intent, msg, err)
return
} else if retryData.GetResult() != waProto.MediaRetryNotification_SUCCESS {
errorName := waProto.MediaRetryNotification_MediaRetryNotificationResultType_name[int32(retryData.GetResult())]
errorName := waProto.MediaRetryNotification_ResultType_name[int32(retryData.GetResult())]
if retryData.GetDirectPath() == "" {
portal.log.Warnfln("Got error response in media retry notification for %s: %s", retry.MessageID, errorName)
portal.log.Debugfln("Error response contents: %+v", retryData)