View Source Mobilizon.Conversations (Mobilizon v5.0.0-beta.1)
The conversations context
Summary
Functions
Creates a conversation.
Delete a conversation.
Get a paginated list of conversations for an actor
Get a conversation by it's ID
Get a conversation by it's ID
Create a response to a conversation
Update a conversation.
Update a conversation participant. Only their read status for now
Functions
@spec count_unread_conversation_participants_for_person(integer() | String.t()) :: non_neg_integer()
@spec create_conversation(map()) :: {:ok, Mobilizon.Conversations.Conversation.t()} | {:error, atom(), Ecto.Changeset.t(), map()}
Creates a conversation.
@spec delete_conversation(Mobilizon.Conversations.Conversation.t()) :: {:ok, %{comments: {integer() | nil, any()}}} | {:error, :comments, Ecto.Changeset.t(), map()}
Delete a conversation.
@spec find_conversations_for_actor( Mobilizon.Actors.Actor.t(), integer() | nil, integer() | nil ) :: Mobilizon.Storage.Page.t(Mobilizon.Conversations.Conversation.t())
Get a paginated list of conversations for an actor
Link to this function
find_conversations_for_event(event_id, actor_id, page \\ nil, limit \\ nil)
View Source@spec find_conversations_for_event( String.t() | integer(), String.t() | integer(), integer() | nil, integer() | nil ) :: Mobilizon.Storage.Page.t(Mobilizon.Conversations.ConversationParticipant.t())
@spec get_conversation(String.t() | integer()) :: Mobilizon.Conversations.Conversation.t() | nil
Get a conversation by it's ID
@spec get_conversation_participant(String.t() | integer()) :: Mobilizon.Conversations.Conversation.t() | nil
Get a conversation by it's ID
Link to this function
get_participant_by_conversation_and_actor(conversation_id, actor_id)
View Source
Link to this function
list_conversation_participants_for_actor(actor_id, page \\ nil, limit \\ nil)
View Source@spec list_conversation_participants_for_actor( integer() | String.t(), integer() | nil, integer() | nil ) :: Mobilizon.Storage.Page.t(Mobilizon.Conversations.ConversationParticipant.t())
@spec list_conversation_participants_for_conversation(integer() | String.t()) :: [ Mobilizon.Conversations.ConversationParticipant.t() ]
Link to this function
list_conversation_participants_for_user(user_id, page \\ nil, limit \\ nil)
View Source@spec list_conversation_participants_for_user( integer() | String.t(), integer() | nil, integer() | nil ) :: Mobilizon.Storage.Page.t(Mobilizon.Conversations.ConversationParticipant.t())
@spec reply_to_conversation(Mobilizon.Conversations.Conversation.t(), map()) :: {:ok, Mobilizon.Conversations.Conversation.t()} | {:error, atom(), Ecto.Changeset.t(), map()}
Create a response to a conversation
@spec update_conversation(Mobilizon.Conversations.Conversation.t(), map()) :: {:ok, Mobilizon.Conversations.Conversation.t()} | {:error, Ecto.Changeset.t()}
Update a conversation.
Link to this function
update_conversation_participant(conversation_participant, attrs \\ %{})
View Source@spec update_conversation_participant( Mobilizon.Conversations.ConversationParticipant.t(), map() ) :: {:ok, Mobilizon.Conversations.ConversationParticipant.t()} | {:error, Ecto.Changeset.t()}
Update a conversation participant. Only their read status for now