Add Notification functions #226

Merged
lafriks merged 7 commits from 6543/go-sdk:add-notifications into master 2020-02-04 08:03:17 +00:00
Owner

as title

as title
6543 added the
kind/feature
label 2020-01-09 22:35:32 +00:00
6543 changed title from add notifications to Add notifications 2020-01-09 22:35:38 +00:00
lunny reviewed 2020-01-18 01:47:17 +00:00
Dismissed
@ -0,0 +16,4 @@
Repository *Repository `json:"repository"`
Subject *NotificationSubject `json:"subject"`
Unread bool `json:"unread"`
Pinned bool `json:"pinned"`
Owner

It seems we haven't implement pin yet.

It seems we haven't implement pin yet.
Author
Owner

@lunny Pinned is implemented ... but gitea handle it with read/unread ...

and currently a notification can have 3 states: "read"/"unread"/"pinned"

@lunny Pinned is implemented ... but gitea handle it with read/unread ... and currently a notification can have 3 states: "read"/"unread"/"pinned"
Author
Owner

gitea "pinned" = read&pinned

unread&pinned does not exist

gitea "pinned" = read&pinned unread&pinned does not exist
Owner

Please add some tests

Please add some tests
6543 added this to the v0.12.0 milestone 2020-01-26 17:23:02 +00:00
6543 reviewed 2020-01-28 21:21:44 +00:00
Dismissed
@ -24,4 +23,2 @@
func (c *Client) GetWatchedRepos(user, pass string) ([]*Repository, error) {
repos := make([]*Repository, 0, 10)
return repos, c.getParsedResponse("GET", fmt.Sprintf("/users/%s/subscriptions", user),
http.Header{"Authorization": []string{"Basic " + BasicAuthEncode(user, pass)}}, nil, &repos)
Author
Owner

removing the header so Client can apply its own (and let Auth work as usual)

needed for the TEST (otherwhise sudo API wont work)

removing the header so Client can apply its own (and let Auth work as usual) needed for the TEST (otherwhise sudo API wont work)
Author
Owner

more extend fix/refactor is at #241

more extend fix/refactor is at #241
Author
Owner

@lunny done

@lunny done
6543 added a new dependency 2020-01-30 10:52:59 +00:00
6543 added a new dependency 2020-01-30 22:37:39 +00:00
lunny reviewed 2020-01-31 02:36:28 +00:00
Dismissed
@ -23,19 +22,16 @@ type WatchInfo struct {
// GetWatchedRepos list all the watched repos of user
func (c *Client) GetWatchedRepos(user, pass string) ([]*Repository, error) {
Owner

Then remove the pass parameter?

Then remove the `pass` parameter?
Author
Owner

@lunny refactor&fix of this function is done in #241 if that one get merged this changes are not needed anymore

@lunny refactor&fix of this function is done in #241 if that one get merged this changes are not needed anymore
6543 marked this conversation as resolved
6543 added a new dependency 2020-01-31 04:22:27 +00:00
Author
Owner

@lunny coverage: 26.8% 🎉

@lunny `coverage: 26.8%` :tada:
6543 removed a dependency 2020-01-31 07:56:03 +00:00
lunny requested changes 2020-01-31 13:37:20 +00:00
Dismissed
@ -0,0 +82,4 @@
}
// GetThread get notification by ID
func (c *Client) GetThread(id int64) (*NotificationThread, error) {
Owner

The function name is not very clear.

The function name is not very clear.
@ -0,0 +91,4 @@
}
// ReadThread mark notification as read by ID
func (c *Client) ReadThread(id int64) error {
Owner

As above.

As above.
6543 added the
status/wip
label 2020-02-02 07:48:53 +00:00
6543 removed the
status/wip
label 2020-02-02 15:16:15 +00:00
Author
Owner

@lunny done

  • GetThread -> GetNotification
  • ReadThread -> ReadNotification
@lunny done * GetThread -> GetNotification * ReadThread -> ReadNotification
lunny approved these changes 2020-02-03 01:06:49 +00:00
Dismissed
lafriks approved these changes 2020-02-04 08:00:31 +00:00
Dismissed
lafriks closed this pull request 2020-02-04 08:03:17 +00:00
lafriks deleted branch add-notifications 2020-02-04 08:03:26 +00:00
lunny referenced this issue from a commit 2020-02-05 07:59:58 +00:00
added pagination options for listing requests (#205) fix golint issue small improvements ListMyRepos now receives a value instead of a pointer reverted makefile changes added sleep in order to increase CI stability resolved conflicts Use RepositoryMeta struct on Issues (#267) Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/267 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: techknowlogick <techknowlogick@gitea.io> extend SearchUsers (#248) Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: spawn2kill <spawn2kill@noreply.gitea.io> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/248 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Implement Repo Transfer (#264) fix test check version add TestRepoTransfer add TransferRepo Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/264 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Add notifications (#226) Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: spawn2kill <spawn2kill@noreply.gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/226 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Use StateType (#265) use StateType Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/265 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> opt setDefaults on issue_comment trigger CI Trigger notification resolved conflicts Fix AddEmail (#260) Merge branch 'master' into fix-AddEMail Add ListIssueCommentOptions for optional param (#243) Merge branch 'master' into impruve-ListXIssueComments Remove ListUserIssues() ... (#262) Merge branch 'master' into rm-ListUserIssues correct version (#257) Merge branch 'master' into targed-version Extend Issue Struct (#258) fix extend IssueTest add Repository to Issue struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/258 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Merge branch 'master' into targed-version format code (#245) fix if test is to fast remove lgtm bot config (gitea handle this now) format code Add GetIssueComment (#216) Merge branch 'master' into update-comment-api Fix & Refactor UserApp Functions (#247) Merge branch 'master' into refactor-user-app Add SearchRepo API Call (#254) Merge branch 'master' into search_repo IssueSubscribtion: Check http Status responce (#242) Merge branch 'master' into impruve-issueWatch Refactor RepoWatch (#241) Merge branch 'master' into refactor-repoWatch Add ListMilestoneOption to ListRepoMilestones (#244) use StateType use PageSize adjut test since gitea bug got fixed (#gitea/10047) add TestMilestones add optional ListMilestoneOption format Add ListOptions struct (#249) same struct as in models/list_options.go add mising license header add ListOptions struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/249 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: lafriks <lafriks@noreply.gitea.io> [README] add import path (#239) add import path add import path to readme Changelog v0.11.0 (#235) Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/235 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: John Olheiser <john.olheiser@gmail.com> Add TestMyUser (#237) Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/237 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/239 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/244 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Andrew Thornton <art27@cantab.net> Merge branch 'master' into refactor-repoWatch Add ListOptions struct (#249) same struct as in models/list_options.go add mising license header add ListOptions struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/249 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: lafriks <lafriks@noreply.gitea.io> add TEST fix GetMyWatchedRepos [README] add import path (#239) add import path add import path to readme Changelog v0.11.0 (#235) Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/235 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: John Ol... Co-authored-by: Hilário Coelho <hilario.coelho@securityside.com> Co-authored-by: 6543 <6543@noreply.gitea.io> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/205 Reviewed-by: 6543 <6543@noreply.gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net>
lunny referenced this issue from a commit 2020-02-05 09:39:08 +00:00
Extend ListDeployKeys (#268) Merge branch 'master' into extend-ListDeployKeys added pagination options for listing requests (#205) fix golint issue small improvements ListMyRepos now receives a value instead of a pointer reverted makefile changes added sleep in order to increase CI stability resolved conflicts Use RepositoryMeta struct on Issues (#267) Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/267 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: techknowlogick <techknowlogick@gitea.io> extend SearchUsers (#248) Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: spawn2kill <spawn2kill@noreply.gitea.io> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/248 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Implement Repo Transfer (#264) fix test check version add TestRepoTransfer add TransferRepo Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/264 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Add notifications (#226) Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: spawn2kill <spawn2kill@noreply.gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/226 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Use StateType (#265) use StateType Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/265 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: lafriks <lafriks@noreply.gitea.io> opt setDefaults on issue_comment trigger CI Trigger notification resolved conflicts Fix AddEmail (#260) Merge branch 'master' into fix-AddEMail Add ListIssueCommentOptions for optional param (#243) Merge branch 'master' into impruve-ListXIssueComments Remove ListUserIssues() ... (#262) Merge branch 'master' into rm-ListUserIssues correct version (#257) Merge branch 'master' into targed-version Extend Issue Struct (#258) fix extend IssueTest add Repository to Issue struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/258 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Merge branch 'master' into targed-version format code (#245) fix if test is to fast remove lgtm bot config (gitea handle this now) format code Add GetIssueComment (#216) Merge branch 'master' into update-comment-api Fix & Refactor UserApp Functions (#247) Merge branch 'master' into refactor-user-app Add SearchRepo API Call (#254) Merge branch 'master' into search_repo IssueSubscribtion: Check http Status responce (#242) Merge branch 'master' into impruve-issueWatch Refactor RepoWatch (#241) Merge branch 'master' into refactor-repoWatch Add ListMilestoneOption to ListRepoMilestones (#244) use StateType use PageSize adjut test since gitea bug got fixed (#gitea/10047) add TestMilestones add optional ListMilestoneOption format Add ListOptions struct (#249) same struct as in models/list_options.go add mising license header add ListOptions struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/249 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: lafriks <lafriks@noreply.gitea.io> [README] add import path (#239) add import path add import path to readme Changelog v0.11.0 (#235) Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/235 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: John Olheiser <john.olheiser@gmail.com> Add TestMyUser (#237) Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/237 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/239 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/244 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Andrew Thornton <art27@cantab.net> Merge branch 'master' into refactor-repoWatch Add ListOptions struct (#249) same struct as in models/list_options.go add mising license header add ListOptions struct Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/249 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: lafriks <lafriks@noreply.gitea.io> add TEST fix GetMyWatchedRepos [README] add import path (#239) add import path add import path to readme Changelog v0.11.0 (#235) Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/235 Reviewed-by:... Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: spawn2kill <spawn2kill@noreply.gitea.io> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/268 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
6543 changed title from Add notifications to Add Notifications 2020-05-21 16:45:45 +00:00
6543 changed title from Add Notifications to Add Notification functions 2020-05-21 17:25:01 +00:00
Sign in to join this conversation.
No description provided.