Skip to content

Commit

Permalink
Remove unnecessary mdtest method
Browse files Browse the repository at this point in the history
It was only used for testing race conditions in sending code,
but those don't happen anymore
  • Loading branch information
tulir committed Oct 13, 2023
1 parent 790c7ce commit 2788e7c
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions mdtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,35 +570,6 @@ func handleCmd(cmd string, args []string) {
} else {
log.Infof("Message sent (server timestamp: %s)", resp.Timestamp)
}
case "multisend":
if len(args) < 3 {
log.Errorf("Usage: multisend <jids...> -- <text>")
return
}
var recipients []types.JID
for len(args) > 0 && args[0] != "--" {
recipient, ok := parseJID(args[0])
args = args[1:]
if !ok {
return
}
recipients = append(recipients, recipient)
}
if len(args) == 0 {
log.Errorf("Usage: multisend <jids...> -- <text> (the -- is required)")
return
}
msg := &waProto.Message{Conversation: proto.String(strings.Join(args[1:], " "))}
for _, recipient := range recipients {
go func(recipient types.JID) {
resp, err := cli.SendMessage(context.Background(), recipient, msg)
if err != nil {
log.Errorf("Error sending message to %s: %v", recipient, err)
} else {
log.Infof("Message sent to %s (server timestamp: %s)", recipient, resp.Timestamp)
}
}(recipient)
}
case "react":
if len(args) < 3 {
log.Errorf("Usage: react <jid> <message ID> <reaction>")
Expand Down

0 comments on commit 2788e7c

Please sign in to comment.