Skip to content

Commit

Permalink
resolves mrusme#32 Filter for lemmy communities
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadMakesYouFat committed Jun 23, 2023
1 parent f0ac5c9 commit 19556e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions system/lemmy/lemmy.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,21 @@ func (sys *System) ListPosts(forumID string) ([]post.Post, error) {
return []post.Post{}, err
}

var communityID int
var showAll bool
communityID, err = strconv.Atoi(forumID)
if err != nil {
showAll = true
}

cfg := sys.GetConfig()
baseURL := cfg["url"].(string)

var models []post.Post
for _, i := range resp.Posts {
if (!showAll) && i.Post.CommunityID != communityID {
continue
}
t := "post"
body := i.Post.Body.ValueOr("")
if i.Post.URL.IsValid() {
Expand Down

0 comments on commit 19556e2

Please sign in to comment.