View Source Bonfire.Messages (Bonfire v0.9.10-classic-beta.169)
An extension for Bonfire that handles:
- DM
- Group messaging
Handy commands
Copyright and License
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
Publishes an activity to the ActivityPub.
Receives an activity from ActivityPub.
Save a new message as a draft (without sending it).
Callback implementation for Bonfire.Federate.ActivityPub.FederationModules.federation_module/0
.
Lists messages created by the user, excluding replies.
Attempt to read a message by its ID.
Callback implementation for Bonfire.Common.ContextModule.schema_module/0
.
Sends a message to the specified recipients.
Functions
Publishes an activity to the ActivityPub.
Examples
iex> Bonfire.Messages.ap_publish_activity(subject, verb, message)
Receives an activity from ActivityPub.
Examples
iex> Bonfire.Messages.ap_receive_activity(creator, activity, object)
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
.
Lists messages created by the user, excluding replies.
Examples
iex> Bonfire.Messages.list(current_user)
[%Message{}]
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
.
Sends a message to the specified recipients.
Examples
iex> Bonfire.Messages.send(me, %{post_content: %{html_body: "test message"}}, to_user_id)