Stream Chat Unreal SDK
Loading...
Searching...
No Matches
ChannelState.h
1// Copyright 2026 Stream.IO, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Message.h"
7#include "MessageStore.h"
8#include "Read.h"
9
10#include "ChannelState.generated.h"
11
13
18USTRUCT(BlueprintType)
19struct STREAMCHAT_API FChannelState
20{
21 GENERATED_BODY()
22
23
25
27 explicit FChannelState(const FChannelStateResponseFieldsDto&, UUserManager*);
28
30 void Append(const FChannelStateResponseFieldsDto&, UUserManager*);
31
33 void AppendReplies(const FString& ParentId, const TArray<FMessageDto>&, UUserManager*);
34
36 void AddMessage(const FMessage&);
37
39 bool IsMessageRead(const FMessage&) const;
40
42 void MarkRead();
43
45 int32 UnreadCount() const;
46
47 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
49
51 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
52 int32 WatcherCount = 0;
53
54 // List of channel watchers
55 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
56 TArray<FUserRef> Watchers;
57
59 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
60 TArray<FRead> Read;
61
62private:
63 FRead* GetCurrentUserRead();
64 const FRead* GetCurrentUserRead() const;
65};
@ ParentId
The parent message ID (if the message is a reply)
Encapsulates the local state of a channel.
Definition ChannelState.h:20
#/components/schemas/ChannelStateResponseFields
Definition ChannelStateResponseFieldsDto.h:19
TArray< FUserObjectDto > Watchers
A list of users watching the channel.
Definition ChannelStateResponseFieldsDto.h:59
TArray< FReadDto > Read
List of read states.
Definition ChannelStateResponseFieldsDto.h:51
TArray< FMessageDto > Messages
List of channel members.
Definition ChannelStateResponseFieldsDto.h:43
int32 WatcherCount
The count of users watching the channel.
Definition ChannelStateResponseFieldsDto.h:55
#/components/schemas/Message Represents any chat message. Used in responses only
Definition MessageDto.h:25
Represents a Stream Chat message.
Definition Message.h:70
A store for a list of messages.
Definition MessageStore.h:26
Contains information about the read state (i.e number of unread messages) of a member of a chat chann...
Definition Read.h:19
A reference to a unique User.
Definition UserRef.h:23