Skip to content

Commit 0e46b89

Browse files
purpshelldevlikepro
authored andcommitted
[WAHA] send: add support for patching - additional nodes
From tulir#886
1 parent 20ea655 commit 0e46b89

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

send.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ type SendRequestExtra struct {
152152

153153
// When sending status message you can specify the recipients
154154
Participants []types.JID
155+
// use this only if you know what you are doing
156+
AdditionalNodes *[]waBinary.Node
155157
}
156158

157159
// SendMessage sends the given message.
@@ -333,6 +335,10 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
333335
}
334336
}
335337

338+
if req.AdditionalNodes != nil {
339+
extraParams.additionalNodes = req.AdditionalNodes
340+
}
341+
336342
resp.Sender = ownID
337343

338344
start := time.Now()
@@ -679,9 +685,10 @@ func (cli *Client) sendNewsletter(
679685
}
680686

681687
type nodeExtraParams struct {
682-
botNode *waBinary.Node
683-
metaNode *waBinary.Node
684-
addressingMode types.AddressingMode
688+
botNode *waBinary.Node
689+
metaNode *waBinary.Node
690+
additionalNodes *[]waBinary.Node
691+
addressingMode types.AddressingMode
685692
}
686693

687694
func (cli *Client) sendGroup(
@@ -1053,6 +1060,9 @@ func (cli *Client) getMessageContent(
10531060
if extraParams.metaNode != nil {
10541061
content = append(content, *extraParams.metaNode)
10551062
}
1063+
if extraParams.additionalNodes != nil {
1064+
content = append(content, *extraParams.additionalNodes...)
1065+
}
10561066

10571067
if buttonType := getButtonTypeFromMessage(message); buttonType != "" {
10581068
content = append(content, waBinary.Node{

0 commit comments

Comments
 (0)