mirror of https://github.com/jlelse/GoBlog
Fix stupid mistake
This commit is contained in:
parent
10b71871ec
commit
f8dbb78412
|
@ -148,7 +148,7 @@ func apHandleInbox(w http.ResponseWriter, r *http.Request) {
|
||||||
createWebmention(id, inReplyTo)
|
createWebmention(id, inReplyTo)
|
||||||
} else if content, hasContent := object["content"].(string); hasContent && hasID && len(id) > 0 {
|
} else if content, hasContent := object["content"].(string); hasContent && hasID && len(id) > 0 {
|
||||||
// May be a mention; find links to blog and save them as webmentions
|
// May be a mention; find links to blog and save them as webmentions
|
||||||
if doc, err := webmention.DocumentFromReader(r.Context(), strings.NewReader(content), id); err != nil {
|
if doc, err := webmention.DocumentFromReader(context.Background(), strings.NewReader(content), id); err == nil && doc != nil {
|
||||||
for _, link := range doc.ExternalLinks() {
|
for _, link := range doc.ExternalLinks() {
|
||||||
if strings.Contains(link, blogIri) {
|
if strings.Contains(link, blogIri) {
|
||||||
createWebmention(id, link)
|
createWebmention(id, link)
|
||||||
|
|
Loading…
Reference in New Issue