Stream Chat Unreal SDK
Loading...
Searching...
No Matches
MessageStore.h
1// Copyright 2022 Stream.IO, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Message.h"
7
8#include "MessageStore.generated.h"
9
10using FMessageRef = TSharedRef<FMessage>;
11using FMessages = TArray<FMessageRef>;
12
17USTRUCT(BlueprintType)
18struct STREAMCHAT_API FMessageStore
19{
20 GENERATED_BODY()
21
22
25 void Append(const FMessageStore&);
26 void Append(const TArray<FMessageDto>, UUserManager*);
27
32 bool AddMessage(const FMessage&);
33 bool AddMessage(const FMessageDto&, UUserManager*);
34
35 bool IsEmpty() const;
36 // Must check if store is empty first or this will crash
37 const FMessage& First();
38 // Must check if store is empty first or this will crash
39 const FMessage& Last();
40
42 TSharedPtr<FMessage> Next(const FMessage&) const;
43
44 FMessages FilterRecent(const FTimespan& Since) const;
45
47 const FMessages& GetMessages() const;
48
49private:
50 void Append(const FMessages&);
51 FMessages Messages;
52};
#/components/schemas/Message Represents any chat message. Used in responses only
Definition: MessageDto.h:23
Represents a Stream Chat message.
Definition: Message.h:66
A store for a list of messages.
Definition: MessageStore.h:19