Fix repost error type conversion

This commit is contained in:
Peter Stuifzand 2018-05-06 12:39:54 +02:00
parent 6e89e8d4f7
commit 798c5c39d6

View File

@ -266,9 +266,13 @@ func mapToItem(result map[string]interface{}) microsub.Item {
}
if value, e := result["repost-of"]; e {
for _, v := range value.([]interface{}) {
if u, ok := v.(string); ok {
item.RepostOf = append(item.RepostOf, u)
if repost, ok := value.(string); ok {
item.RepostOf = append(item.RepostOf, repost)
} else if repost, ok := value.([]interface{}); ok {
for _, v := range repost {
if u, ok := v.(string); ok {
item.RepostOf = append(item.RepostOf, u)
}
}
}
}