Skip to main content
Message Privately lets users start a direct 1:1 conversation with another group member without leaving the group context. Selecting it opens a normal 1:1 user chat — the resulting conversation is not group-scoped. The user can return to the group after the private chat. cometchat-message-list provides this as a built-in action. The “Message Privately” option appears only in group chats, and only for messages sent by other users. It is controlled by the hideMessagePrivatelyOption property, which defaults to false, so the action is shown by default. When a user selects it, the (messagePrivatelyClick) output emits the target message and user. Before starting, complete the Integration Guide.

Components


Implementation Steps

1. Handle the Built-in “Message Privately” Action (Canonical)

The canonical way to launch a private chat is the built-in action on cometchat-message-list. Bind the (messagePrivatelyClick) output to open a 1:1 chat with the emitted user.
Notes:
  • hideMessagePrivatelyOption defaults to false, so the action is shown by default. Set it to true to hide the option.
  • The action appears only in group chats, and only for messages sent by other users.
  • Selecting it opens a normal 1:1 user chat — it is not group-scoped.

2. Alternative: Group Member Click Handler

As a secondary route, you can also start a private chat from the group member list. When a group member is clicked, cast them to a User object and initiate a private chat. Save the current group so the user can return to it later.

3. Alternative: Group Members with Private Messaging Option

For the group-members route, render cometchat-group-members and handle the (itemClick) output to trigger the private chat flow.

4. Private Chat Interface

Render a full chat view (header, message list, composer) for the 1:1 conversation. The header includes a back button that returns the user to the original group.

5. Return to Group

When the user clicks back, restore the previous group context and close the private chat view.

6. Full Component Example

A complete standalone component wiring group members, private chat, and navigation together.

Feature Matrix


Next Steps

Group Members

Display and manage group member lists.

Message List

Render real-time message threads.

All Guides

Browse all feature and formatter guides.

Sample App

Full working sample application on GitHub.