# Chat Room Page

![Direct one to one chat](/files/-MX6mlaLJh4boDC92yG2)

### Message List Page Header

![](/files/-MX6mrlO2NL882CcfFUK)

| Feature           | Description                                                            |
| ----------------- | ---------------------------------------------------------------------- |
| User avatar       | If the user has no avatar, the system will show the default avatar.    |
| User Display name | If the user has no display name, the display name will be 'anonymous'. |
| Back button       | Redirects user back to the previous page.                              |

### Message List&#x20;

![](/files/-MX6mvQjEbrmeoBuzUtP)

###

| Feature              | Description                                                                                   |
| -------------------- | --------------------------------------------------------------------------------------------- |
| Show list of message | The latest message bubble will be at the bottom of the screen. Scroll up to see all messages. |
| Date label           | Grouping of messages by the sent date                                                         |

### Message Bubble - Text Message Bubble

![](/files/-MX6mzGIxjV8qMxFVu87)

| Feature                         | Description                                                                                                                                                   |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Read more mode                  | When the text is more than 13 lines, the system show read more mode. Once it is clicked on the read more button, it expands text to the full size.            |
| Long press to delete            | If the long click event occurs, the system will show the delete option.                                                                                       |
| Long press to edit              | If the long click event occurs, the system will show the edit option. When click the edit option, the system will redirect the user to the edit message page. |
| Error to send message indicator | If the message can not be sent, the system will show the error indicator in front of the message bubble.                                                      |
| Sent time stamp                 | Show as time stamp HH:MM                                                                                                                                      |
| Edited label                    | If the message is edited, the edited label will be shown.                                                                                                     |
| Deleted message                 | If the message is deleted, the deleted view will be shown.                                                                                                    |

### Message bubble - Image message bubble

![](/files/-MX6n4xw9WXfDwJU2_zd)

| Feature            | Description                                                                                                                 |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| Image thumbnails   | The system shows the image base on the image ratio. Once it is clicked, it will redirect the user to the edit message page. |
| Image upload state | The system will show the image uploading indicator while the image is being uploaded.                                       |

### Image Preview Page

<figure><img src="/files/HhaTUxIdFJ85SXdwN7vP" alt=""><figcaption></figcaption></figure>

| Feature            | Description                                                |
| ------------------ | ---------------------------------------------------------- |
| Pinch zoom gesture | The user can pinch the screen to zoom in or out the image. |
| back               | Redirect user back to the previous page.                   |

### Message Bubble - Audio Message Bubble

<figure><img src="/files/cCr9h32bPvw6pYONUJho" alt=""><figcaption></figcaption></figure>

| Feature       | Description                                                                                                                    |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Click to play | If the user clicks on the voice message , the system will play the audio                                                       |
| Click to stop | If the user clicks on the playing voice message or play another voice message, the system will stop playing the playing audio. |

### Audio Message Recorder

![](/files/-MX6nMjnLrj8wBWhygur)

| Feature            | Description                                                                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Hold to record     | The user can hold to record an audio message for up to 60 seconds. Once the user releases the finger, the system will send the audio message. |
| Discard the record | The user can drag the finger to the bin button to discard the current recording session.                                                      |

### Edit Text Message Page

<figure><img src="/files/ISXyUzPQmwDHVr0rY9X4" alt=""><figcaption></figcaption></figure>

| Feature        | Description                                                    |
| -------------- | -------------------------------------------------------------- |
| Add text       | User can update the text from the original input               |
| Save           | User can click save button to save the change he made.         |
| Discard change | user can click x to discard all change before user click save. |

### Usage

```swift
import UIKit
import AmityUIKit

class ClientViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    @IBAction func showMessageListPage(_ sender: UIButton) {
        let messageVC = AmityMessageListViewController.make(channelId: "CHANNEL_ID")
        present(messageVC, animated: true)
    }
}

```

#### Parameters

| Parameter | Description                                |
| --------- | ------------------------------------------ |
| channelId | Use to query channel info and message list |

### Specify Custom Settings

You can create and specify `Settings` object when creating `AmityMessageListViewController`.

```swift
// 1. Create the settings object.
var settings = AmityMessageListViewController.Settings()
settings.composeBarStyle = .textOnly

// 2. Specify the settings as parameter.
let messageVC = AmityMessageListViewController.make(channelId: "CHANNEL_ID", settings: settings)

```

The available settings are shown below.

#### Compose Bar Style

There are two compose bar styles available in the UIKit.&#x20;

1. `ComposeBarStyle.default` - has full functionalities including text, audio and, image message sending
2. `ComposeBarStyle.textOnly` - has simple functionalities which are only limited to text message sending

The default settings for compose bar style is `ComposeBarStyle.default`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.social.plus/social-plus-uikit/uikit-3/ios/chat/using-only-some-components/chat-room-page.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
