Also copy author over
This commit is contained in:
parent
18f270c42c
commit
e4540ab2b3
|
@ -130,6 +130,21 @@ func (b *memoryBackend) ChannelsDelete(uid string) {
|
|||
}
|
||||
}
|
||||
|
||||
func mapToAuthor(result map[string]interface{}) microsub.Author {
|
||||
item := microsub.Author{}
|
||||
item.Type = "card"
|
||||
if name, e := result["name"]; e {
|
||||
item.Name = name.(string)
|
||||
}
|
||||
if url, e := result["url"]; e {
|
||||
item.URL = url.(string)
|
||||
}
|
||||
if photo, e := result["photo"]; e {
|
||||
item.Photo = photo.(string)
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
||||
func mapToItem(result map[string]interface{}) microsub.Item {
|
||||
item := microsub.Item{}
|
||||
|
||||
|
@ -147,6 +162,10 @@ func mapToItem(result map[string]interface{}) microsub.Item {
|
|||
item.UID = uid.(string)
|
||||
}
|
||||
|
||||
if author, e := result["author"]; e {
|
||||
item.Author = mapToAuthor(author.(map[string]interface{}))
|
||||
}
|
||||
|
||||
if content, e := result["content"]; e {
|
||||
if c, ok := content.(map[string]interface{}); ok {
|
||||
if html, e2 := c["html"]; e2 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user