diff --git a/system/discourse/api/categories.go b/system/discourse/api/categories.go index c627f9c..387242a 100644 --- a/system/discourse/api/categories.go +++ b/system/discourse/api/categories.go @@ -51,7 +51,7 @@ type CategoryModel struct { TopicsYear int `json:"topics_year"` TopicsAllTime int `json:"topics_all_time"` IsUncategorized bool `json:"is_uncategorized"` - SubcategoryIDs []string `json:"subcategory_ids"` + SubcategoryIDs []int `json:"subcategory_ids"` SubcategoryList []CategoryModel `json:"subcategory_list"` UploadedLogo string `json:"uploaded_logo"` UploadedLogoDark string `json:"uploaded_logo_dark"` diff --git a/system/discourse/discourse.go b/system/discourse/discourse.go index 0f9d6b2..2f85801 100644 --- a/system/discourse/discourse.go +++ b/system/discourse/discourse.go @@ -314,11 +314,6 @@ func (sys *System) CreateReply(r *reply.Reply) error { return err } - inReplyTo, err := strconv.Atoi(r.InReplyTo) - if err != nil { - return err - } - var ap api.CreatePostModel if r.Index == -1 { @@ -330,10 +325,15 @@ func (sys *System) CreateReply(r *reply.Reply) error { } } else { // 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{ Raw: r.Body, TopicID: inReplyTo, - ReplyToPostNumber: r.Index, + ReplyToPostNumber: r.Index + 1, CreatedAt: time.Now().Format(time.RFC3339Nano), } }