Stream Chat Unreal SDK
Loading...
Searching...
No Matches
ChannelState.h
1// Copyright 2022 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 AddMessage(const FMessage&);
34
36 bool IsMessageRead(const FMessage&) const;
37
39 void MarkRead();
40
42 int32 UnreadCount() const;
43
44 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
46
48 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
49 int32 WatcherCount = 0;
50
51 // List of channel watchers
52 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
53 TArray<FUserRef> Watchers;
54
56 UPROPERTY(BlueprintReadOnly, Category = "Stream Chat|Channel")
57 TArray<FRead> Read;
58
59private:
60 FRead* GetCurrentUserRead();
61 const FRead* GetCurrentUserRead() const;
62};
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
Represents a Stream Chat message.
Definition: Message.h:66
A store for a list of messages.
Definition: MessageStore.h:19
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