Module: Mastodon::REST::Conversations

Includes:
Utils
Included in:
API
Defined in:
lib/mastodon/rest/conversations.rb

Instance Method Summary collapse

Methods included from Utils

#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object

Instance Method Details

#conversations(options = {}) ⇒ Mastodon::Collection<Mastodon::Conversation>

Get a list of conversations

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :min_id (Integer)
  • :limit (Integer)

Returns:



16
17
18
# File 'lib/mastodon/rest/conversations.rb', line 16

def conversations(options = {})
  perform_request_with_collection(:get, '/api/v1/conversations', options, Mastodon::Conversation)
end

#delete_conversation(id) ⇒ Object

Delete a conversation. Does not delete statuses in the conversation

Parameters:

  • id (Integer)


29
30
31
# File 'lib/mastodon/rest/conversations.rb', line 29

def delete_conversation(id)
  perform_request(:delete, "/api/v1/conversations/#{id}")
end

#mark_conversation_as_read(id) ⇒ Mastodon::Conversation

Mark a conversation as read

Parameters:

  • id (Integer)

Returns:



23
24
25
# File 'lib/mastodon/rest/conversations.rb', line 23

def mark_conversation_as_read(id)
  perform_request_with_object(:post, "/api/v1/conversations/#{id}/read", {}, Mastodon::Conversation)
end