Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin API: getPosts method #12696

Open
mattermod opened this issue Oct 9, 2019 · 22 comments
Open

Plugin API: getPosts method #12696

mattermod opened this issue Oct 9, 2019 · 22 comments
Assignees
Labels
Area/Toolkit Plugins and integrations framework Difficulty/2:Medium Medium ticket Hacktoberfest Help Wanted Community help wanted Tech/Go Server

Comments

@mattermod
Copy link
Contributor

mattermod commented Oct 9, 2019

Introduce a GetPosts method to the base plugin API. This should serve as the basis for all bulk queries of Posts.

type GetPostsOptions struct {
	// PostTypes optionally limits the types of posts to return.
	// See model.POST*JOIN_CHANNEL, model.POST_JOIN*TEAM...
	PostTypes []string
	// UserIds optionally limits the posts to those created by the given users.
	UserIds []string
	// ChannelIds optionally limits the posts to those created in the given channels.
	ChannelIds []string
	// Since optionally limits posts to those created after a specified time as Unix time in milliseconds
	Since int64
	// IncludeDeleted includes deleted posts if set.
	IncludeDeleted bool
	// Page limits to the requested page of results.
	Page int
	// PerPage limits the number of results to fetch per page.
	PerPage int
}
GetPosts(options model.GetPostsOptions) (*model.PostList, *model.AppError)

We may later build plugin helpers upon this RPC method to streamline certain kinds of queries, e.g. get all posts by a user, get all posts in a channel and so on.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-19052

@alifarooq0 alifarooq0 added Difficulty/2:Medium Medium ticket Tech/Go Server labels Oct 9, 2019
@iomodo iomodo added the Area/Toolkit Plugins and integrations framework label Oct 9, 2019
@letsila
Copy link
Contributor

letsila commented Oct 10, 2019

hey guys, I'd love to work on this one.

@jasonblais
Copy link
Contributor

Hey @letsila, touching base to see if you're still working on this one. If you have questions, let us know :)

@letsila
Copy link
Contributor

letsila commented Dec 21, 2019

Hi @jasonblais, I am still on this one, sorry for the delay.

@jasonblais
Copy link
Contributor

@letsila Sounds good, thanks so much for the quick response 👍

@tharun208
Copy link

I like to work on this @letsila

@letsila
Copy link
Contributor

letsila commented Feb 1, 2020

@tharun208 go ahead. I didn't make a lot of progress on this one so far.

@jasonblais jasonblais assigned tharun208 and unassigned letsila Feb 1, 2020
@jasonblais
Copy link
Contributor

Thanks all, reassigned to @tharun208 :)

@tharun208
Copy link

Hi @jasonblais, can the GetPostsOptions type can go very well go inside post_list model right ?

@jasonblais
Copy link
Contributor

I'm not sure actually - @iomodo or @hanzei would you be open to help with the above?

@hanzei
Copy link
Contributor

hanzei commented Feb 20, 2020

@tharun208 Yes, that works 👍

@fedealconada
Copy link
Contributor

@hanzei I could take this one if @tharun208 is okay with that

@hanzei
Copy link
Contributor

hanzei commented Mar 29, 2020

@tharun208 Are you still working on this issue?

@tharun208
Copy link

@hanzei, I am almost there, some doubts there, is there any slack group to contact you?

@hanzei
Copy link
Contributor

hanzei commented Mar 29, 2020

There is a Mattermost Server 😉 Please ask your Question in the ~Toolkit channel on the Mattermost Community Server).

@jasonblais
Copy link
Contributor

@tharun208 Did you receive guidance on the Mattermost community server linked above? We'd be happy to help :)

@tharun208
Copy link

i am almost there ! will raise a PR soon

@tharun208
Copy link

But, I see already there is a GetPosts method in the store.But that won't fit in our case, so we need to create a new store function for the GetPosts method right ?. Am I correct?

@jasonblais
Copy link
Contributor

@iomodo would you be open to helping with the above? (cc @hanzei)

@hanzei
Copy link
Contributor

hanzei commented Aug 5, 2020

@tharun208 That is correct. Please let me know if you have any other questions.

@hanzei
Copy link
Contributor

hanzei commented Sep 29, 2020

@tharun208 Are you still working on this issue?

@tharun208
Copy link

@hanzei no i am not

@avinashdhinwa
Copy link

@hanzei can I work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Toolkit Plugins and integrations framework Difficulty/2:Medium Medium ticket Hacktoberfest Help Wanted Community help wanted Tech/Go Server
Projects
None yet
Development

No branches or pull requests