mirror of
https://github.com/mrusme/neonmodem.git
synced 2025-01-03 14:56:41 -05:00
Fixed reply to number on Discourse
This commit is contained in:
parent
8597200a5b
commit
c15ba4e10e
@ -51,7 +51,7 @@ type CategoryModel struct {
|
|||||||
TopicsYear int `json:"topics_year"`
|
TopicsYear int `json:"topics_year"`
|
||||||
TopicsAllTime int `json:"topics_all_time"`
|
TopicsAllTime int `json:"topics_all_time"`
|
||||||
IsUncategorized bool `json:"is_uncategorized"`
|
IsUncategorized bool `json:"is_uncategorized"`
|
||||||
SubcategoryIDs []string `json:"subcategory_ids"`
|
SubcategoryIDs []int `json:"subcategory_ids"`
|
||||||
SubcategoryList []CategoryModel `json:"subcategory_list"`
|
SubcategoryList []CategoryModel `json:"subcategory_list"`
|
||||||
UploadedLogo string `json:"uploaded_logo"`
|
UploadedLogo string `json:"uploaded_logo"`
|
||||||
UploadedLogoDark string `json:"uploaded_logo_dark"`
|
UploadedLogoDark string `json:"uploaded_logo_dark"`
|
||||||
|
@ -314,11 +314,6 @@ func (sys *System) CreateReply(r *reply.Reply) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
inReplyTo, err := strconv.Atoi(r.InReplyTo)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
var ap api.CreatePostModel
|
var ap api.CreatePostModel
|
||||||
|
|
||||||
if r.Index == -1 {
|
if r.Index == -1 {
|
||||||
@ -330,10 +325,15 @@ func (sys *System) CreateReply(r *reply.Reply) error {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Apparently it's a reply to a comment in a post
|
// Apparently it's a reply to a comment in a post
|
||||||
|
inReplyTo, err := strconv.Atoi(r.InReplyTo)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
ap = api.CreatePostModel{
|
ap = api.CreatePostModel{
|
||||||
Raw: r.Body,
|
Raw: r.Body,
|
||||||
TopicID: inReplyTo,
|
TopicID: inReplyTo,
|
||||||
ReplyToPostNumber: r.Index,
|
ReplyToPostNumber: r.Index + 1,
|
||||||
CreatedAt: time.Now().Format(time.RFC3339Nano),
|
CreatedAt: time.Now().Format(time.RFC3339Nano),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user