notifications.go
changeset 149 5f922977d7c7
parent 148 ae2cbcf18b55
child 155 0c581e0108da
--- a/notifications.go	Fri Apr 28 13:28:16 2017 +0200
+++ b/notifications.go	Fri Apr 28 15:43:11 2017 +0200
@@ -13,9 +13,9 @@
 )
 
 // GetNotifications returns the list of the user's notifications
-func (mc *Client) GetNotifications() ([]Notification, error) {
+func (mc *Client) GetNotifications(lopt *LimitParams) ([]Notification, error) {
 	var notifications []Notification
-	if err := mc.apiCall("notifications", rest.Get, nil, &notifications); err != nil {
+	if err := mc.apiCall("notifications", rest.Get, nil, lopt, &notifications); err != nil {
 		return nil, err
 	}
 	return notifications, nil
@@ -31,7 +31,7 @@
 
 	var endPoint = "notifications/" + strconv.Itoa(notificationID)
 	var notification Notification
-	if err := mc.apiCall(endPoint, rest.Get, nil, &notification); err != nil {
+	if err := mc.apiCall(endPoint, rest.Get, nil, nil, &notification); err != nil {
 		return nil, err
 	}
 	if notification.ID == 0 {
@@ -48,11 +48,11 @@
 
 	endPoint := "notifications/dismiss"
 	params := apiCallParams{"id": strconv.Itoa(notificationID)}
-	return mc.apiCall(endPoint, rest.Post, params, &Notification{})
+	return mc.apiCall(endPoint, rest.Post, params, nil, &Notification{})
 }
 
 // ClearNotifications deletes all notifications from the Mastodon server for
 // the authenticated user
 func (mc *Client) ClearNotifications() error {
-	return mc.apiCall("notifications/clear", rest.Post, nil, &Notification{})
+	return mc.apiCall("notifications/clear", rest.Post, nil, nil, &Notification{})
 }