Bonfire.Poll.Questions (Bonfire v1.0.1-social-alpha.28)

View Source

Summary

Functions

Serializes a poll question as an ActivityStreams Question object and wraps in a Create/Update activity for federation.

Receives an incoming ActivityPub Question (poll) activity and creates/updates the local poll question.

List posts created by the user and which are in their outbox, which are not replies

List posts with pagination

Returns true if proposal period has ended for the poll.

Returns true if proposal period is currently open for the poll.

Query posts with pagination

Returns true if voting has ended for the poll.

Returns true if voting is currently open for the poll.

Functions

ap_publish_activity(subject, verb, question)

Serializes a poll question as an ActivityStreams Question object and wraps in a Create/Update activity for federation.

Parameters

  • subject: who is performing the action
  • verb: :create or :update
  • question: poll question struct

ap_receive_activity(creator, activity, question_data)

Receives an incoming ActivityPub Question (poll) activity and creates/updates the local poll question.

Parameters

  • creator: the actor creating/updating the poll
  • activity: the AP activity
  • object: the AP Question object

changeset(question \\ %Bonfire.Poll.Question{}, attrs)

create(options \\ [])

create_simple(question)

default_voting_format()

end_date(arg1)

federation_module()

Callback implementation for Bonfire.Federate.ActivityPub.FederationModules.federation_module/0.

get_by_uri(uri, opts \\ [])

list_by(by_user, opts \\ [])

List posts created by the user and which are in their outbox, which are not replies

list_paginated(filters, opts \\ [])

List posts with pagination

proposal_ended?(question)

Returns true if proposal period has ended for the poll.

proposal_open?(question)

Returns true if proposal period is currently open for the poll.

query(filters \\ [], opts \\ nil)

query_module()

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

query_paginated(filters, opts \\ [])

Query posts with pagination

read(post_id, opts_or_socket_or_current_user \\ [])

schema_module()

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

update_choices(creator, question, choices)

update_question(creator, question, attrs)

update_question_and_choices(creator, question, attrs)

voting_ended?(question)

Returns true if voting has ended for the poll.

voting_open?(question)

Returns true if voting is currently open for the poll.