Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Update docs with image type messages info
Browse files Browse the repository at this point in the history
  • Loading branch information
rpaschoal authored May 25, 2020
1 parent 06d3c9e commit f86a880
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,26 @@ You can now trigger some ng-chat actions such as opening a chat window from else
this.ngChatInstance.triggerOpenChatWindow(user);
```

#### Paged History Chat Adapter (BETA):
#### Paged History Chat Adapter:

This adapter is similar to `ChatAdapter` but provides a pagination button to load older messages from your message history. You have to implement one additional method: `getMessageHistoryByPage`. You can check a sample implementation for this under the demo project with the `DemoAdapterPagedHistory` class.

If you like this feature and believe it should be the default behavior and implementation for ng-chat, please open an issue and vote for it here so we can potentially introduce it as the default chat adapter on subsequent versions of ng-chat.

#### Showing an image as a message:

If you'd like to display an image thumbnail on a chat window message just set the message type to `Image`. The content of the message should point to a valid image URL:

```
const imageMessage: Message = {
fromId: 1,
toId: 999,
type: MessageType.Image,
message: "https://valid.url/image.jpg",
dateSent: new Date()
};
```

# Troubleshooting

Please follow this guideline when reporting bugs and feature requests:
Expand Down

0 comments on commit f86a880

Please sign in to comment.