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