Files
self c1f4339dde refactor: move Aether into TribeOne plugin namespace
Use TribeOne.TribesPlugin.Aether modules throughout the plugin and expose chat@1 from the entry module for capability-based consumers.
2026-05-26 01:13:28 +02:00

36 lines
1011 B
Elixir

defmodule TribeOne.TribesPlugin.Aether.Chat.Backends.PublicSync do
@moduledoc """
Plaintext Ash-backed chat backend for public and local DM-style conversations.
"""
@behaviour TribeOne.TribesPlugin.Aether.Chat.Backend
alias TribeOne.TribesPlugin.Aether.Chat
alias TribeOne.TribesPlugin.Aether.Chat.Channel
@impl true
def capabilities do
%{
canonical_store: :ash,
nostr_compatible?: false,
non_custodial_signing?: false,
conversation_kinds: [:group, :context_group, :dm],
read_only?: false
}
end
@impl true
def ensure_conversation(attrs, opts) when is_map(attrs), do: Chat.ensure_channel(attrs, opts)
@impl true
def list_messages(%Channel{} = channel, opts), do: Chat.list_messages(channel, opts)
@impl true
def send_message(%Channel{} = channel, attrs, opts) when is_map(attrs) do
Chat.post_message(channel, attrs, opts)
end
@impl true
def subscribe(%Channel{} = channel, _pid, _opts), do: Chat.subscribe_channel(channel)
end