# Communication

> Communication is where a Vigil organization talks and keeps its record. Chats carry text, voice notes, photos, calls, beacon scans, patrols and gate entries.

Source: https://vigilsecure.net/docs/concepts/communication/

Communication is where your organization talks, and where its record is kept. A chat in
Vigil carries more than text. Beacon scans, patrol requests, vehicles and people at the gate
are all messages in a chat, each with a time and an author. That is why a patrol, a gate
entry and the conversation around them end up on one timeline.

You find it under **Communication** in the console, and under **Chats** in the guard app.

## Chats

There are two kinds of chat you create, and one Vigil creates.

| Kind                     | What it is                                                                                                                          |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| **Direct chat**          | A conversation between exactly two participants: two people, or a person and an agent. It cannot be renamed or closed.              |
| **Group**                | A named chat with any number of people and agents. Its owners can rename it, add and remove members and archive it.                 |
| **Notification channel** | A private channel Vigil keeps for each agent, where it posts the agent's due schedules and fired triggers. Nobody else posts in it. |

A chat is visible only to its participants. Belonging to an organization does not let
somebody read a chat they are not in.

### Start a chat

1. In **Communication**, choose **New conversation** (the **+** button).
2. Search for a person or an [agent](https://vigilsecure.net/docs/concepts/agents.md) and choose them to open a
   direct chat. If you have spoken before, the same chat reopens.
3. For a group, choose **New group**, enter a **Group name**, tick the members and choose
   **Create group**.

The person who creates a group is its owner. Open the chat header to see **Channel
details**, where owners manage members, make somebody else an owner and archive the chat.

### Find and manage chats

- Filter the list by **All**, **Unread**, **Groups** or **Direct**.
- The search box finds chats by name and messages by their text.
- Right-click a chat to mute its notifications, for 15 minutes up to 24 hours, or until you
  turn them back on.
- Archiving a group makes it read-only. Vigil keeps the conversation, because it may be
  evidence.

## What a message can be

| Message                        | What it carries                                                                         | Who sends it             |
| ------------------------------ | --------------------------------------------------------------------------------------- | ------------------------ |
| **Text**                       | Plain text, with `@` mentions                                                           | Everyone                 |
| **Voice note**                 | A recording. Vigil adds a transcript so it can be read and searched.                    | Everyone                 |
| **Photo**                      | A picture with an optional caption                                                      | Everyone                 |
| **Video**, **audio**, **file** | An attachment of up to 25 MB                                                            | Console users and agents |
| **Voice call**                 | A live call. The message is the invitation and, afterwards, the record of who joined.   | Console users            |
| **Beacon scan**                | Proof that a user was at a [beacon](https://vigilsecure.net/docs/concepts/beacons.md), with the time of the scan | Guards and console users |
| **Patrol request**             | A list of beacons to scan within a time window, with live progress                      | Agents                   |
| **Vehicle**                    | A vehicle going in or out of a site: plate, licence disc, driver, passengers and reason | Guards                   |
| **Person**                     | A person going in or out on foot: identity document and reason                          | Guards                   |

### Replies, mentions and ticks

- **Reply** to a message to quote it. Choosing the quote jumps back to the original.
- Type `@` in a group to **mention** a participant. Mentioning an agent is how you ask it to
  answer in a group.
- Ticks on your own messages show how far they got: a clock while sending, one tick when
  sent, two ticks when delivered, and coloured ticks when read. In a group, the ticks fill in
  once everybody has received or read the message.

### Voice notes

Record a voice note from the composer in the console or the guard app. Vigil transcribes it
as it is posted, so a supervisor can read what a guard said without playing it, and an agent
can act on it. An agent that is sent a voice note answers with one.

### Voice calls

In the console, choose **Start voice call** in a chat header. The call appears as a card in
the chat with **Join**. Anyone in the chat can join while it is live.

- In a direct chat, leaving ends the call for both people.
- In a group, the call goes on until one person has been alone on it for a minute, or the
  person who started it chooses **End for all**.
- A call that nobody else joins ends by itself after a minute.

Calls are available in the console and the desktop app.

## Operational messages

### Beacon scans

A scan is a message that says "this user was at this beacon at this time", backed by proof:
the QR code they read, or a GPS position inside the beacon's area. Vigil checks the proof
before it accepts the scan. If the device was offline, the message keeps the time the scan
actually happened.

See [Beacons](https://vigilsecure.net/docs/concepts/beacons.md) for how guards scan.

### Patrol requests

A patrol request asks whoever reads it to scan a set of beacons, in any order, between a
start and an end time. It shows as a card with a checklist: **3 of 7 scanned**, then **All 7
scanned**. Each scan in that chat during the window ticks off its beacon.

Agents send patrol requests, on a schedule or when somebody asks them to. See
[Guard patrols](https://vigilsecure.net/docs/examples/guard-patrols.md).

### Vehicles and people

At a gate, a guard records each vehicle and person going in or out. The chat shows a card
titled **Vehicle in**, **Vehicle out**, **Person in** or **Person out** with what was
captured. Photos the guard takes are posted as replies to it. When a vehicle or person leaves within 48 hours of coming in, Vigil links the exit
to their entry and shows how long they were on site. Expired licence discs and driver's licences are flagged.

See [Gate access control](https://vigilsecure.net/docs/examples/gate-access-control.md).

## Default chats

Some things start outside any chat, such as a beacon scan from the map in the guard app.
Each user has a default chat for each of these, per organization:

| Kind             | What goes there                             |
| ---------------- | ------------------------------------------- |
| **Beacon scans** | Scans started from the map                  |
| **Panics**       | Panic alerts                                |
| **Push-to-talk** | Presses of the device's push-to-talk button |

Until somebody chooses one, all three use the user's oldest chat. For a new member that is
their chat with the Operations agent. A guard changes it by long-pressing a chat in the
guard app and choosing **Send here**; an agent can change it for them.

> **Rolling out:** Scans from the map use their default chat today. Panic alerts and push-to-talk radio are
> being rolled out.

## Webhooks: let another system post into a chat

A webhook lets another system post messages into a group chat: an alarm panel, a vehicle
tracker, a monitoring tool. Vigil gives you a secret web address for the chat, and whoever
looks after the other system enters that address in its settings.

1. Open the group's **Channel details** and, under **Webhooks**, choose **New**.
2. Enter a **Name**, such as `Alarm panel`. Messages appear under this name.
3. Choose **Create webhook** and copy the **Webhook URL**. It is shown once.
4. Give the address to the person who sets up the other system, such as your alarm
   installer. [Post into a chat with a webhook](https://vigilsecure.net/docs/developers/webhooks.md) tells them
   exactly what to send.

Things to know about webhooks:

- The address is the only key. Anyone who has it can post into that chat, so treat it like
  a password and **Revoke** it if it leaks.
- A webhook can only post text into its own chat. It cannot read anything.

See [Alarm and system alerts](https://vigilsecure.net/docs/examples/alarm-integrations.md).

## Notifications

The console asks to show browser notifications for new messages while Vigil is in the
background. On a device, a new message gives a sound and a double buzz unless the chat is
muted.

## Related

- [The guard app](https://vigilsecure.net/docs/concepts/guard-app.md)
- [Agents](https://vigilsecure.net/docs/concepts/agents.md)
- [Frequently asked questions](https://vigilsecure.net/docs/faq.md#chats-and-messages)
