diff options
author | Wim <wim@42.be> | 2023-01-28 22:57:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 22:57:53 +0100 |
commit | 880586bac42817ffcfea5d9f746f503fa29915b8 (patch) | |
tree | a89374cba6f88975f12316ec8d1b8aa1d4c6ba79 /vendor/go.mau.fi/whatsmeow/msgsecret.go | |
parent | eac2a8c8dc831f946970d327e2a80b26b0684255 (diff) | |
download | matterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.tar.gz matterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.tar.bz2 matterbridge-msglm-880586bac42817ffcfea5d9f746f503fa29915b8.zip |
Update dependencies (#1951)
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/msgsecret.go')
-rw-r--r-- | vendor/go.mau.fi/whatsmeow/msgsecret.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/msgsecret.go b/vendor/go.mau.fi/whatsmeow/msgsecret.go index 75e9b271..a4cbb17b 100644 --- a/vendor/go.mau.fi/whatsmeow/msgsecret.go +++ b/vendor/go.mau.fi/whatsmeow/msgsecret.go @@ -94,7 +94,10 @@ func (cli *Client) decryptMsgSecret(msg *events.Message, useCase MsgSecretType, } func (cli *Client) encryptMsgSecret(chat, origSender types.JID, origMsgID types.MessageID, useCase MsgSecretType, plaintext []byte) (ciphertext, iv []byte, err error) { - ownID := *cli.Store.ID + ownID := cli.getOwnID() + if ownID.IsEmpty() { + return nil, nil, ErrNotLoggedIn + } baseEncKey, err := cli.Store.MsgSecrets.GetMessageSecret(chat, origSender, origMsgID) if err != nil { @@ -208,7 +211,7 @@ func HashPollOptions(optionNames []string) [][]byte { // fmt.Println(":(", err) // return // } -// resp, err := cli.SendMessage(context.Background(), evt.Info.Chat, "", pollVoteMsg) +// resp, err := cli.SendMessage(context.Background(), evt.Info.Chat, pollVoteMsg) // } func (cli *Client) BuildPollVote(pollInfo *types.MessageInfo, optionNames []string) (*waProto.Message, error) { pollUpdate, err := cli.EncryptPollVote(pollInfo, &waProto.PollVoteMessage{ @@ -220,7 +223,7 @@ func (cli *Client) BuildPollVote(pollInfo *types.MessageInfo, optionNames []stri // BuildPollCreation builds a poll creation message with the given poll name, options and maximum number of selections. // The built message can be sent normally using Client.SendMessage. // -// resp, err := cli.SendMessage(context.Background(), chat, "", cli.BuildPollCreation("meow?", []string{"yes", "no"}, 1)) +// resp, err := cli.SendMessage(context.Background(), chat, cli.BuildPollCreation("meow?", []string{"yes", "no"}, 1)) func (cli *Client) BuildPollCreation(name string, optionNames []string, selectableOptionCount int) *waProto.Message { msgSecret := make([]byte, 32) _, err := rand.Read(msgSecret) |