Add Notification functions #226
No reviewers
Labels
No Label
has/backport
has/pull
in progress
invalid
kind/breaking
kind/bug
kind/build
kind/deployment
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/proposal
kind/question
kind/refactor
kind/security
kind/testing
kind/translation
kind/ui
need/backport
priority/critical
priority/low
priority/maybe
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Depends on
#241 Refactor RepoWatch
gitea/go-sdk
#249 Add ListOptions struct
gitea/go-sdk
Reference: gitea/go-sdk#226
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "6543/go-sdk:add-notifications"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
as title
add notificationsto Add notifications@ -0,0 +16,4 @@
Repository *Repository `json:"repository"`
Subject *NotificationSubject `json:"subject"`
Unread bool `json:"unread"`
Pinned bool `json:"pinned"`
It seems we haven't implement pin yet.
@lunny Pinned is implemented ... but gitea handle it with read/unread ...
and currently a notification can have 3 states: "read"/"unread"/"pinned"
gitea "pinned" = read&pinned
unread&pinned does not exist
Please add some tests
@ -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)
removing the header so Client can apply its own (and let Auth work as usual)
needed for the TEST (otherwhise sudo API wont work)
more extend fix/refactor is at #241
@lunny done
6543 referenced this pull request2020-01-30 22:38:18 +00:00
@ -23,19 +22,16 @@ type WatchInfo struct {
// GetWatchedRepos list all the watched repos of user
func (c *Client) GetWatchedRepos(user, pass string) ([]*Repository, error) {
Then remove the
pass
parameter?@lunny refactor&fix of this function is done in #241 if that one get merged this changes are not needed anymore
@lunny
coverage: 26.8%
🎉@ -0,0 +82,4 @@
}
// GetThread get notification by ID
func (c *Client) GetThread(id int64) (*NotificationThread, error) {
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 {
As above.
@lunny done
Add notificationsto Add NotificationsAdd Notificationsto Add Notification functions