# `Issho.Comments.Ops`
[🔗](https://github.com/hattoriai/issho/blob/v0.4.0/lib/issho/comments.ex#L292)

The operations of a room's comments document (`Issho.Engine.Comments`),
for a LiveView, an agent's participant, or your own code to commit:

    ada = Issho.Identity.new(%{id: "user:ada", name: "Ada"})
    {op, %{thread: thread}} = Issho.Comments.Ops.start(ada, place, "Should this go first?")
    {:ok, _} = Issho.Live.transact(room, Issho.Comments.document(room), [op])

A new comment is its author's, as their identity says it (`author/1`),
at the server's time: the comments document's hook holds it to who
commits it.

# `author`

```elixir
@spec author(Issho.Identity.t()) :: map()
```

A comment's author, as an identity says it: its key, name, kind,
avatar and colour, and the key and name of whom it acts for.

# `delete`

```elixir
@spec delete(String.t(), String.t()) :: map()
```

A deletion of one's own comment.

# `edit`

```elixir
@spec edit(String.t(), String.t(), String.t(), keyword()) :: map()
```

An edit of one's own comment.

# `place`

```elixir
@spec place(String.t(), map() | nil) :: map()
```

A thread at another place (its component's content moved).

# `react`

```elixir
@spec react(String.t(), String.t(), String.t()) :: map()
```

A reaction to a comment.

# `reopen`

```elixir
@spec reopen(String.t()) :: map()
```

A thread reopened.

# `reply`

```elixir
@spec reply(Issho.Identity.t(), String.t(), String.t(), keyword()) :: {map(), map()}
```

A reply in a thread: `{op, %{thread: id, comment: id}}`.

# `resolve`

```elixir
@spec resolve(String.t()) :: map()
```

A thread resolved.

# `start`

```elixir
@spec start(Issho.Identity.t(), map() | nil, String.t(), keyword()) :: {map(), map()}
```

A thread at a place, with its first comment: `{op, %{thread: id, comment: id}}`.

# `unreact`

```elixir
@spec unreact(String.t(), String.t(), String.t()) :: map()
```

A reaction taken back.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
