|
|
@ -29,6 +29,7 @@ import ( |
|
|
|
"github.com/writeas/web-core/log" |
|
|
|
"github.com/writeas/web-core/log" |
|
|
|
"github.com/writeas/web-core/query" |
|
|
|
"github.com/writeas/web-core/query" |
|
|
|
"github.com/writeas/writefreely/author" |
|
|
|
"github.com/writeas/writefreely/author" |
|
|
|
|
|
|
|
"github.com/writeas/writefreely/config" |
|
|
|
"github.com/writeas/writefreely/key" |
|
|
|
"github.com/writeas/writefreely/key" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -105,8 +106,8 @@ type writestore interface { |
|
|
|
ClaimPosts(userID int64, collAlias string, posts *[]ClaimPostRequest) (*[]ClaimPostResult, error) |
|
|
|
ClaimPosts(userID int64, collAlias string, posts *[]ClaimPostRequest) (*[]ClaimPostResult, error) |
|
|
|
|
|
|
|
|
|
|
|
GetPostsCount(c *CollectionObj, includeFuture bool) |
|
|
|
GetPostsCount(c *CollectionObj, includeFuture bool) |
|
|
|
GetPosts(c *Collection, page int, includeFuture, forceRecentFirst, includePinned bool) (*[]PublicPost, error) |
|
|
|
GetPosts(cfg *config.Config, c *Collection, page int, includeFuture, forceRecentFirst, includePinned bool) (*[]PublicPost, error) |
|
|
|
GetPostsTagged(c *Collection, tag string, page int, includeFuture bool) (*[]PublicPost, error) |
|
|
|
GetPostsTagged(cfg *config.Config, c *Collection, tag string, page int, includeFuture bool) (*[]PublicPost, error) |
|
|
|
|
|
|
|
|
|
|
|
GetAPFollowers(c *Collection) (*[]RemoteUser, error) |
|
|
|
GetAPFollowers(c *Collection) (*[]RemoteUser, error) |
|
|
|
GetAPActorKeys(collectionID int64) ([]byte, []byte) |
|
|
|
GetAPActorKeys(collectionID int64) ([]byte, []byte) |
|
|
@ -1067,7 +1068,7 @@ func (db *datastore) GetPostsCount(c *CollectionObj, includeFuture bool) { |
|
|
|
// It will return future posts if `includeFuture` is true.
|
|
|
|
// It will return future posts if `includeFuture` is true.
|
|
|
|
// It will include only standard (non-pinned) posts unless `includePinned` is true.
|
|
|
|
// It will include only standard (non-pinned) posts unless `includePinned` is true.
|
|
|
|
// TODO: change includeFuture to isOwner, since that's how it's used
|
|
|
|
// TODO: change includeFuture to isOwner, since that's how it's used
|
|
|
|
func (db *datastore) GetPosts(c *Collection, page int, includeFuture, forceRecentFirst, includePinned bool) (*[]PublicPost, error) { |
|
|
|
func (db *datastore) GetPosts(cfg *config.Config, c *Collection, page int, includeFuture, forceRecentFirst, includePinned bool) (*[]PublicPost, error) { |
|
|
|
collID := c.ID |
|
|
|
collID := c.ID |
|
|
|
|
|
|
|
|
|
|
|
cf := c.NewFormat() |
|
|
|
cf := c.NewFormat() |
|
|
@ -1112,7 +1113,7 @@ func (db *datastore) GetPosts(c *Collection, page int, includeFuture, forceRecen |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
p.extractData() |
|
|
|
p.extractData() |
|
|
|
p.formatContent(c, includeFuture) |
|
|
|
p.formatContent(cfg, c, includeFuture) |
|
|
|
|
|
|
|
|
|
|
|
posts = append(posts, p.processPost()) |
|
|
|
posts = append(posts, p.processPost()) |
|
|
|
} |
|
|
|
} |
|
|
@ -1128,7 +1129,7 @@ func (db *datastore) GetPosts(c *Collection, page int, includeFuture, forceRecen |
|
|
|
// given tag.
|
|
|
|
// given tag.
|
|
|
|
// It will return future posts if `includeFuture` is true.
|
|
|
|
// It will return future posts if `includeFuture` is true.
|
|
|
|
// TODO: change includeFuture to isOwner, since that's how it's used
|
|
|
|
// TODO: change includeFuture to isOwner, since that's how it's used
|
|
|
|
func (db *datastore) GetPostsTagged(c *Collection, tag string, page int, includeFuture bool) (*[]PublicPost, error) { |
|
|
|
func (db *datastore) GetPostsTagged(cfg *config.Config, c *Collection, tag string, page int, includeFuture bool) (*[]PublicPost, error) { |
|
|
|
collID := c.ID |
|
|
|
collID := c.ID |
|
|
|
|
|
|
|
|
|
|
|
cf := c.NewFormat() |
|
|
|
cf := c.NewFormat() |
|
|
@ -1176,7 +1177,7 @@ func (db *datastore) GetPostsTagged(c *Collection, tag string, page int, include |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
p.extractData() |
|
|
|
p.extractData() |
|
|
|
p.formatContent(c, includeFuture) |
|
|
|
p.formatContent(cfg, c, includeFuture) |
|
|
|
|
|
|
|
|
|
|
|
posts = append(posts, p.processPost()) |
|
|
|
posts = append(posts, p.processPost()) |
|
|
|
} |
|
|
|
} |
|
|
|