1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-12-04 14:46:37 -05:00

Fixed reply to number on Discourse

This commit is contained in:
マリウス 2023-01-05 18:20:10 -05:00
parent 8597200a5b
commit c15ba4e10e
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
2 changed files with 7 additions and 7 deletions

View File

@ -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"`

View File

@ -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),
}
}