notifications.go
changeset 138 23d3a518d0ad
parent 132 639bbcddb4fe
child 148 ae2cbcf18b55
--- a/notifications.go	Wed Apr 19 09:30:47 2017 +0200
+++ b/notifications.go	Wed Apr 19 10:43:38 2017 +0200
@@ -4,7 +4,7 @@
 Licensed under the MIT license.  Please see the LICENSE file is this directory.
 */
 
-package gondole
+package madon
 
 import (
 	"strconv"
@@ -13,9 +13,9 @@
 )
 
 // GetNotifications returns the list of the user's notifications
-func (g *Client) GetNotifications() ([]Notification, error) {
+func (mc *Client) GetNotifications() ([]Notification, error) {
 	var notifications []Notification
-	if err := g.apiCall("notifications", rest.Get, nil, &notifications); err != nil {
+	if err := mc.apiCall("notifications", rest.Get, nil, &notifications); err != nil {
 		return nil, err
 	}
 	return notifications, nil
@@ -24,14 +24,14 @@
 // GetNotification returns a notification
 // The returned notification can be nil if there is an error or if the
 // requested notification does not exist.
-func (g *Client) GetNotification(notificationID int) (*Notification, error) {
+func (mc *Client) GetNotification(notificationID int) (*Notification, error) {
 	if notificationID < 1 {
 		return nil, ErrInvalidID
 	}
 
 	var endPoint = "notifications/" + strconv.Itoa(notificationID)
 	var notification Notification
-	if err := g.apiCall(endPoint, rest.Get, nil, &notification); err != nil {
+	if err := mc.apiCall(endPoint, rest.Get, nil, &notification); err != nil {
 		return nil, err
 	}
 	if notification.ID == 0 {
@@ -42,6 +42,6 @@
 
 // ClearNotifications deletes all notifications from the Mastodon server for
 // the authenticated user
-func (g *Client) ClearNotifications() error {
-	return g.apiCall("notifications/clear", rest.Post, nil, &Notification{})
+func (mc *Client) ClearNotifications() error {
+	return mc.apiCall("notifications/clear", rest.Post, nil, &Notification{})
 }