View Source Bonfire.Social.Requests (Bonfire v0.9.11-social-beta.6)

Handles social requests (e.g. follows requests), including creating, accepting, ignoring, and managing requests.

Summary

Functions

Accepts a request.

Retrieves all requests by object.

Retrieves all requests by subject.

Retrieves all request objects by subject.

Retrieves all requested outboxes by user and type.

Retrieves all subjects by object.

Checks if a request exists.

Retrieves a request by filters.

Ignores a request.

Lists all requests made by the current user.

Lists all requesters for the current user.

Lists all requests made by the given user.

Lists all requesters for the given user.

Prepares a DB query based on filters and type.

Requests to do something, and federates it.

Retrieves a request.

Checks if a request has been made.

Functions

accept(request, opts)

Accepts a request.

Examples

iex> accept(request, opts)
{:ok, request}

all_by_object(user, type, opts \\ [])

Retrieves all requests by object.

Examples

iex> all_by_object(user, type, opts)
[{:ok, request}]

all_by_subject(user, type, opts \\ [])

Retrieves all requests by subject.

Examples

iex> all_by_subject(user, type, opts)
[{:ok, request}]

all_objects_by_subject(user, type, opts \\ [])

Retrieves all request objects by subject.

Examples

iex> all_objects_by_subject(user, type, opts)
[object]

all_requested_outboxes(user, type, opts \\ [])

Retrieves all requested outboxes by user and type.

Examples

iex> all_requested_outboxes(user, type, opts)
[outbox_id]

all_subjects_by_object(user, type, opts \\ [])

Retrieves all subjects by object.

Examples

iex> all_subjects_by_object(user, type, opts)
[subject]

ap_publish_activity(subject, verb, action)

exists?(subject, type, object, opts \\ [])

Checks if a request exists.

Examples

iex> exists?(subject, Follow, object, opts)
true

get(filters, opts \\ [])

Retrieves a request by filters.

Examples

iex> get(filters, opts)
{:ok, request}

get(subject, type, object, opts \\ [])

Retrieves a request.

Examples

iex> get(subject, Follow, object, opts)
{:ok, request}

get!(subject, type, object, opts \\ [])

ignore(request, opts)

Ignores a request.

Examples

iex> ignore(request, opts)
{:ok, request}

list_my_requested(opts)

Lists all requests made by the current user.

Examples

iex> list_my_requested(opts)
[{:ok, request}]

list_my_requesters(opts)

Lists all requesters for the current user.

Examples

iex> list_my_requesters(opts)
[{:ok, requester}]

list_requested(user, opts \\ [])

Lists all requests made by the given user.

Examples

iex> list_requested(user, opts)
[{:ok, request}]

list_requesters(user, opts \\ [])

Lists all requesters for the given user.

Examples

iex> list_requesters(user, opts)
[{:ok, requester}]

many(query, opts)

query(filters, type \\ nil, opts)

Prepares a DB query based on filters and type.

Examples

iex> query(filters, type, opts)
{:ok, query}

query_module()

Callback implementation for Bonfire.Common.ContextModule.query_module/0.

request(user, type, object, opts \\ [])

Requests to do something, and federates it.

Examples

iex> request(subject, Follow, object)
{:ok, request}

requested(request, opts \\ [])

Retrieves a request.

Examples

iex> requested(request, current_user: me)
{:ok, request}

requested?(subject, type, object)

Checks if a request has been made.

Examples

iex> requested?(subject, type, object)
true

schema_module()

Callback implementation for Bonfire.Common.ContextModule.schema_module/0.

unrequest(requester, type, object)