make the ping command easier to use

Ted Unangst 4 years ago
parent 7e69f46def
commit 0650f65ec8

@ -1,5 +1,9 @@
changelog
=== next
+ Easier to use ping command.
=== 0.9.3 Notacanthous Nutshell
++ backup command.

@ -340,7 +340,7 @@ func main() {
svalbard(name)
case "ping":
if len(args) < 3 {
fmt.Printf("usage: honk ping from to\n")
fmt.Printf("usage: honk ping (from username) (to username or url)\n")
return
}
name := args[1]

@ -257,12 +257,23 @@ func crappola(j junk.Junk) bool {
}
func ping(user *WhatAbout, who string) {
if targ := fullname(who, user.ID); targ != "" {
who = targ
}
if !strings.HasPrefix(who, "https:") {
who = gofish(who)
}
if who == "" {
log.Printf("nobody to ping!")
return
}
var box *Box
ok := boxofboxes.Get(who, &box)
if !ok {
log.Printf("no inbox to ping %s", who)
return
}
log.Printf("sending ping to %s", box.In)
j := junk.New()
j["@context"] = itiswhatitis
j["type"] = "Ping"

Loading…
Cancel
Save