From f86a880411bf23f309095f9044d51fb6d6db6da3 Mon Sep 17 00:00:00 2001 From: Rafael Carvalho Date: Mon, 25 May 2020 13:43:12 +1200 Subject: [PATCH] Update docs with image type messages info --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 35f0cbb..210ee2e 100644 --- a/README.md +++ b/README.md @@ -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: