hunter v0.5.1 Hunter.Notification View Source

Notification entity

This module defines a Hunter.Notification struct and the main functions for working with Notifications.

Fields

  • id - The notification ID
  • type - One of: "mention", "reblog", "favourite", "follow"
  • created_at - The time the notification was created
  • account - The Hunter.Account sending the notification to the user
  • status - The Hunter.Status associated with the notification, if applicable

Link to this section Summary

Functions

Dismiss a single notification

Deletes all notifications from the Mastodon server for the authenticated user

Retrieve single notification

Retrieve user's notifications

Link to this section Types

Link to this type

t() View Source
t() :: %Hunter.Notification{
  account: Hunter.Account.t(),
  created_at: String.t(),
  id: String.t(),
  status: Hunter.Status.t(),
  type: String.t()
}

Link to this section Functions

Link to this function

clear_notification(conn, id) View Source
clear_notification(Hunter.Client.t(), non_neg_integer()) :: boolean()

Dismiss a single notification

Parameters

  • conn - connection credentials
  • id - notification id
Link to this function

clear_notifications(conn) View Source
clear_notifications(Hunter.Client.t()) :: boolean()

Deletes all notifications from the Mastodon server for the authenticated user

Parameters

  • conn - connection credentials

Retrieve single notification

Parameters

  • conn - connection credentials
  • id - notification identifier

Examples

Hunter.Notification.notification(conn, 17_476)
#=> %Hunter.Notification{account: %{"acct" => "paperswelove@mstdn.io", ...}
Link to this function

notifications(conn, options \\ []) View Source
notifications(Hunter.Client.t(), Keyword.t()) :: [Hunter.Notification.t()]

Retrieve user's notifications

Parameters

  • conn - connection credentials
  • options - option list

Options

  • max_id - get a list of notifications with id less than or equal this value
  • since_id - get a list of notifications with id greater than this value
  • limit - maximum number of notifications to get, default: 15, max: 30

Examples

Hunter.Notification.notifications(conn)
#=> [%Hunter.Notification{account: %{"acct" => "paperswelove@mstdn.io", ...}]