+++
title = "Contacts"
weight = 3
+++

The **Contacts** view shows all nodes in your mesh network. The sidebar lists contacts; the content area shows the chat or management view for the selected contact.

## Contact List

Each contact shows its name, type icon, and routing status (Direct, Flood, Smart, or number of hops). Unread messages are indicated with a badge.

**Filtering and sorting:**

- **Search bar** -- filter contacts by name.
- **Filter button** -- show All, Favorites, or filter by type (Users, Repeaters, Room Servers, Sensors).
- **Sort button** -- sort by name (A-Z), heard recently, or latest messages. Optionally pin favorites to the top.

## Adding Contacts

Click the **+** button in the sidebar header:

- **Discover Contacts** -- shows nodes heard via advertisements that aren't in your contact list yet. Click the + button next to a node to add it. Reopen to see newly received advertisements.
- **Add Manually** -- enter the contact's type, name, and 64-character hex public key.
- **Import from Clipboard** -- paste a `meshcore://contact/add?...` URL (e.g., received from another user who exported their contact). Automatically detects and parses the contact information.
- **Scan QR Code** -- scan a QR code containing a `meshcore://` URL for a contact or channel. Uses the XDG Camera Portal with PipeWire and GStreamer for video capture. Supports both contact (`meshcore://contact/add?...`) and channel (`meshcore://channel/add?...`) QR codes. Requires camera permissions in Flatpak settings.

## Contact Details
To access the **contact details**, you can either click the three-dot button, that appears when you hover the mouse over a contact in the contact list, or long-press a contact in the contact list, or click the name of the contact above the chat.

### Contact Info

Click the contact name in the chat header to open the detail dialog:

- **Name** -- editable; changes are sent to the device when confirmed.
- **Favorite** -- toggle to pin the contact in your list.
- **Type** -- Chat, Repeater, Room, or Sensor.
- **Public Key** -- full 64-character hex key with a copy button.
- **Last Seen** -- when the contact last advertised.
- **Location** -- if the contact has GPS coordinates, shown with a "Show on Map" button.

### Routing

The **Routing** section in the contact detail lets you choose between two routing strategies and their settings:

**Classic** -- is very similar to the behavior of the official client. If there is no established path between you and the contact, the message is flood routed with up to 3 attempts. If an established path exists, it is used to route the message with up to 4 attempts. The 5th attempt is flood routed unless **Automatically Reset Path** is disabled. If no attempt is successful, it switches to flood routing and tries to find a new path.

If an established path exists, it is pre-filled in the **Out Path** field in the form of comma-separated hex hop identifiers (e.g., `9a,74` for 1-byte hashes, `9a3b,744c` for 2-byte). The hash size is auto-detected from the hop length.

The **Classic** routing allows you to:

- **manually set a path** by typing it in the **Out Path** field.
- **reset the path** when you know the established path is outdated and you would like to directly switch to flood routing to discover a new one.
- disable **Automatically Reset Path** when you don't want to automatically switch to flood routing after failed delivery attempts. Useful in situations when the established path is not stable, but you still trust it to deliver the message and want to avoid flood routing.
- **force flood** when you only want to use flood routing without establishing a path. Please note that the flood routing is very expensive for the mesh network and should be avoided unless necessary.
- **show Path on Map**, which visualizes the route on a map with colored markers at each hop.

**Smart** -- tries to solve the main problem with classic routing, which is that it uses only one path for delivery attempts. Instead, it uses a list of recently successful paths and intelligently selects the best one for each attempt.

If there are no available paths on the list, it uses flood routing with up to 3 attempts, like the classic routing. If delivery is successful, the path used is added to the list with an initial weight of 2.5. Each additional successful delivery increases the path's weight by 0.5, while an unsuccessful delivery decreases it by 0.2. If a path is discovered by the firmware (e.g. via a message received from the contact), it is added to the list with an initial weight of 1.0. The weight is capped at 5.0. If a path's weight drops to 0, it is removed from the list. The weight serves as a health indicator -- it keeps useful paths in the pool and prunes dead ones, but it does not determine the order in which paths are tried.

If there are multiple paths on the list, smart routing selects the best path for each delivery attempt (up to 4 attempts total). The selection is based on a composite **score** that combines three factors:

  | Factor | Weight | Formula |
  |--------|--------|---------|
  | Reliability | 60% | *(successes + 1) / (total_attempts + 2)* -- Laplace-smoothed success rate |
  | Latency | 20% | *1 / (1 + last_trip_ms / 10 000)* -- lower latency → higher score (0.5 if unknown) |
  | Recency | 20% | *1 / (1 + age_days)* -- days since last successful delivery (0 if never) |

  **score = reliability × 0.6 + latency × 0.2 + recency × 0.2**

Each attempt uses a different path from the available pool, selected by highest score. If there are fewer paths than attempts, the best paths can be reused. The 5th attempt is always flood routed unless **Automatically Reset Path** is disabled. If there are no paths left in the list, it automatically switches to flood routing and tries to find a new path.

Clicking **Available Paths** gives you a list of recently successful paths, showing their weights, the number of successful and unsuccessful attempts, the number of hops and the time taken for the last delivery. Each path is color-coded with a dot for easy identification. Clicking the **map icon** in the header bar opens a map dialog showing all available paths simultaneously, each drawn as a colored line matching its dot in the list. This allows you to visually compare routes and see which repeaters they pass through. If the list is outdated and no longer useful for routing, click the **Clear History** button. This will forget all paths and switch routing to flood to find new paths.

**Choosing between Classic and Smart:**

  | Classic | Smart |
  |-------|-------|
  | Direct manual control over paths | Automatic path selection based on history |
  | Better for mobile nodes | Better for stationary nodes |
  | Useful for troubleshooting | Learns optimal routes over time |
  | Single path at a time | Multiple paths with quality tracking |

### Actions

For **Repeaters** and **Room Servers**, additional actions are available:

- **Room Management** -- opens the room management interface (requires login). Available for Room Servers.
- **Repeater Management** -- opens the repeater management interface (requires login). Available for Repeaters.
- **Ping** -- measures round-trip time and SNR to the node.
- **Discover Paths** -- sends a flood-routed message to discover a path to the node.
- **Regions** -- queries the repeater for the regions it has set up.

### Danger Zone:

- **Remove Contact** -- deletes the contact and all message history (requires confirmation).
