Skip to content

Commit

Permalink
parent check should go after thread check
Browse files Browse the repository at this point in the history
  • Loading branch information
IoIxD committed Jul 23, 2024
1 parent 244bc65 commit 657f777
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@ func (s *server) getForum(w http.ResponseWriter, r *http.Request) {
}
var posts []Post
for _, thread := range channels {

if thread.ParentID != forum.ID ||
thread.Type != discord.GuildPublicThread {
continue
}

parent, err := s.channel(thread.ParentID)
if err != nil {
s.displayErr(w, http.StatusInternalServerError,
Expand All @@ -458,10 +464,6 @@ func (s *server) getForum(w http.ResponseWriter, r *http.Request) {
if parent.Type != discord.GuildForum {
continue
}
if thread.ParentID != forum.ID ||
thread.Type != discord.GuildPublicThread {
continue
}
post := Post{Channel: thread}
for _, tag := range thread.AppliedTags {
for _, availtag := range forum.AvailableTags {
Expand Down

0 comments on commit 657f777

Please sign in to comment.