module Mastodon::REST::Relationships

Public Instance Methods

authorize_follow_request(id) click to toggle source

Authorize a follow request @param id [Integer]

# File lib/mastodon/rest/relationships.rb, line 30
def authorize_follow_request(id)
  perform_request(:post, "/api/v1/follow_requests/#{id}/authorize")
end
block(id) click to toggle source

Block a user @param id [Integer] @return [Mastodon::Relationship]

# File lib/mastodon/rest/relationships.rb, line 75
def block(id)
  perform_request_with_object(:post, "/api/v1/accounts/#{id}/block", {}, Mastodon::Relationship)
end
blocks(options = {}) click to toggle source

Get a list of blocked accounts @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :min_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::Account>]

# File lib/mastodon/rest/relationships.rb, line 68
def blocks(options = {})
  perform_request_with_collection(:get, '/api/v1/blocks', options, Mastodon::Account)
end
follow(id) click to toggle source

Follow a user @param id [Integer] @return [Mastodon::Relationship]

# File lib/mastodon/rest/relationships.rb, line 43
def follow(id)
  perform_request_with_object(:post, "/api/v1/accounts/#{id}/follow", {}, Mastodon::Relationship)
end
follow_requests(options = {}) click to toggle source

Get a list of pending follow requests @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :min_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::Account>]

# File lib/mastodon/rest/relationships.rb, line 24
def follow_requests(options = {})
  perform_request_with_collection(:get, '/api/v1/follow_requests', options, Mastodon::Account)
end
mute(id) click to toggle source

Mute a user @param id [Integer] @return [Mastodon::Relationship]

# File lib/mastodon/rest/relationships.rb, line 100
def mute(id)
  perform_request_with_object(:post, "/api/v1/accounts/#{id}/mute", {}, Mastodon::Relationship)
end
mute_status(id) click to toggle source

Mute notifications for a status @param id [Integer] @return [Mastodon::Status]

# File lib/mastodon/rest/relationships.rb, line 114
def mute_status(id)
  perform_request_with_object(:post, "/api/v1/statuses/#{id}/mute", {}, Mastodon::Status)
end
mutes(options = {}) click to toggle source

Get a list of muted accounts @param options [Hash] @option options :max_id [Integer] @option options :since_id [Integer] @option options :min_id [Integer] @option options :limit [Integer] @return [Mastodon::Collection<Mastodon::Account>]

# File lib/mastodon/rest/relationships.rb, line 93
def mutes(options = {})
  perform_request_with_collection(:get, '/api/v1/mutes', options, Mastodon::Account)
end
reject_follow_request(id) click to toggle source

Reject a follow request @param id [Integer]

# File lib/mastodon/rest/relationships.rb, line 36
def reject_follow_request(id)
  perform_request(:post, "/api/v1/follow_requests/#{id}/reject")
end
relationships(*ids) click to toggle source

Get the relationships of authenticated user towards given other users @param ids [Integer] @return [Mastodon::Collection<Mastodon::Relationship>]

# File lib/mastodon/rest/relationships.rb, line 13
def relationships(*ids)
  perform_request_with_collection(:get, '/api/v1/accounts/relationships', { 'id[]': ids }, Mastodon::Relationship)
end
remote_follow(uri) click to toggle source

Follow a remote user @param uri [String] username@domain of the person you want to follow @return [Mastodon::Account]

# File lib/mastodon/rest/relationships.rb, line 50
def remote_follow(uri)
  perform_request_with_object(:post, '/api/v1/follows', { uri: uri }, Mastodon::Account)
end
unblock(id) click to toggle source

Unblock a user @param id [Integer] @return [Mastodon::Relationship]

# File lib/mastodon/rest/relationships.rb, line 82
def unblock(id)
  perform_request_with_object(:post, "/api/v1/accounts/#{id}/unblock", {}, Mastodon::Relationship)
end
unfollow(id) click to toggle source

Unfollow a user @param id [Integer] @return [Mastodon::Relationship]

# File lib/mastodon/rest/relationships.rb, line 57
def unfollow(id)
  perform_request_with_object(:post, "/api/v1/accounts/#{id}/unfollow", {}, Mastodon::Relationship)
end
unmute(id) click to toggle source

Unmute a user @param id [Integer] @return [Mastodon::Relationship]

# File lib/mastodon/rest/relationships.rb, line 107
def unmute(id)
  perform_request_with_object(:post, "/api/v1/accounts/#{id}/unmute", {}, Mastodon::Relationship)
end
unmute_status(id) click to toggle source

Unmute notifications for a status @param id [Integer] @return [Mastodon::Status]

# File lib/mastodon/rest/relationships.rb, line 121
def unmute_status(id)
  perform_request_with_object(:post, "/api/v1/statuses/#{id}/unmute", {}, Mastodon::Status)
end