Quoted messages
Quote previous messages to provide context when responding to older messages in a conversation.
Quote message
Use SendText() with the QuotedMessage parameter to quote a message. There is no dedicated quoting method.
Method signature
- Blueprint
- C++ / Input parameters
1Channel->SendText(
2 FString Message,
3 FSendTextParams SendTextParams = FSendTextParams()
4);
* required
| Parameter | Description |
|---|---|
MessageType: FStringDefault: n/a | Text that you want to send to the selected channel. |
SendTextParamsType: FSendTextParamsDefault: n/a | Struct providing additional parameters. |
→ QuotedMessageType: UPubnubMessage*Default: n/a | Message object added to a message when you quote another message. This object stores the following info about the quoted message: { timetoken: quotedMessage.timetoken, text: quotedMessage.text, userId: quotedMessage.userId }, where timetoken is the time when the quoted message was published, text contains the original message content, and userId is the identifier of the user who published the quoted message. |
Output
This method doesn't return any value.
Sample code
Quote the message with the 16200000000000001 timetoken.
1#include "Kismet/GameplayStatics.h"
2#include "PubnubChatSubsystem.h"
3
4UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
5UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();
6
7UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");
8
9UPubnubChannel* Channel = Chat->GetChannel("support");
10
11FString Timetoken = "16200000000000001";
12
13// Fetch the message
14UPubnubMessage* Message = Channel->GetMessage(Timetoken);
15
show all 18 linesGet quoted message
QuotedMessage() returns the original quoted message.
- Blueprint
- C++ / Input parameters
1Message->QuotedMessage();
Output
| Type | Description |
|---|---|
UPubnubMessage* | The quoted message object. |
Sample code
Return a quote from the message with the 16200000000000001 timetoken.
1#include "Kismet/GameplayStatics.h"
2#include "PubnubChatSubsystem.h"
3
4UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
5UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();
6
7UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");
8
9UPubnubChannel* Channel = Chat->GetChannel("support");
10
11FString Timetoken = "16200000000000001";
12
13// Fetch the message
14UPubnubMessage* Message = Channel->GetMessage(Timetoken);
15
show all 16 lines