UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
XmppPresence.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "XmppConnection.h"
7
12{
13 enum Type
14 {
15 // online while connected
17 // offline if not connected
19 // online but away due to being afk or manually set
21 // online but away for a long period or manually set
23 // manually set to avoid interruptions
25 // currently chatting. implies online
26 Chat
27 };
28
30 inline const TCHAR* ToString(EXmppPresenceStatus::Type EnumVal)
31 {
32 switch (EnumVal)
33 {
34 case Online:
35 return TEXT("Online");
36 case Offline:
37 return TEXT("Offline");
38 case Away:
39 return TEXT("Away");
40 case ExtendedAway:
41 return TEXT("ExtendedAway");
42 case DoNotDisturb:
43 return TEXT("DoNotDisturb");
44 case Chat:
45 return TEXT("Chat");
46 }
47 return TEXT("");
48 }
49}
50
55{
56public:
60 bool bIsAvailable = true;
66 FString AppId;
68 FString Platform;
70 FString StatusStr;
73
74 inline bool operator==(const FXmppUserPresence& Presence) const
75 {
76 // SentTime is explicitly not checked
77 return Status == Presence.Status &&
78 bIsAvailable == Presence.bIsAvailable &&
79 AppId == Presence.AppId &&
80 Platform == Presence.Platform &&
81 StatusStr == Presence.StatusStr &&
82 UserJid == Presence.UserJid;
83 }
84 inline bool operator!=(const FXmppUserPresence& Presence) const
85 {
86 return !(*this == Presence);
87 }
88};
89
94{
95public:
100
102 FString Role;
104 FString Affiliation;
113
114 const FString& GetRoomId() const { return UserJid.Id; }
115 const FString& GetNickName() const { return UserJid.Resource; }
116};
117
122{
123public:
124
126 virtual ~IXmppPresence() {}
127
135 virtual bool UpdatePresence(const FXmppUserPresence& Presence) = 0;
136
142 virtual const FXmppUserPresence& GetPresence() const = 0;
143
149 virtual bool QueryPresence(const FString& UserId) = 0;
150
157
163 virtual TArray<TSharedPtr<FXmppUserPresence>> GetRosterPresence(const FString& UserId) = 0;
164
177};
178
179
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition XmppPresence.h:94
FString Affiliation
Definition XmppPresence.h:104
const FString & GetRoomId() const
Definition XmppPresence.h:114
const FString & GetNickName() const
Definition XmppPresence.h:115
FXmppMucPresence()
Definition XmppPresence.h:97
FXmppUserJid MemberJid
Definition XmppPresence.h:112
FString Role
Definition XmppPresence.h:102
Definition XmppConnection.h:99
FString Resource
Definition XmppConnection.h:127
FString Id
Definition XmppConnection.h:123
Definition XmppPresence.h:55
bool operator==(const FXmppUserPresence &Presence) const
Definition XmppPresence.h:74
FString StatusStr
Definition XmppPresence.h:70
FDateTime SentTime
Definition XmppPresence.h:62
FXmppUserJid UserJid
Definition XmppPresence.h:72
FString Platform
Definition XmppPresence.h:68
FDateTime ReceivedTime
Definition XmppPresence.h:64
bool operator!=(const FXmppUserPresence &Presence) const
Definition XmppPresence.h:84
FString AppId
Definition XmppPresence.h:66
bool bIsAvailable
Definition XmppPresence.h:60
EXmppPresenceStatus::Type Status
Definition XmppPresence.h:58
Definition XmppPresence.h:122
DECLARE_MULTICAST_DELEGATE_ThreeParams(FOnXmppPresenceReceived, const TSharedRef< IXmppConnection > &, const FXmppUserJid &, const TSharedRef< FXmppUserPresence > &)
virtual void GetRosterMembers(TArray< FXmppUserJid > &OutMembers)=0
virtual bool QueryPresence(const FString &UserId)=0
virtual TArray< TSharedPtr< FXmppUserPresence > > GetRosterPresence(const FString &UserId)=0
virtual bool UpdatePresence(const FXmppUserPresence &Presence)=0
virtual ~IXmppPresence()
Definition XmppPresence.h:126
virtual FOnXmppPresenceReceived & OnReceivePresence()=0
virtual const FXmppUserPresence & GetPresence() const =0
Definition Array.h:670
Definition SharedPointer.h:153
Definition XmppPresence.h:12
Type
Definition XmppPresence.h:14
@ DoNotDisturb
Definition XmppPresence.h:24
@ Offline
Definition XmppPresence.h:18
@ ExtendedAway
Definition XmppPresence.h:22
@ Away
Definition XmppPresence.h:20
@ Online
Definition XmppPresence.h:16
@ Chat
Definition XmppPresence.h:26
Definition DateTime.h:76
static FDateTime MinValue()
Definition DateTime.h:668