Amarula.Group (amarula v0.1.0)

View Source

A group chat — the consumer-facing view of group metadata, with addresses as Amarula.Address. Built from the protocol metadata (Groups.Metadata) at the boundary; you get these from Amarula.group_metadata/2 and Amarula.list_groups/1.

A group is a container of participants, not a person: :address names the group (:group kind), :participants are the member Amarula.Addresses.

Summary

Types

participant()

@type participant() :: %{
  address: Amarula.Address.t(),
  admin: :admin | :superadmin | nil
}

t()

@type t() :: %Amarula.Group{
  address: Amarula.Address.t(),
  owner: Amarula.Address.t() | nil,
  participants: [participant()],
  size: non_neg_integer(),
  subject: String.t() | nil
}

Functions

from_metadata(meta)

@spec from_metadata(map()) :: t()

Build a Group from a Amarula.Protocol.Groups.Metadata map.