equal
deleted
inserted
replaced
38 return nil, ErrEntityNotFound |
38 return nil, ErrEntityNotFound |
39 } |
39 } |
40 return ¬ification, nil |
40 return ¬ification, nil |
41 } |
41 } |
42 |
42 |
|
43 // DismissNotification deletes a notification |
|
44 func (mc *Client) DismissNotification(notificationID int) error { |
|
45 if notificationID < 1 { |
|
46 return ErrInvalidID |
|
47 } |
|
48 |
|
49 endPoint := "notifications/dismiss" |
|
50 params := apiCallParams{"id": strconv.Itoa(notificationID)} |
|
51 return mc.apiCall(endPoint, rest.Post, params, &Notification{}) |
|
52 } |
|
53 |
43 // ClearNotifications deletes all notifications from the Mastodon server for |
54 // ClearNotifications deletes all notifications from the Mastodon server for |
44 // the authenticated user |
55 // the authenticated user |
45 func (mc *Client) ClearNotifications() error { |
56 func (mc *Client) ClearNotifications() error { |
46 return mc.apiCall("notifications/clear", rest.Post, nil, &Notification{}) |
57 return mc.apiCall("notifications/clear", rest.Post, nil, &Notification{}) |
47 } |
58 } |