all repos — honk @ 87915b2562e4c2d1d3953a20a2d176dab2b64e74

my fork of honk

make the ping command easier to use
Ted Unangst tedu@tedunangst.com
Wed, 11 Nov 2020 14:44:51 -0500
commit

87915b2562e4c2d1d3953a20a2d176dab2b64e74

parent

0a68a79e79989a30376953a93cabbbba508653af

3 files changed, 16 insertions(+), 1 deletions(-)

jump to
M docs/changelog.txtdocs/changelog.txt

@@ -1,5 +1,9 @@

changelog +=== next + ++ Easier to use ping command. + === 0.9.3 Notacanthous Nutshell ++ backup command.
M honk.gohonk.go

@@ -340,7 +340,7 @@ name := args[1]

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]
M web.goweb.go

@@ -257,12 +257,23 @@ return false

} 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"