comment out fb pic magic
This commit is contained in:
+11
-11
@@ -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
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user