Skip to content

Commit

Permalink
Add mdtest command for sending raw node
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Oct 13, 2023
1 parent 336e561 commit 790c7ce
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mdtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ func handleCmd(cmd string, args []string) {
} else {
log.Infof("Media connection: %+v", conn)
}
case "raw":
var node waBinary.Node
if err := json.Unmarshal([]byte(strings.Join(args, " ")), &node); err != nil {
log.Errorf("Failed to parse args as JSON into XML node: %v", err)
} else if err = cli.DangerousInternals().SendNode(node); err != nil {
log.Errorf("Error sending node: %v", err)
} else {
log.Infof("Node sent")
}
case "getavatar":
if len(args) < 1 {
log.Errorf("Usage: getavatar <jid> [existing ID] [--preview] [--community]")
Expand Down

0 comments on commit 790c7ce

Please sign in to comment.