Stream Chat Unreal SDK
Loading...
Searching...
No Matches
Message.h
1// Copyright 2022 Stream.IO, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Reaction/Reactions.h"
7#include "Response/Channel/ChannelStateResponseFieldsDto.h"
8#include "Response/Message/SearchResultDto.h"
9#include "User/UserRef.h"
10
11#include "Message.generated.h"
12
13struct FMessageDto;
15
20UENUM(BlueprintType)
21enum class EMessageSendState : uint8
22{
23 None,
25 Sending,
27 Sent,
33 Failed
34};
35
41UENUM(BlueprintType)
42enum class EMessageType : uint8
43{
45 Regular,
51 Error,
53 Reply,
55 System,
58};
59
64USTRUCT(BlueprintType)
65struct STREAMCHAT_API FMessage
66{
67 GENERATED_BODY()
68
69
72 explicit FMessage(const FMessageDto&, UUserManager*);
73 explicit FMessage(const FSearchResultDto&, UUserManager*);
75 explicit FMessage(const FString& Text);
77 FMessageRequestDto ToRequestDto(const FString& Cid) const;
78
80 UPROPERTY()
81 FString Id;
82
84 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Stream Chat|Message")
85 FString Text;
86
88 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
90
92 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
94
96 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
98
100 UPROPERTY()
101 TArray<FUserRef> MentionedUsers;
102
104 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
105 FDateTime CreatedAt = FDateTime{0};
106
108 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
109 FDateTime UpdatedAt = FDateTime{0};
110
112 TOptional<FDateTime> DeletedAt;
113
115 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
116 FReactions Reactions;
117
119 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
120 FString ParentId;
121
122 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Stream Chat|Message", AdvancedDisplay)
123 bool bIsSilent = false;
124
126 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Stream Chat|Message", AdvancedDisplay)
127 bool bIsShadowed = false;
128
130 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Stream Chat|Message")
131 FString Html;
132
133 UPROPERTY(BlueprintReadWrite, Category = "Stream Chat|Message", AdvancedDisplay)
134 FAdditionalFields ExtraData;
135
136 // TODO rest of fields
137};
@ State
Return channel state in response.
@ None
Do nothing.
EMessageSendState
The client-side state of a message.
Definition: Message.h:22
EMessageType
Type of message, as set by the API or chat bots and custom commands.
Definition: Message.h:43
@ Id
Message ID.
@ Text
Text of the message.
@ Type
Type of the message.
@ ParentId
The parent message ID (if the message is a reply)
@ Updating
Message is shown, but user might see a "pending" icon.
@ Sent
Message is shown, and user might see a "confirmed" icon.
@ Failed
User might see a "failed" icon.
@ Sending
Message is shown, but user might see a "pending" icon.
@ Deleting
Message might be shown as deleted already, pending confirmation from API.
@ Reply
A message in a reply thread. Messages created with parent_id are automatically of this type.
@ Deleted
A soft deleted message.
@ System
A message generated by a system event, like updating the channel or muting a user.
@ Regular
A regular message created in the channel.
#/components/schemas/Message Represents any chat message. Used in responses only
Definition: MessageDto.h:23
Represents a Stream Chat message.
Definition: Message.h:66
TOptional< FDateTime > DeletedAt
Reserved field indicating when the message was deleted.
Definition: Message.h:112
#/components/schemas/MessageRequest
Definition: MessageRequestDto.h:17
FString Html
Contains HTML markup of the message.
Definition: MessageRequestDto.h:27
Encapsulates a collection of reactions for a message.
Definition: Reactions.h:21
#/components/schemas/SearchResult
Definition: SearchResultDto.h:16
A reference to a unique User.
Definition: UserRef.h:23