readonly qonk support

This commit is contained in:
Ted Unangst 2019-06-11 23:03:53 -04:00
parent 48cb1021cc
commit c925160853
2 changed files with 29 additions and 2 deletions

View File

@ -454,6 +454,8 @@ func xonkxonk(user *WhatAbout, item junk.Junk, origin string) *Honk {
obj, _ = item.GetMap("object") obj, _ = item.GetMap("object")
xid, _ = item.GetString("object") xid, _ = item.GetString("object")
what = "eradicate" what = "eradicate"
case "Question":
fallthrough
case "Note": case "Note":
fallthrough fallthrough
case "Article": case "Article":
@ -479,7 +481,7 @@ func xonkxonk(user *WhatAbout, item junk.Junk, origin string) *Honk {
oonker, _ = obj.GetString("attributedTo") oonker, _ = obj.GetString("attributedTo")
ot, _ := obj.GetString("type") ot, _ := obj.GetString("type")
url, _ = obj.GetString("url") url, _ = obj.GetString("url")
if ot == "Note" || ot == "Article" || ot == "Page" { if ot == "Note" || ot == "Article" || ot == "Page" || ot == "Question" {
audience = newphone(audience, obj) audience = newphone(audience, obj)
xid, _ = obj.GetString("id") xid, _ = obj.GetString("id")
precis, _ = obj.GetString("summary") precis, _ = obj.GetString("summary")
@ -492,6 +494,29 @@ func xonkxonk(user *WhatAbout, item junk.Junk, origin string) *Honk {
if convoy == "" { if convoy == "" {
convoy, _ = obj.GetString("conversation") convoy, _ = obj.GetString("conversation")
} }
if ot == "Question" {
what = "qonk"
content += "<ul>"
ans, _ := obj.GetArray("oneOf")
for _, ai := range ans {
a, ok := ai.(junk.Junk)
if !ok {
continue
}
as, _ := a.GetString("name")
content += "<li>" + as
}
ans, _ = obj.GetArray("anyOf")
for _, ai := range ans {
a, ok := ai.(junk.Junk)
if !ok {
continue
}
as, _ := a.GetString("name")
content += "<li>" + as
}
content += "</ul>"
}
if what == "honk" && rid != "" { if what == "honk" && rid != "" {
what = "tonk" what = "tonk"
} }

View File

@ -2,9 +2,11 @@ changelog
-- v -- v
+ Read only support for qonks.
++ Some extra commands for better database retention management. ++ Some extra commands for better database retention management.
+ Add a form to allow manual import of external posts. + Add a form to allow manual import of xonks.
+ About page + About page