View Source Bonfire.Messages (Bonfire v0.9.10-classic-beta.169)

An extension for Bonfire that handles:

  • DM
  • Group messaging

Handy commands

Copyright (c) 2023 Bonfire Contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Summary

Functions

Link to this function

ap_publish_activity(subject, verb, message)

View Source

Publishes an activity to the ActivityPub.

Examples

iex> Bonfire.Messages.ap_publish_activity(subject, verb, message)
Link to this function

ap_receive_activity(creator, activity, object)

View Source

Receives an activity from ActivityPub.

Examples

iex> Bonfire.Messages.ap_receive_activity(creator, activity, object)
Link to this function

changeset(atom, attrs, opts \\ [])

View Source

Save a new message as a draft (without sending it).

Examples

iex> Bonfire.Messages.draft(creator, attrs)
{:ok, %Message{}}

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

Link to this function

filter(atom, arg2, query)

View Source
Link to this function

list(current_user, with_user \\ nil, opts \\ [])

View Source

Lists messages created by the user, excluding replies.

Examples

iex> Bonfire.Messages.list(current_user)
[%Message{}]
Link to this function

list(current_user, with_user, cursor_before, preloads)

View Source
Link to this function

maybe_spam_check(changeset, attrs, context)

View Source

Attempt to read a message by its ID.

Examples

iex> Bonfire.Messages.read(message_id, current_user: me)
%Message{}

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

Link to this function

send(sender_or_context, attrs, to \\ nil)

View Source

Sends a message to the specified recipients.

Examples

iex> Bonfire.Messages.send(me, %{post_content: %{html_body: "test message"}}, to_user_id)