minimal support for Move activity
This commit is contained in:
parent
5222332d91
commit
4efda0c551
14
activity.go
14
activity.go
|
@ -36,6 +36,7 @@ import (
|
||||||
"humungus.tedunangst.com/r/webs/gate"
|
"humungus.tedunangst.com/r/webs/gate"
|
||||||
"humungus.tedunangst.com/r/webs/httpsig"
|
"humungus.tedunangst.com/r/webs/httpsig"
|
||||||
"humungus.tedunangst.com/r/webs/junk"
|
"humungus.tedunangst.com/r/webs/junk"
|
||||||
|
"humungus.tedunangst.com/r/webs/templates"
|
||||||
)
|
)
|
||||||
|
|
||||||
var theonetruename = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"`
|
var theonetruename = `application/ld+json; profile="https://www.w3.org/ns/activitystreams"`
|
||||||
|
@ -465,13 +466,15 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
||||||
xonkxonkfn = func(item junk.Junk, origin string) *Honk {
|
xonkxonkfn = func(item junk.Junk, origin string) *Honk {
|
||||||
// id, _ := item.GetString( "id")
|
// id, _ := item.GetString( "id")
|
||||||
what, _ := item.GetString("type")
|
what, _ := item.GetString("type")
|
||||||
dt, _ := item.GetString("published")
|
dt, ok := item.GetString("published")
|
||||||
|
if !ok {
|
||||||
|
dt = time.Now().Format(time.RFC3339)
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var xid, rid, url, content, precis, convoy string
|
var xid, rid, url, content, precis, convoy string
|
||||||
var replies []string
|
var replies []string
|
||||||
var obj junk.Junk
|
var obj junk.Junk
|
||||||
var ok bool
|
|
||||||
isUpdate := false
|
isUpdate := false
|
||||||
switch what {
|
switch what {
|
||||||
case "Delete":
|
case "Delete":
|
||||||
|
@ -572,6 +575,9 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
||||||
return xonkxonkfn(obj, originate(xid))
|
return xonkxonkfn(obj, originate(xid))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
case "Move":
|
||||||
|
obj = item
|
||||||
|
what = "move"
|
||||||
case "Audio":
|
case "Audio":
|
||||||
fallthrough
|
fallthrough
|
||||||
case "Video":
|
case "Video":
|
||||||
|
@ -701,6 +707,10 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
|
||||||
}
|
}
|
||||||
content += "</ul>"
|
content += "</ul>"
|
||||||
}
|
}
|
||||||
|
if ot == "Move" {
|
||||||
|
targ, _ := obj.GetString("target")
|
||||||
|
content += string(templates.Sprintf(`<p>Moved to <a href="%s">%s</a>`, targ, targ))
|
||||||
|
}
|
||||||
if what == "honk" && rid != "" {
|
if what == "honk" && rid != "" {
|
||||||
what = "tonk"
|
what = "tonk"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ changelog
|
||||||
|
|
||||||
=== next
|
=== next
|
||||||
|
|
||||||
|
+ Minimal support for Move activity.
|
||||||
|
|
||||||
++ Import command now supports the elephant in the room.
|
++ Import command now supports the elephant in the room.
|
||||||
|
|
||||||
+ deluser command.
|
+ deluser command.
|
||||||
|
|
Loading…
Reference in New Issue