all messages matter again
This commit is contained in:
parent
3ff98a261e
commit
6e43340381
26
activity.go
26
activity.go
|
@ -1149,7 +1149,7 @@ func rubadubdub(user *WhatAbout, req junk.Junk) {
|
|||
j["published"] = time.Now().UTC().Format(time.RFC3339)
|
||||
j["object"] = req
|
||||
|
||||
deliverate(0, user.ID, actor, j.ToBytes(), true)
|
||||
deliverate(0, user.ID, actor, j.ToBytes())
|
||||
}
|
||||
|
||||
func itakeitallback(user *WhatAbout, xid string, owner string, folxid string) {
|
||||
|
@ -1168,7 +1168,7 @@ func itakeitallback(user *WhatAbout, xid string, owner string, folxid string) {
|
|||
j["object"] = f
|
||||
j["published"] = time.Now().UTC().Format(time.RFC3339)
|
||||
|
||||
deliverate(0, user.ID, owner, j.ToBytes(), true)
|
||||
deliverate(0, user.ID, owner, j.ToBytes())
|
||||
}
|
||||
|
||||
func subsub(user *WhatAbout, xid string, owner string, folxid string) {
|
||||
|
@ -1185,7 +1185,7 @@ func subsub(user *WhatAbout, xid string, owner string, folxid string) {
|
|||
j["object"] = xid
|
||||
j["published"] = time.Now().UTC().Format(time.RFC3339)
|
||||
|
||||
deliverate(0, user.ID, owner, j.ToBytes(), true)
|
||||
deliverate(0, user.ID, owner, j.ToBytes())
|
||||
}
|
||||
|
||||
func activatedonks(donks []*Donk) []junk.Junk {
|
||||
|
@ -1495,7 +1495,7 @@ func sendchonk(user *WhatAbout, ch *Chonk) {
|
|||
rcpts := make(map[string]bool)
|
||||
rcpts[ch.Target] = true
|
||||
for a := range rcpts {
|
||||
go deliverate(0, user.ID, a, msg, true)
|
||||
go deliverate(0, user.ID, a, msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1534,25 +1534,13 @@ func honkworldwide(user *WhatAbout, honk *Honk) {
|
|||
}
|
||||
}
|
||||
for a := range rcpts {
|
||||
go deliverate(0, user.ID, a, msg, doesitmatter(honk.What))
|
||||
go deliverate(0, user.ID, a, msg)
|
||||
}
|
||||
if honk.Public && len(honk.Onts) > 0 {
|
||||
collectiveaction(honk)
|
||||
}
|
||||
}
|
||||
|
||||
func doesitmatter(what string) bool {
|
||||
switch what {
|
||||
case "ack":
|
||||
return false
|
||||
case "react":
|
||||
return false
|
||||
case "deack":
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func collectiveaction(honk *Honk) {
|
||||
user := getserveruser()
|
||||
for _, ont := range honk.Onts {
|
||||
|
@ -1579,7 +1567,7 @@ func collectiveaction(honk *Honk) {
|
|||
}
|
||||
msg := j.ToBytes()
|
||||
for a := range rcpts {
|
||||
go deliverate(0, user.ID, a, msg, false)
|
||||
go deliverate(0, user.ID, a, msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1893,7 +1881,7 @@ func updateMe(username string) {
|
|||
}
|
||||
}
|
||||
for a := range rcpts {
|
||||
go deliverate(0, user.ID, a, msg, false)
|
||||
go deliverate(0, user.ID, a, msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ func clearoutbound(rcpt string) {
|
|||
|
||||
var garage = gate.NewLimiter(40)
|
||||
|
||||
func deliverate(goarounds int64, userid int64, rcpt string, msg []byte, prio bool) {
|
||||
func deliverate(goarounds int64, userid int64, rcpt string, msg []byte) {
|
||||
garage.Start()
|
||||
defer garage.Finish()
|
||||
|
||||
|
@ -98,9 +98,7 @@ func deliverate(goarounds int64, userid int64, rcpt string, msg []byte, prio boo
|
|||
err := PostMsg(ki.keyname, ki.seckey, inbox, msg)
|
||||
if err != nil {
|
||||
ilog.Printf("failed to post json to %s: %s", inbox, err)
|
||||
if prio {
|
||||
sayitagain(goarounds+1, userid, rcpt, msg)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +161,7 @@ func redeliverator() {
|
|||
continue
|
||||
}
|
||||
ilog.Printf("redeliverating %s try %d", rcpt, goarounds)
|
||||
deliverate(goarounds, userid, rcpt, msg, true)
|
||||
deliverate(goarounds, userid, rcpt, msg)
|
||||
} else if d.When.Before(nexttime) {
|
||||
nexttime = d.When
|
||||
}
|
||||
|
|
2
web.go
2
web.go
|
@ -2422,7 +2422,7 @@ func apihandler(w http.ResponseWriter, r *http.Request) {
|
|||
rcpts := boxuprcpts(user, r.Form["rcpt"], public)
|
||||
msg := []byte(r.FormValue("msg"))
|
||||
for rcpt := range rcpts {
|
||||
go deliverate(0, userid, rcpt, msg, true)
|
||||
go deliverate(0, userid, rcpt, msg)
|
||||
}
|
||||
case "gethonkers":
|
||||
j := junk.New()
|
||||
|
|
Loading…
Reference in New Issue