comment out fb pic magic

This commit is contained in:
Umputun
2018-02-14 02:49:42 -06:00
parent 99367076f4
commit 8253c9b0b3
2 changed files with 20 additions and 14 deletions
+11 -11
View File
@@ -80,17 +80,17 @@ func NewFacebook(p Params) Provider {
userInfo.ID = "facebook_" + userInfo.ID
// picture under picture[data[url]]
if p, ok := data["picture"]; ok {
if picMap, ok := p.(map[string]interface{}); ok {
if d, ok := picMap["data"]; ok {
if dataMap, ok := d.(map[string]interface{}); ok {
if picURL, ok := dataMap["url"]; ok {
userInfo.Picture = picURL.(string)
}
}
}
}
}
// if p, ok := data["picture"]; ok {
// if picMap, ok := p.(map[string]interface{}); ok {
// if d, ok := picMap["data"]; ok {
// if dataMap, ok := d.(map[string]interface{}); ok {
// if picURL, ok := dataMap["url"]; ok {
// userInfo.Picture = picURL.(string)
// }
// }
// }
// }
// }
return userInfo
},
})
+9 -3
View File
@@ -23,10 +23,16 @@ func MakeTree(comments []store.Comment, sortType string) *Tree {
res := Tree{}
topComments := res.filter(comments, "")
res.Nodes = make([]*Node, len(topComments))
for i, rc := range topComments {
res.Nodes = []*Node{}
for _, rc := range topComments {
node := Node{Comment: rc}
res.Nodes[i] = res.proc(comments, &node, rc.ID)
commentsTree := res.proc(comments, &node, rc.ID)
if commentsTree.Comment.Deleted && len(commentsTree.Replies) == 0 { // skip deleted with no subcomments
continue
}
res.Nodes = append(res.Nodes, res.proc(comments, &node, rc.ID))
}
res.sortNodes(sortType)