# HG changeset patch # User Mikael Berthe # Date 1493378896 -7200 # Node ID ae2cbcf18b5563cfa5b572e26bcf4856e9e6a5c8 # Parent b682706e2f319ee5916b61d0c9e6a5ac143e3acf Add DismissNotification (Mastodon 1.3+) diff -r b682706e2f31 -r ae2cbcf18b55 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 ¬ification, 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 {