Add DismissNotification (Mastodon 1.3+)
authorMikael Berthe <mikael@lilotux.net>
Fri, 28 Apr 2017 13:28:16 +0200
changeset 148 ae2cbcf18b55
parent 147 b682706e2f31
child 149 5f922977d7c7
Add DismissNotification (Mastodon 1.3+)
notifications.go
--- a/notifications.go	Fri Apr 28 11:47:18 2017 +0200
+++ b/notifications.go	Fri Apr 28 13:28:16 2017 +0200
@@ -40,6 +40,17 @@
 	return &notification, nil
 }
 
+// DismissNotification deletes a notification
+func (mc *Client) DismissNotification(notificationID int) error {
+	if notificationID < 1 {
+		return ErrInvalidID
+	}
+
+	endPoint := "notifications/dismiss"
+	params := apiCallParams{"id": strconv.Itoa(notificationID)}
+	return mc.apiCall(endPoint, rest.Post, params, &Notification{})
+}
+
 // ClearNotifications deletes all notifications from the Mastodon server for
 // the authenticated user
 func (mc *Client) ClearNotifications() error {