Amarula.Content.Poll (amarula v0.4.1)

View Source

A received poll (content of a %Amarula.Msg{type: :poll}).

  • :name — the poll question.
  • :options — the answer option names, in order (a list of strings).
  • :selectable — how many options a voter may pick (1 = single-choice); mirrors the :selectable option on Amarula.send_poll/5.
  • :enc_key — the poll's encryption key (votes arrive encrypted under it; see Amarula.Protocol.Messages.PollCrypto).

Summary

Functions

Normalize a %Proto.Message.PollCreationMessage{} (any version) into a %Amarula.Content.Poll{}.

Types

t()

@type t() :: %Amarula.Content.Poll{
  enc_key: binary() | nil,
  name: String.t() | nil,
  options: [String.t()],
  selectable: non_neg_integer() | nil
}

Functions

from_proto(m)

@spec from_proto(struct()) :: t()

Normalize a %Proto.Message.PollCreationMessage{} (any version) into a %Amarula.Content.Poll{}.