add disqus prefix for importer
This commit is contained in:
@@ -118,13 +118,13 @@ func (d *Disqus) convert(r io.Reader, siteID string) (ch chan store.Comment) {
|
||||
c := store.Comment{
|
||||
ID: comment.UID,
|
||||
Locator: store.Locator{URL: postsMap[comment.Tid.Val], SiteID: siteID},
|
||||
User: store.User{ID: comment.AuthorUserName, Name: comment.AuthorName, IP: comment.IP},
|
||||
User: store.User{ID: "disqus-" + comment.AuthorUserName, Name: comment.AuthorName, IP: comment.IP},
|
||||
Text: d.cleanText(comment.Message),
|
||||
Timestamp: comment.CreatedAt,
|
||||
ParentID: comment.Pid.Val,
|
||||
}
|
||||
if c.User.ID == "" {
|
||||
c.User.ID = "import_" + c.User.Name
|
||||
if c.User.ID == "disqus-" {
|
||||
c.User.ID = "disqus-" + c.User.Name
|
||||
}
|
||||
if c.ID == "" {
|
||||
c.ID = comment.ID
|
||||
|
||||
@@ -52,7 +52,7 @@ func TestDisqus_Convert(t *testing.T) {
|
||||
Text: `<p>The quick brown fox jumps over the lazy dog.</p><p><a href="https://https://radio-t.com" rel="nofollow noopener" title="radio-t">some link</a></p>`,
|
||||
User: store.User{
|
||||
Name: "Alexander Blah",
|
||||
ID: "facebook-1787732238",
|
||||
ID: "disqus-facebook-1787732238",
|
||||
IP: "178.178.178.178",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user