Skip to content

Commit

Permalink
update whatsmeow to 20240906 from tulir/whatsmeow@d910a51
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Sep 7, 2024
1 parent c22b581 commit d994d4b
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 69 deletions.
2 changes: 1 addition & 1 deletion lib/common/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

#pragma once

#define NCHAT_VERSION "5.2.9"
#define NCHAT_VERSION "5.2.10"
6 changes: 2 additions & 4 deletions lib/wmchat/go/ext/whatsmeow/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,8 @@ func (cli *Client) parseMessageInfo(node *waBinary.Node) (*types.MessageInfo, er
cli.Log.Warnf("Failed to parse <bot> node in %s: %v", info.ID, err)
}
case "meta":
info.MsgMetaInfo, err = cli.parseMsgMetaInfo(child)
if err != nil {
cli.Log.Warnf("Failed to parse <meta> node in %s: %v", info.ID, err)
}
// TODO parse non-bot metadata too
info.MsgMetaInfo, _ = cli.parseMsgMetaInfo(child)
case "franking":
// TODO
case "trace":
Expand Down
10 changes: 9 additions & 1 deletion lib/wmchat/go/ext/whatsmeow/pair-code.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"fmt"
"regexp"
"strconv"
"strings"

"go.mau.fi/util/random"
"golang.org/x/crypto/curve25519"
Expand Down Expand Up @@ -72,7 +73,9 @@ func generateCompanionEphemeralKey() (ephemeralKeyPair *keys.KeyPair, ephemeralK
// PairPhone generates a pairing code that can be used to link to a phone without scanning a QR code.
//
// You must connect the client normally before calling this (which means you'll also receive a QR code
// event, but that can be ignored when doing code pairing).
// event, but that can be ignored when doing code pairing). You should also wait for `*events.QR` before
// calling this to ensure the connection is fully established. If using [Client.GetQRChannel], wait for
// the first item in the channel. Alternatively, sleeping for a second after calling Connect will probably work too.
//
// The exact expiry of pairing codes is unknown, but QR codes are always generated and the login websocket is closed
// after the QR codes run out, which means there's a 160-second time limit. It is recommended to generate the pairing
Expand All @@ -86,6 +89,11 @@ func generateCompanionEphemeralKey() (ephemeralKeyPair *keys.KeyPair, ephemeralK
func (cli *Client) PairPhone(phone string, showPushNotification bool, clientType PairClientType, clientDisplayName string) (string, error) {
ephemeralKeyPair, ephemeralKey, encodedLinkingCode := generateCompanionEphemeralKey()
phone = notNumbers.ReplaceAllString(phone, "")
if len(phone) <= 6 {
return "", fmt.Errorf("phone number too short")
} else if strings.HasPrefix(phone, "0") {
return "", fmt.Errorf("international phone number required (must not start with 0)")
}
jid := types.NewJID(phone, types.DefaultUserServer)
resp, err := cli.sendIQ(infoQuery{
Namespace: "md",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ message DeviceProps {
optional bool supportRecentSyncChunkMessageCountTuning = 10;
optional bool supportHostedGroupMsg = 11;
optional bool supportFbidBotChatHistory = 12;
optional bool supportAddOnHistorySyncMigration = 13;
}

message AppVersion {
Expand Down
113 changes: 73 additions & 40 deletions lib/wmchat/go/ext/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified lib/wmchat/go/ext/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.raw
Binary file not shown.
12 changes: 9 additions & 3 deletions lib/wmchat/go/ext/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum PeerDataOperationRequestType {
FULL_HISTORY_SYNC_ON_DEMAND = 6;
}

enum SessionSource {
enum BotSessionSource {
NULL_STATE = 1;
TYPEAHEAD = 2;
USER_INPUT = 3;
Expand Down Expand Up @@ -491,6 +491,9 @@ message PeerDataOperationRequestResponseMessage {
REQUEST_TIME_EXPIRED = 1;
DECLINED_SHARING_HISTORY = 2;
GENERIC_ERROR = 3;
ERROR_REQUEST_ON_NON_SMB_PRIMARY = 4;
ERROR_HOSTED_DEVICE_NOT_CONNECTED = 5;
ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET = 6;
}

message WaffleNonceFetchResponse {
Expand Down Expand Up @@ -1267,6 +1270,8 @@ message StickerPackMessage {

message AlbumMessage {
optional string caption = 1;
optional uint32 expectedImageCount = 2;
optional uint32 expectedVideoCount = 3;
optional ContextInfo contextInfo = 17;
}

Expand Down Expand Up @@ -1718,7 +1723,7 @@ message BotSuggestedPromptMetadata {

message BotSessionMetadata {
optional string sessionID = 1;
optional SessionSource sessionSource = 2;
optional BotSessionSource sessionSource = 2;
}

message BotMemuMetadata {
Expand All @@ -1731,11 +1736,12 @@ message BotMetadata {
optional BotPluginMetadata pluginMetadata = 3;
optional BotSuggestedPromptMetadata suggestedPromptMetadata = 4;
optional string invokerJID = 5;
optional BotSessionMetadata searchMetadata = 6;
optional BotSessionMetadata sessionMetadata = 6;
optional BotMemuMetadata memuMetadata = 7;
optional string timezone = 8;
optional BotReminderMetadata reminderMetadata = 9;
optional BotModelMetadata modelMetadata = 10;
optional string messageDisclaimerText = 11;
}

message DeviceListMetadata {
Expand Down
Loading

0 comments on commit d994d4b

Please sign in to comment.