diff --git a/Source/PubnubLibrary/Private/PubnubSubsystem.cpp b/Source/PubnubLibrary/Private/PubnubSubsystem.cpp index be3f7b3..49ed2f9 100644 --- a/Source/PubnubLibrary/Private/PubnubSubsystem.cpp +++ b/Source/PubnubLibrary/Private/PubnubSubsystem.cpp @@ -104,36 +104,36 @@ void UPubnubSubsystem::SetSecretKey() }); } -void UPubnubSubsystem::PublishMessage(FString ChannelName, FString Message, FPubnubPublishSettings PublishSettings) +void UPubnubSubsystem::PublishMessage(FString Channel, FString Message, FPubnubPublishSettings PublishSettings) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, Message, PublishSettings] + QuickActionThread->AddFunctionToQueue( [this, Channel, Message, PublishSettings] { - PublishMessage_priv(ChannelName, Message, PublishSettings); + PublishMessage_priv(Channel, Message, PublishSettings); }); } -void UPubnubSubsystem::Signal(FString ChannelName, FString Message) +void UPubnubSubsystem::Signal(FString Channel, FString Message) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, Message] + QuickActionThread->AddFunctionToQueue( [this, Channel, Message] { - PublishMessage_priv(ChannelName, Message); + PublishMessage_priv(Channel, Message); }); } -void UPubnubSubsystem::SubscribeToChannel(FString ChannelName) +void UPubnubSubsystem::SubscribeToChannel(FString Channel) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName] + QuickActionThread->AddFunctionToQueue( [this, Channel] { - SubscribeToChannel_priv(ChannelName); + SubscribeToChannel_priv(Channel); }); } @@ -148,14 +148,14 @@ void UPubnubSubsystem::SubscribeToGroup(FString GroupName) }); } -void UPubnubSubsystem::UnsubscribeFromChannel(FString ChannelName) +void UPubnubSubsystem::UnsubscribeFromChannel(FString Channel) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName] + QuickActionThread->AddFunctionToQueue( [this, Channel] { - UnsubscribeFromChannel_priv(ChannelName); + UnsubscribeFromChannel_priv(Channel); }); } @@ -181,25 +181,25 @@ void UPubnubSubsystem::UnsubscribeFromAll() }); } -void UPubnubSubsystem::AddChannelToGroup(FString ChannelName, FString ChannelGroup) +void UPubnubSubsystem::AddChannelToGroup(FString Channel, FString ChannelGroup) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, ChannelGroup] + QuickActionThread->AddFunctionToQueue( [this, Channel, ChannelGroup] { - AddChannelToGroup_priv(ChannelName, ChannelGroup); + AddChannelToGroup_priv(Channel, ChannelGroup); }); } -void UPubnubSubsystem::RemoveChannelFromGroup(FString ChannelName, FString ChannelGroup) +void UPubnubSubsystem::RemoveChannelFromGroup(FString Channel, FString ChannelGroup) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, ChannelGroup] + QuickActionThread->AddFunctionToQueue( [this, Channel, ChannelGroup] { - RemoveChannelFromGroup_priv(ChannelName, ChannelGroup); + RemoveChannelFromGroup_priv(Channel, ChannelGroup); }); } @@ -236,25 +236,25 @@ void UPubnubSubsystem::RemoveChannelGroup(FString ChannelGroup) }); } -void UPubnubSubsystem::ListUsersFromChannel(FString ChannelName, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) +void UPubnubSubsystem::ListUsersFromChannel(FString Channel, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, ListUsersFromChannelResponse, ListUsersFromChannelSettings] + QuickActionThread->AddFunctionToQueue( [this, Channel, ListUsersFromChannelResponse, ListUsersFromChannelSettings] { - ListUsersFromChannel_DATA_priv(ChannelName, ListUsersFromChannelResponse, ListUsersFromChannelSettings); + ListUsersFromChannel_DATA_priv(Channel, ListUsersFromChannelResponse, ListUsersFromChannelSettings); }); } -void UPubnubSubsystem::ListUsersFromChannel_JSON(FString ChannelName, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) +void UPubnubSubsystem::ListUsersFromChannel_JSON(FString Channel, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, ListUsersFromChannelResponse, ListUsersFromChannelSettings] + QuickActionThread->AddFunctionToQueue( [this, Channel, ListUsersFromChannelResponse, ListUsersFromChannelSettings] { - ListUsersFromChannel_JSON_priv(ChannelName, ListUsersFromChannelResponse, ListUsersFromChannelSettings); + ListUsersFromChannel_JSON_priv(Channel, ListUsersFromChannelResponse, ListUsersFromChannelSettings); }); } @@ -280,36 +280,36 @@ void UPubnubSubsystem::ListUserSubscribedChannels_JSON(FString UserID, FOnPubnub }); } -void UPubnubSubsystem::SetState(FString ChannelName, FString StateJson, FPubnubSetStateSettings SetStateSettings) +void UPubnubSubsystem::SetState(FString Channel, FString StateJson, FPubnubSetStateSettings SetStateSettings) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, StateJson, SetStateSettings] + QuickActionThread->AddFunctionToQueue( [this, Channel, StateJson, SetStateSettings] { - SetState_priv(ChannelName, StateJson, SetStateSettings); + SetState_priv(Channel, StateJson, SetStateSettings); }); } -void UPubnubSubsystem::GetState(FString ChannelName, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse) +void UPubnubSubsystem::GetState(FString Channel, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, ChannelGroup, UserID, OnGetStateResponse] + QuickActionThread->AddFunctionToQueue( [this, Channel, ChannelGroup, UserID, OnGetStateResponse] { - GetState_priv(ChannelName, ChannelGroup, UserID, OnGetStateResponse); + GetState_priv(Channel, ChannelGroup, UserID, OnGetStateResponse); }); } -void UPubnubSubsystem::Heartbeat(FString ChannelName, FString ChannelGroup) +void UPubnubSubsystem::Heartbeat(FString Channel, FString ChannelGroup) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, ChannelGroup] + QuickActionThread->AddFunctionToQueue( [this, Channel, ChannelGroup] { - Heartbeat_priv(ChannelName, ChannelGroup); + Heartbeat_priv(Channel, ChannelGroup); }); } @@ -357,36 +357,36 @@ void UPubnubSubsystem::SetAuthToken(FString Token) }); } -void UPubnubSubsystem::FetchHistory(FString ChannelName, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) +void UPubnubSubsystem::FetchHistory(FString Channel, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, OnFetchHistoryResponse, FetchHistorySettings] + QuickActionThread->AddFunctionToQueue( [this, Channel, OnFetchHistoryResponse, FetchHistorySettings] { - FetchHistory_DATA_priv(ChannelName, OnFetchHistoryResponse, FetchHistorySettings); + FetchHistory_DATA_priv(Channel, OnFetchHistoryResponse, FetchHistorySettings); }); } -void UPubnubSubsystem::FetchHistory_JSON(FString ChannelName, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) +void UPubnubSubsystem::FetchHistory_JSON(FString Channel, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, OnFetchHistoryResponse, FetchHistorySettings] + QuickActionThread->AddFunctionToQueue( [this, Channel, OnFetchHistoryResponse, FetchHistorySettings] { - FetchHistory_JSON_priv(ChannelName, OnFetchHistoryResponse, FetchHistorySettings); + FetchHistory_JSON_priv(Channel, OnFetchHistoryResponse, FetchHistorySettings); }); } -void UPubnubSubsystem::MessageCounts(FString ChannelName, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse) +void UPubnubSubsystem::MessageCounts(FString Channel, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, Timetoken, OnMessageCountsResponse] + QuickActionThread->AddFunctionToQueue( [this, Channel, Timetoken, OnMessageCountsResponse] { - MessageCounts_priv(ChannelName, Timetoken, OnMessageCountsResponse); + MessageCounts_priv(Channel, Timetoken, OnMessageCountsResponse); }); } @@ -478,47 +478,47 @@ void UPubnubSubsystem::GetAllChannelMetadata_JSON(FOnPubnubResponse OnGetAllChan }); } -void UPubnubSubsystem::SetChannelMetadata(FString ChannelMetadataID, FString ChannelMetadataObj, FString Include) +void UPubnubSubsystem::SetChannelMetadata(FString Channel, FString ChannelMetadataObj, FString Include) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, ChannelMetadataObj, Include] + QuickActionThread->AddFunctionToQueue( [this, Channel, ChannelMetadataObj, Include] { - SetChannelMetadata_priv(ChannelMetadataID, ChannelMetadataObj, Include); + SetChannelMetadata_priv(Channel, ChannelMetadataObj, Include); }); } -void UPubnubSubsystem::GetChannelMetadata(FString ChannelMetadataID, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include) +void UPubnubSubsystem::GetChannelMetadata(FString Channel, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, OnGetChannelMetadataResponse, Include] + QuickActionThread->AddFunctionToQueue( [this, Channel, OnGetChannelMetadataResponse, Include] { - GetChannelMetadata_DATA_priv(ChannelMetadataID, OnGetChannelMetadataResponse, Include); + GetChannelMetadata_DATA_priv(Channel, OnGetChannelMetadataResponse, Include); }); } -void UPubnubSubsystem::GetChannelMetadata_JSON(FString ChannelMetadataID, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include) +void UPubnubSubsystem::GetChannelMetadata_JSON(FString Channel, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, OnGetChannelMetadataResponse, Include] + QuickActionThread->AddFunctionToQueue( [this, Channel, OnGetChannelMetadataResponse, Include] { - GetChannelMetadata_JSON_priv(ChannelMetadataID, OnGetChannelMetadataResponse, Include); + GetChannelMetadata_JSON_priv(Channel, OnGetChannelMetadataResponse, Include); }); } -void UPubnubSubsystem::RemoveChannelMetadata(FString ChannelMetadataID) +void UPubnubSubsystem::RemoveChannelMetadata(FString Channel) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID] + QuickActionThread->AddFunctionToQueue( [this, Channel] { - RemoveChannelMetadata_priv(ChannelMetadataID); + RemoveChannelMetadata_priv(Channel); }); } @@ -566,102 +566,102 @@ void UPubnubSubsystem::RemoveMemberships(FString User, FString RemoveObj, FStrin }); } -void UPubnubSubsystem::GetChannelMembers(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +void UPubnubSubsystem::GetChannelMembers(FString Channel, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] + QuickActionThread->AddFunctionToQueue( [this, Channel, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] { - GetChannelMembers_DATA_priv(ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + GetChannelMembers_DATA_priv(Channel, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); }); } -void UPubnubSubsystem::GetChannelMembers_JSON(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) +void UPubnubSubsystem::GetChannelMembers_JSON(FString Channel, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] + QuickActionThread->AddFunctionToQueue( [this, Channel, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count] { - GetChannelMembers_JSON_priv(ChannelMetadataID, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + GetChannelMembers_JSON_priv(Channel, OnGetMembersResponse, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); }); } -void UPubnubSubsystem::AddChannelMembers(FString ChannelMetadataID, FString AddObj, FString Include) +void UPubnubSubsystem::AddChannelMembers(FString Channel, FString AddObj, FString Include) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, AddObj, Include] + QuickActionThread->AddFunctionToQueue( [this, Channel, AddObj, Include] { - AddChannelMembers_priv(ChannelMetadataID, AddObj, Include); + AddChannelMembers_priv(Channel, AddObj, Include); }); } -void UPubnubSubsystem::SetChannelMembers(FString ChannelMetadataID, FString SetObj, FString Include) +void UPubnubSubsystem::SetChannelMembers(FString Channel, FString SetObj, FString Include) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, SetObj, Include] + QuickActionThread->AddFunctionToQueue( [this, Channel, SetObj, Include] { - SetChannelMembers_priv(ChannelMetadataID, SetObj, Include); + SetChannelMembers_priv(Channel, SetObj, Include); }); } -void UPubnubSubsystem::RemoveChannelMembers(FString ChannelMetadataID, FString RemoveObj, FString Include) +void UPubnubSubsystem::RemoveChannelMembers(FString Channel, FString RemoveObj, FString Include) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelMetadataID, RemoveObj, Include] + QuickActionThread->AddFunctionToQueue( [this, Channel, RemoveObj, Include] { - RemoveChannelMembers_priv(ChannelMetadataID, RemoveObj, Include); + RemoveChannelMembers_priv(Channel, RemoveObj, Include); }); } -void UPubnubSubsystem::AddMessageAction(FString ChannelName, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse) +void UPubnubSubsystem::AddMessageAction(FString Channel, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, MessageTimetoken, ActionType, Value, AddActionResponse] + QuickActionThread->AddFunctionToQueue( [this, Channel, MessageTimetoken, ActionType, Value, AddActionResponse] { - AddMessageAction_priv(ChannelName, MessageTimetoken, ActionType, Value, AddActionResponse); + AddMessageAction_priv(Channel, MessageTimetoken, ActionType, Value, AddActionResponse); }); } -void UPubnubSubsystem::GetMessageActions(FString ChannelName, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse) +void UPubnubSubsystem::GetMessageActions(FString Channel, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, Start, End, SizeLimit, OnGetMessageActionsResponse] + QuickActionThread->AddFunctionToQueue( [this, Channel, Start, End, SizeLimit, OnGetMessageActionsResponse] { - GetMessageActions_DATA_priv(ChannelName, Start, End, SizeLimit, OnGetMessageActionsResponse); + GetMessageActions_DATA_priv(Channel, Start, End, SizeLimit, OnGetMessageActionsResponse); }); } -void UPubnubSubsystem::GetMessageActions_JSON(FString ChannelName, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse) +void UPubnubSubsystem::GetMessageActions_JSON(FString Channel, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, Start, End, SizeLimit, OnGetMessageActionsResponse] + QuickActionThread->AddFunctionToQueue( [this, Channel, Start, End, SizeLimit, OnGetMessageActionsResponse] { - GetMessageActions_JSON_priv(ChannelName, Start, End, SizeLimit, OnGetMessageActionsResponse); + GetMessageActions_JSON_priv(Channel, Start, End, SizeLimit, OnGetMessageActionsResponse); }); } -void UPubnubSubsystem::RemoveMessageAction(FString ChannelName, FString MessageTimetoken, FString ActionTimetoken) +void UPubnubSubsystem::RemoveMessageAction(FString Channel, FString MessageTimetoken, FString ActionTimetoken) { if(!CheckIsPubnubInitialized() || !CheckQuickActionThreadValidity()) {return;} - QuickActionThread->AddFunctionToQueue( [this, ChannelName, MessageTimetoken, ActionTimetoken] + QuickActionThread->AddFunctionToQueue( [this, Channel, MessageTimetoken, ActionTimetoken] { - RemoveMessageAction_priv(ChannelName, MessageTimetoken, ActionTimetoken); + RemoveMessageAction_priv(Channel, MessageTimetoken, ActionTimetoken); }); } @@ -1125,12 +1125,12 @@ void UPubnubSubsystem::SetSecretKey_priv() pubnub_set_secret_key(ctx_sub, SecretKey); } -void UPubnubSubsystem::PublishMessage_priv(FString ChannelName, FString Message, FPubnubPublishSettings PublishSettings) +void UPubnubSubsystem::PublishMessage_priv(FString Channel, FString Message, FPubnubPublishSettings PublishSettings) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "PublishMessage") || CheckIsFieldEmpty(Message, "Message", "PublishMessage")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "PublishMessage") || CheckIsFieldEmpty(Message, "Message", "PublishMessage")) {return;} if(!UPubnubJsonUtilities::IsCorrectJsonString(Message)) @@ -1148,7 +1148,7 @@ void UPubnubSubsystem::PublishMessage_priv(FString ChannelName, FString Message, PublishUESettingsToPubnubPublishOptions(PublishSettings, PubnubOptions); - pubnub_publish_ex(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*Message), PubnubOptions); + pubnub_publish_ex(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Message), PubnubOptions); pubnub_res PublishResult = pubnub_await(ctx_pub); if(PublishResult != PNR_OK) @@ -1157,32 +1157,32 @@ void UPubnubSubsystem::PublishMessage_priv(FString ChannelName, FString Message, } } -void UPubnubSubsystem::Signal_priv(FString ChannelName, FString Message) +void UPubnubSubsystem::Signal_priv(FString Channel, FString Message) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "Signal") || CheckIsFieldEmpty(Message, "Message", "Signal")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "Signal") || CheckIsFieldEmpty(Message, "Message", "Signal")) {return;} - pubnub_signal(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*Message)); + pubnub_signal(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Message)); } -void UPubnubSubsystem::SubscribeToChannel_priv(FString ChannelName) +void UPubnubSubsystem::SubscribeToChannel_priv(FString Channel) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "SubscribeToChannel")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "SubscribeToChannel")) {return;} - if(SubscribedChannels.Contains(ChannelName)) + if(SubscribedChannels.Contains(Channel)) {return;} //Check if Pubnub was already subscribed to a channel or a group. bool WasCheckingMessages = !SubscribedChannels.IsEmpty() || !SubscribedGroups.IsEmpty(); - SubscribedChannels.Add(ChannelName); + SubscribedChannels.Add(Channel); if(!WasCheckingMessages) { @@ -1218,7 +1218,7 @@ void UPubnubSubsystem::SubscribeToGroup_priv(FString GroupName) SystemPublish(); } -void UPubnubSubsystem::UnsubscribeFromChannel_priv(FString ChannelName) +void UPubnubSubsystem::UnsubscribeFromChannel_priv(FString Channel) { if(!CheckIsUserIDSet()) {return;} @@ -1230,10 +1230,10 @@ void UPubnubSubsystem::UnsubscribeFromChannel_priv(FString ChannelName) } //make sure user was subscribed to that channel - if(SubscribedChannels.Remove(ChannelName) == 0) + if(SubscribedChannels.Remove(Channel) == 0) {return;} - pubnub_leave(ctx_pub, TCHAR_TO_ANSI(*ChannelName), NULL); + pubnub_leave(ctx_pub, TCHAR_TO_ANSI(*Channel), NULL); SystemPublish(ChannelForSystemPublish); } @@ -1288,26 +1288,26 @@ void UPubnubSubsystem::UnsubscribeFromAll_priv() } } -void UPubnubSubsystem::AddChannelToGroup_priv(FString ChannelName, FString ChannelGroup) +void UPubnubSubsystem::AddChannelToGroup_priv(FString Channel, FString ChannelGroup) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "AddChannelToGroup") || CheckIsFieldEmpty(ChannelGroup, "ChannelGroup", "AddChannelToGroup")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "AddChannelToGroup") || CheckIsFieldEmpty(ChannelGroup, "ChannelGroup", "AddChannelToGroup")) {return;} - pubnub_add_channel_to_group(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*ChannelGroup)); + pubnub_add_channel_to_group(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*ChannelGroup)); } -void UPubnubSubsystem::RemoveChannelFromGroup_priv(FString ChannelName, FString ChannelGroup) +void UPubnubSubsystem::RemoveChannelFromGroup_priv(FString Channel, FString ChannelGroup) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "RemoveChannelFromGroup") || CheckIsFieldEmpty(ChannelGroup, "ChannelGroup", "RemoveChannelFromGroup")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "RemoveChannelFromGroup") || CheckIsFieldEmpty(ChannelGroup, "ChannelGroup", "RemoveChannelFromGroup")) {return;} - pubnub_remove_channel_from_group(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*ChannelGroup)); + pubnub_remove_channel_from_group(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*ChannelGroup)); } FString UPubnubSubsystem::ListChannelsFromGroup_pn(FString ChannelGroup) @@ -1369,7 +1369,7 @@ void UPubnubSubsystem::RemoveChannelGroup_priv(FString ChannelGroup) pubnub_remove_channel_group(ctx_pub, TCHAR_TO_ANSI(*ChannelGroup)); } -FString UPubnubSubsystem::ListUsersFromChannel_pn(FString ChannelName, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) +FString UPubnubSubsystem::ListUsersFromChannel_pn(FString Channel, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) { //Set all options from ListUsersFromChannelSettings @@ -1380,19 +1380,19 @@ FString UPubnubSubsystem::ListUsersFromChannel_pn(FString ChannelName, FPubnubLi HereNowUESettingsToPubnubHereNowOptions(ListUsersFromChannelSettings, HereNowOptions); - pubnub_here_now_ex(ctx_pub, TCHAR_TO_ANSI(*ChannelName), HereNowOptions); + pubnub_here_now_ex(ctx_pub, TCHAR_TO_ANSI(*Channel), HereNowOptions); return GetLastResponse(ctx_pub); } -void UPubnubSubsystem::ListUsersFromChannel_JSON_priv(FString ChannelName, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) +void UPubnubSubsystem::ListUsersFromChannel_JSON_priv(FString Channel, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "ListUsersFromChannel")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "ListUsersFromChannel")) {return;} - FString JsonResponse = ListUsersFromChannel_pn(ChannelName, ListUsersFromChannelSettings); + FString JsonResponse = ListUsersFromChannel_pn(Channel, ListUsersFromChannelSettings); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, ListUsersFromChannelResponse, JsonResponse]() @@ -1402,15 +1402,15 @@ void UPubnubSubsystem::ListUsersFromChannel_JSON_priv(FString ChannelName, FOnPu }); } -void UPubnubSubsystem::ListUsersFromChannel_DATA_priv(FString ChannelName, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) +void UPubnubSubsystem::ListUsersFromChannel_DATA_priv(FString Channel, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "ListUsersFromChannel")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "ListUsersFromChannel")) {return;} - FString JsonResponse = ListUsersFromChannel_pn(ChannelName, ListUsersFromChannelSettings); + FString JsonResponse = ListUsersFromChannel_pn(Channel, ListUsersFromChannelSettings); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, ListUsersFromChannelResponse, JsonResponse]() @@ -1474,12 +1474,12 @@ void UPubnubSubsystem::ListUserSubscribedChannels_DATA_priv(FString UserID, FOnL }); } -void UPubnubSubsystem::SetState_priv(FString ChannelName, FString StateJson, FPubnubSetStateSettings SetStateSettings) +void UPubnubSubsystem::SetState_priv(FString Channel, FString StateJson, FPubnubSetStateSettings SetStateSettings) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "SetState") || CheckIsFieldEmpty(StateJson, "StateJson", "SetState")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "SetState") || CheckIsFieldEmpty(StateJson, "StateJson", "SetState")) {return;} if(!UPubnubJsonUtilities::IsCorrectJsonString(StateJson, false)) @@ -1499,7 +1499,7 @@ void UPubnubSubsystem::SetState_priv(FString ChannelName, FString StateJson, FPu SetStateUESettingsToPubnubSetStateOptions(SetStateSettings, SetStateOptions); - pubnub_set_state_ex(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*StateJson), SetStateOptions); + pubnub_set_state_ex(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*StateJson), SetStateOptions); pubnub_res PubnubResponse = pubnub_await(ctx_pub); if (PNR_OK != PubnubResponse) { @@ -1510,18 +1510,18 @@ void UPubnubSubsystem::SetState_priv(FString ChannelName, FString StateJson, FPu pubnub_get(ctx_pub); } -void UPubnubSubsystem::GetState_priv(FString ChannelName, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse) +void UPubnubSubsystem::GetState_priv(FString Channel, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse) { if(!CheckIsUserIDSet()) {return;} - if(ChannelName.IsEmpty() && ChannelGroup.IsEmpty()) + if(Channel.IsEmpty() && ChannelGroup.IsEmpty()) { PubnubError("Warning: Can't use GetState function. At least one of: ChannelGroup, ChannelName can't be empty", EPubnubErrorType::PET_Warning); return; } - pubnub_state_get(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*ChannelGroup), TCHAR_TO_ANSI(*UserID)); + pubnub_state_get(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*ChannelGroup), TCHAR_TO_ANSI(*UserID)); FString JsonResponse = GetLastResponse(ctx_pub); //Delegate needs to be executed back on Game Thread @@ -1532,18 +1532,18 @@ void UPubnubSubsystem::GetState_priv(FString ChannelName, FString ChannelGroup, }); } -void UPubnubSubsystem::Heartbeat_priv(FString ChannelName, FString ChannelGroup) +void UPubnubSubsystem::Heartbeat_priv(FString Channel, FString ChannelGroup) { if(!CheckIsUserIDSet()) {return;} - if(ChannelName.IsEmpty() && ChannelGroup.IsEmpty()) + if(Channel.IsEmpty() && ChannelGroup.IsEmpty()) { PubnubError("Warning: Can't use Heartbeat function. At least one of: ChannelGroup, ChannelName can't be empty", EPubnubErrorType::PET_Warning); return; } - pubnub_heartbeat(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*ChannelGroup)); + pubnub_heartbeat(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*ChannelGroup)); } void UPubnubSubsystem::GrantToken_priv(FString PermissionObject, FOnPubnubResponse OnGrantTokenResponse) @@ -1648,7 +1648,7 @@ void UPubnubSubsystem::SetAuthToken_priv(FString Token) } } -FString UPubnubSubsystem::FetchHistory_pn(FString ChannelName, FPubnubFetchHistorySettings FetchHistorySettings) +FString UPubnubSubsystem::FetchHistory_pn(FString Channel, FPubnubFetchHistorySettings FetchHistorySettings) { //Set all options from HistorySettings @@ -1661,20 +1661,20 @@ FString UPubnubSubsystem::FetchHistory_pn(FString ChannelName, FPubnubFetchHisto FetchHistoryUESettingsToPbFetchHistoryOptions(FetchHistorySettings, FetchHistoryOptions); - pubnub_fetch_history(ctx_pub, TCHAR_TO_ANSI(*ChannelName), FetchHistoryOptions); + pubnub_fetch_history(ctx_pub, TCHAR_TO_ANSI(*Channel), FetchHistoryOptions); return GetLastResponse(ctx_pub); } -void UPubnubSubsystem::FetchHistory_JSON_priv(FString ChannelName, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) +void UPubnubSubsystem::FetchHistory_JSON_priv(FString Channel, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "FetchHistory")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "FetchHistory")) {return;} - FString JsonResponse = FetchHistory_pn(ChannelName, FetchHistorySettings); + FString JsonResponse = FetchHistory_pn(Channel, FetchHistorySettings); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnFetchHistoryResponse, JsonResponse]() @@ -1684,15 +1684,15 @@ void UPubnubSubsystem::FetchHistory_JSON_priv(FString ChannelName, FOnPubnubResp }); } -void UPubnubSubsystem::FetchHistory_DATA_priv(FString ChannelName, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) +void UPubnubSubsystem::FetchHistory_DATA_priv(FString Channel, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "FetchHistory")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "FetchHistory")) {return;} - FString JsonResponse = FetchHistory_pn(ChannelName, FetchHistorySettings); + FString JsonResponse = FetchHistory_pn(Channel, FetchHistorySettings); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnFetchHistoryResponse, JsonResponse]() @@ -1709,18 +1709,18 @@ void UPubnubSubsystem::FetchHistory_DATA_priv(FString ChannelName, FOnFetchHisto }); } -void UPubnubSubsystem::MessageCounts_priv(FString ChannelName, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse) +void UPubnubSubsystem::MessageCounts_priv(FString Channel, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "MessageCounts")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "MessageCounts")) {return;} - pubnub_message_counts(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*Timetoken)); + pubnub_message_counts(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Timetoken)); int MessageCountsNumber = 0; - pubnub_get_message_counts(ctx_pub, TCHAR_TO_ANSI(*ChannelName), &MessageCountsNumber); + pubnub_get_message_counts(ctx_pub, TCHAR_TO_ANSI(*Channel), &MessageCountsNumber); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnMessageCountsResponse, MessageCountsNumber]() @@ -1934,12 +1934,12 @@ void UPubnubSubsystem::GetAllChannelMetadata_DATA_priv(FOnGetAllChannelMetadataR }); } -void UPubnubSubsystem::SetChannelMetadata_priv(FString ChannelMetadataID, FString ChannelMetadataObj, FString Include) +void UPubnubSubsystem::SetChannelMetadata_priv(FString Channel, FString ChannelMetadataObj, FString Include) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "ChannelMetadataID", "SetChannelMetadata") || CheckIsFieldEmpty(ChannelMetadataObj, "ChannelMetadataObj", "SetChannelMetadata")) + if(CheckIsFieldEmpty(Channel, "Channel", "SetChannelMetadata") || CheckIsFieldEmpty(ChannelMetadataObj, "ChannelMetadataObj", "SetChannelMetadata")) {return;} if(!UPubnubJsonUtilities::IsCorrectJsonString(ChannelMetadataObj, false)) @@ -1948,7 +1948,7 @@ void UPubnubSubsystem::SetChannelMetadata_priv(FString ChannelMetadataID, FStrin return; } - pubnub_set_channelmetadata(ctx_pub, TCHAR_TO_ANSI(*ChannelMetadataID), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*ChannelMetadataObj)); + pubnub_set_channelmetadata(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*ChannelMetadataObj)); pubnub_res PubnubResponse = pubnub_await(ctx_pub); if(PubnubResponse != PNR_OK) @@ -1957,22 +1957,22 @@ void UPubnubSubsystem::SetChannelMetadata_priv(FString ChannelMetadataID, FStrin } } -FString UPubnubSubsystem::GetChannelMetadata_pn(FString ChannelMetadataID, FString Include) +FString UPubnubSubsystem::GetChannelMetadata_pn(FString Channel, FString Include) { - pubnub_get_channelmetadata(ctx_pub, TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*ChannelMetadataID)); + pubnub_get_channelmetadata(ctx_pub, TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*Channel)); return GetLastResponse(ctx_pub); } -void UPubnubSubsystem::GetChannelMetadata_JSON_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include) +void UPubnubSubsystem::GetChannelMetadata_JSON_priv(FString Channel, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "ChannelMetadataID", "GetChannelMetadata")) + if(CheckIsFieldEmpty(Channel, "Channel", "GetChannelMetadata")) {return;} - FString JsonResponse = GetChannelMetadata_pn(ChannelMetadataID, Include); + FString JsonResponse = GetChannelMetadata_pn(Channel, Include); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetChannelMetadataResponse, JsonResponse]() @@ -1982,15 +1982,15 @@ void UPubnubSubsystem::GetChannelMetadata_JSON_priv(FString ChannelMetadataID, F }); } -void UPubnubSubsystem::GetChannelMetadata_DATA_priv(FString ChannelMetadataID, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include) +void UPubnubSubsystem::GetChannelMetadata_DATA_priv(FString Channel, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "ChannelMetadataID", "GetChannelMetadata")) + if(CheckIsFieldEmpty(Channel, "Channel", "GetChannelMetadata")) {return;} - FString JsonResponse = GetChannelMetadata_pn(ChannelMetadataID, Include); + FString JsonResponse = GetChannelMetadata_pn(Channel, Include); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetChannelMetadataResponse, JsonResponse]() @@ -2005,15 +2005,15 @@ void UPubnubSubsystem::GetChannelMetadata_DATA_priv(FString ChannelMetadataID, F }); } -void UPubnubSubsystem::RemoveChannelMetadata_priv(FString ChannelMetadataID) +void UPubnubSubsystem::RemoveChannelMetadata_priv(FString Channel) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "ChannelMetadataID", "RemoveChannelMetadata")) + if(CheckIsFieldEmpty(Channel, "Channel", "RemoveChannelMetadata")) {return;} - pubnub_remove_channelmetadata(ctx_pub, TCHAR_TO_ANSI(*ChannelMetadataID)); + pubnub_remove_channelmetadata(ctx_pub, TCHAR_TO_ANSI(*Channel)); pubnub_res PubnubResponse = pubnub_await(ctx_pub); if(PubnubResponse != PNR_OK) @@ -2137,7 +2137,7 @@ void UPubnubSubsystem::RemoveMemberships_priv(FString User, FString RemoveObj, F } } -FString UPubnubSubsystem::GetChannelMembers_pn(FString ChannelMetadataID, FString Include, int Limit, +FString UPubnubSubsystem::GetChannelMembers_pn(FString Channel, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { pubnub_members_opts PubnubOptions = pubnub_members_opts(); @@ -2154,21 +2154,21 @@ FString UPubnubSubsystem::GetChannelMembers_pn(FString ChannelMetadataID, FStrin PubnubOptions.limit = Limit; PubnubOptions.count = (pubnub_tribool)(uint8)Count; - pubnub_get_members_ex(ctx_pub,TCHAR_TO_ANSI(*ChannelMetadataID), PubnubOptions); + pubnub_get_members_ex(ctx_pub,TCHAR_TO_ANSI(*Channel), PubnubOptions); return GetLastResponse(ctx_pub); } -void UPubnubSubsystem::GetChannelMembers_JSON_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, +void UPubnubSubsystem::GetChannelMembers_JSON_priv(FString Channel, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "User", "GetChannelMembers")) + if(CheckIsFieldEmpty(Channel, "User", "GetChannelMembers")) {return;} - FString JsonResponse = GetChannelMembers_pn(ChannelMetadataID, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + FString JsonResponse = GetChannelMembers_pn(Channel, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetMembersResponse, JsonResponse]() @@ -2178,16 +2178,16 @@ void UPubnubSubsystem::GetChannelMembers_JSON_priv(FString ChannelMetadataID, FO }); } -void UPubnubSubsystem::GetChannelMembers_DATA_priv(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, +void UPubnubSubsystem::GetChannelMembers_DATA_priv(FString Channel, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "User", "GetChannelMembers")) + if(CheckIsFieldEmpty(Channel, "User", "GetChannelMembers")) {return;} - FString JsonResponse = GetChannelMembers_pn(ChannelMetadataID, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); + FString JsonResponse = GetChannelMembers_pn(Channel, Include, Limit, Filter, Sort, PageNext, PagePrev, Count); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetMembersResponse, JsonResponse]() @@ -2205,12 +2205,12 @@ void UPubnubSubsystem::GetChannelMembers_DATA_priv(FString ChannelMetadataID, FO } -void UPubnubSubsystem::AddChannelMembers_priv(FString ChannelMetadataID, FString AddObj, FString Include) +void UPubnubSubsystem::AddChannelMembers_priv(FString Channel, FString AddObj, FString Include) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "ChannelMetadataID", "AddChannelMembers") || CheckIsFieldEmpty(AddObj, "AddObj", "AddChannelMembers")) + if(CheckIsFieldEmpty(Channel, "Channel", "AddChannelMembers") || CheckIsFieldEmpty(AddObj, "AddObj", "AddChannelMembers")) {return;} if(!UPubnubJsonUtilities::IsCorrectJsonString(AddObj, false)) @@ -2219,7 +2219,7 @@ void UPubnubSubsystem::AddChannelMembers_priv(FString ChannelMetadataID, FString return; } - pubnub_add_members(ctx_pub, TCHAR_TO_ANSI(*ChannelMetadataID), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*AddObj)); + pubnub_add_members(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*AddObj)); pubnub_res PubnubResponse = pubnub_await(ctx_pub); if(PubnubResponse != PNR_OK) @@ -2228,12 +2228,12 @@ void UPubnubSubsystem::AddChannelMembers_priv(FString ChannelMetadataID, FString } } -void UPubnubSubsystem::SetChannelMembers_priv(FString ChannelMetadataID, FString SetObj, FString Include) +void UPubnubSubsystem::SetChannelMembers_priv(FString Channel, FString SetObj, FString Include) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "ChannelMetadataID", "SetChannelMembers") || CheckIsFieldEmpty(SetObj, "SetObj", "SetChannelMembers")) + if(CheckIsFieldEmpty(Channel, "Channel", "SetChannelMembers") || CheckIsFieldEmpty(SetObj, "SetObj", "SetChannelMembers")) {return;} if(!UPubnubJsonUtilities::IsCorrectJsonString(SetObj, false)) @@ -2242,7 +2242,7 @@ void UPubnubSubsystem::SetChannelMembers_priv(FString ChannelMetadataID, FString return; } - pubnub_set_members(ctx_pub, TCHAR_TO_ANSI(*ChannelMetadataID), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*SetObj)); + pubnub_set_members(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*SetObj)); pubnub_res PubnubResponse = pubnub_await(ctx_pub); if(PubnubResponse != PNR_OK) @@ -2251,12 +2251,12 @@ void UPubnubSubsystem::SetChannelMembers_priv(FString ChannelMetadataID, FString } } -void UPubnubSubsystem::RemoveChannelMembers_priv(FString ChannelMetadataID, FString RemoveObj, FString Include) +void UPubnubSubsystem::RemoveChannelMembers_priv(FString Channel, FString RemoveObj, FString Include) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelMetadataID, "ChannelMetadataID", "RemoveChannelMembers") || CheckIsFieldEmpty(RemoveObj, "RemoveObj", "RemoveChannelMembers")) + if(CheckIsFieldEmpty(Channel, "Channel", "RemoveChannelMembers") || CheckIsFieldEmpty(RemoveObj, "RemoveObj", "RemoveChannelMembers")) {return;} if(!UPubnubJsonUtilities::IsCorrectJsonString(RemoveObj, false)) @@ -2265,7 +2265,7 @@ void UPubnubSubsystem::RemoveChannelMembers_priv(FString ChannelMetadataID, FStr return; } - pubnub_remove_members(ctx_pub, TCHAR_TO_ANSI(*ChannelMetadataID), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*RemoveObj)); + pubnub_remove_members(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Include), TCHAR_TO_ANSI(*RemoveObj)); pubnub_res PubnubResponse = pubnub_await(ctx_pub); if(PubnubResponse != PNR_OK) @@ -2274,19 +2274,19 @@ void UPubnubSubsystem::RemoveChannelMembers_priv(FString ChannelMetadataID, FStr } } -void UPubnubSubsystem::AddMessageAction_priv(FString ChannelName, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse) +void UPubnubSubsystem::AddMessageAction_priv(FString Channel, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "AddMessageAction") || CheckIsFieldEmpty(MessageTimetoken, "MessageTimetoken", "AddMessageAction")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "AddMessageAction") || CheckIsFieldEmpty(MessageTimetoken, "MessageTimetoken", "AddMessageAction")) {return;} //Add quotes to these fields as they are required by C-Core FString FinalActionType = UPubnubUtilities::AddQuotesToString(ActionType); FString FinalValue = UPubnubUtilities::AddQuotesToString(Value); - pubnub_add_message_action_str(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*MessageTimetoken), TCHAR_TO_ANSI(*FinalActionType), TCHAR_TO_ANSI(*FinalValue)); + pubnub_add_message_action_str(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*MessageTimetoken), TCHAR_TO_ANSI(*FinalActionType), TCHAR_TO_ANSI(*FinalValue)); pubnub_res PubnubResponse = pubnub_await(ctx_pub); if(PubnubResponse != PNR_OK) { @@ -2311,12 +2311,12 @@ void UPubnubSubsystem::AddMessageAction_priv(FString ChannelName, FString Messag }); } -void UPubnubSubsystem::RemoveMessageAction_priv(FString ChannelName, FString MessageTimetoken, FString ActionTimetoken) +void UPubnubSubsystem::RemoveMessageAction_priv(FString Channel, FString MessageTimetoken, FString ActionTimetoken) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "RemoveMessageAction") || CheckIsFieldEmpty(MessageTimetoken, "MessageTimetoken", "RemoveMessageAction") + if(CheckIsFieldEmpty(Channel, "ChannelName", "RemoveMessageAction") || CheckIsFieldEmpty(MessageTimetoken, "MessageTimetoken", "RemoveMessageAction") || CheckIsFieldEmpty(ActionTimetoken, "ActionTimetoken", "RemoveMessageAction")) {return;} @@ -2343,7 +2343,7 @@ void UPubnubSubsystem::RemoveMessageAction_priv(FString ChannelName, FString Mes action_timetoken_chamebl.ptr = action_timetoken_char; action_timetoken_chamebl.size = FinalActionTimetoken.Len(); - pubnub_remove_message_action(ctx_pub, TCHAR_TO_ANSI(*ChannelName), message_timetoken_chamebl, action_timetoken_chamebl); + pubnub_remove_message_action(ctx_pub, TCHAR_TO_ANSI(*Channel), message_timetoken_chamebl, action_timetoken_chamebl); pubnub_res PubnubResponse = pubnub_await(ctx_pub); @@ -2359,22 +2359,22 @@ void UPubnubSubsystem::RemoveMessageAction_priv(FString ChannelName, FString Mes delete[] action_timetoken_char; } -FString UPubnubSubsystem::GetMessageActions_pn(FString ChannelName, FString Start, FString End, int SizeLimit) +FString UPubnubSubsystem::GetMessageActions_pn(FString Channel, FString Start, FString End, int SizeLimit) { - pubnub_get_message_actions(ctx_pub, TCHAR_TO_ANSI(*ChannelName), TCHAR_TO_ANSI(*Start), TCHAR_TO_ANSI(*End), SizeLimit); + pubnub_get_message_actions(ctx_pub, TCHAR_TO_ANSI(*Channel), TCHAR_TO_ANSI(*Start), TCHAR_TO_ANSI(*End), SizeLimit); return GetLastResponse(ctx_pub); } -void UPubnubSubsystem::GetMessageActions_JSON_priv(FString ChannelName, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse) +void UPubnubSubsystem::GetMessageActions_JSON_priv(FString Channel, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "HistoryWithMessageActions")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "HistoryWithMessageActions")) {return;} - FString JsonResponse = GetMessageActions_pn(ChannelName, Start, End, SizeLimit); + FString JsonResponse = GetMessageActions_pn(Channel, Start, End, SizeLimit); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetMessageActionsResponse, JsonResponse]() @@ -2384,15 +2384,15 @@ void UPubnubSubsystem::GetMessageActions_JSON_priv(FString ChannelName, FString }); } -void UPubnubSubsystem::GetMessageActions_DATA_priv(FString ChannelName, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse) +void UPubnubSubsystem::GetMessageActions_DATA_priv(FString Channel, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse) { if(!CheckIsUserIDSet()) {return;} - if(CheckIsFieldEmpty(ChannelName, "ChannelName", "HistoryWithMessageActions")) + if(CheckIsFieldEmpty(Channel, "ChannelName", "HistoryWithMessageActions")) {return;} - FString JsonResponse = GetMessageActions_pn(ChannelName, Start, End, SizeLimit); + FString JsonResponse = GetMessageActions_pn(Channel, Start, End, SizeLimit); //Delegate needs to be executed back on Game Thread AsyncTask(ENamedThreads::GameThread, [this, OnGetMessageActionsResponse, JsonResponse]() diff --git a/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h b/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h index 1379173..0c07317 100644 --- a/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h +++ b/Source/PubnubLibrary/Public/FunctionLibraries/PubnubJsonUtilities.h @@ -31,43 +31,82 @@ class PUBNUBLIBRARY_API UPubnubJsonUtilities : public UBlueprintFunctionLibrary static bool IsCorrectJsonString(const FString InString, bool AllowSimpleTypes = true); /* JSON CONVERTERS*/ - + + /** + * Converter from ListChannelsFromGroup_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void ListChannelsFromGroupJsonToData(FString ResponseJson, bool &Error, int &Status, TArray& Channels); + /** + * Converter from ListUserSubscribedChannels_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void ListUserSubscribedChannelsJsonToData(FString ResponseJson, int &Status, FString &Message, TArray& Channels); + /** + * Converter from ListUsersFromChannel_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void ListUsersFromChannelJsonToData(FString ResponseJson, int &Status, FString &Message, FPubnubListUsersFromChannelWrapper &Data); + /** + * Converter from FetchHistory_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void FetchHistoryJsonToData(FString ResponseJson, bool &Error, int &Status, FString &ErrorMessage, TArray &Messages); + /** + * Converter from GetAllUserMetadata_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetAllUserMetadataJsonToData(FString ResponseJson, int &Status, TArray &UsersData, FString &PageNext, FString &PagePrev); + /** + * Converter from GetUserMetadata_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetUserMetadataJsonToData(FString ResponseJson, int &Status, FPubnubUserData &UserData); + /** + * Converter from GetAllChannelMetadata_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetAllChannelMetadataJsonToData(FString ResponseJson, int &Status, TArray &ChannelsData, FString &PageNext, FString &PagePrev); + /** + * Converter from GetChannelMetadata_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetChannelMetadataJsonToData(FString ResponseJson, int &Status, FPubnubChannelData &ChannelData); + /** + * Converter from GetMessageActions_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetMessageActionsJsonToData(FString ResponseJson, int &Status, TArray &MessageActions); + /** + * Converter from GetMemberships_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetMembershipsJsonToData(FString ResponseJson, int &Status, TArray &MembershipsData, FString &PageNext, FString &PagePrev); + /** + * Converter from GetChannelMembers_Json response to actual types + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static void GetChannelMembersJsonToData(FString ResponseJson, int &Status, TArray &MembershipsData, FString &PageNext, FString &PagePrev); - + + /** + * Converter from Json string containing User data to FPubnubUserData + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static FPubnubUserData GetUserDataFromJson(FString ResponseJson); + /** + * Converter from Json string containing Channel data to FPubnubChannelData + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category="Pubnub|Json Utilities") static FPubnubChannelData GetChannelDataFromJson(FString ResponseJson); }; diff --git a/Source/PubnubLibrary/Public/PubnubStructLibrary.h b/Source/PubnubLibrary/Public/PubnubStructLibrary.h index e1d8d07..799d103 100644 --- a/Source/PubnubLibrary/Public/PubnubStructLibrary.h +++ b/Source/PubnubLibrary/Public/PubnubStructLibrary.h @@ -87,7 +87,7 @@ struct FPubnubFetchHistorySettings */ UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") int MaxPerChannel = 0; /** Direction of time traversal. Default is false, which means - * timeline is traversed newest to oldest. */ + * timeline is traversed newest to oldest. */ UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Reverse = false; /** If provided (not NULL), lets you select a "start date", in * Timetoken format. If not provided, it will default to current @@ -135,12 +135,19 @@ struct FPubnubChannelPermissions { GENERATED_BODY() + //Read permission. Applies to Subscribe, History, and Presence. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Read = false; + //Write permission. Applies to Publish. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Write = false; + //Delete permission. Applies to History and App Context. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Delete = false; + //Get permission. Applies to App Context. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Get = false; + //Update permission. Applies to App Context. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Update = false; + //Manage permission. Applies to Channel Groups and App Context. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Manage = false; + //Join permission. Applies to App Context. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Join = false; }; @@ -149,7 +156,9 @@ struct FPubnubChannelGroupPermissions { GENERATED_BODY() + //Read permission. Applies to presence and history access for the group. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Read = false; + //Manage permission. Applies to modifying members of the group. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Manage = false; }; @@ -158,8 +167,11 @@ struct FPubnubUserPermissions { GENERATED_BODY() + //Delete permission. Allows deletion of user metadata. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Delete = false; + //Get permission. Allows retrieval of user metadata. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Get = false; + //Update permission. Allows updating of user metadata. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") bool Update = false; }; @@ -168,19 +180,33 @@ struct FPubnubGrantTokenStructure { GENERATED_BODY() + //Time-To-Live (TTL) in minutes for the granted token. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") int TTLMinutes = 0; + //The User that is authorized by this grant. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString AuthorizedUser = ""; + //List of channel names included in this grant. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray Channels; + //Permissions applied to the listed channels. Has to be either 1 or the same amount as Channels. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray ChannelPermissions; + //List of channel group names included in this grant. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray ChannelGroups; + //Permissions applied to the listed channel groups. Has to be either 1 or the same amount as ChannelGroups. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray ChannelGroupPermissions; + //List of Users included in this grant. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray Users; + //Permissions applied to the listed Users. Has to be either 1 or the same amount as Users. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray UserPermissions; + //List of channel name patterns included in this grant. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray ChannelPatterns; + //Permissions applied to the listed channel name patterns. Has to be either 1 or the same amount as ChannelPatterns. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray ChannelPatternPermissions; + //List of channel group name patterns included in this grant. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray ChannelGroupPatterns; + //Permissions applied to the listed channel group name patterns. Has to be either 1 or the same amount as ChannelGroupPatterns. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray ChannelGroupPatternPermissions; + //List of User name patterns included in this grant. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray UserPatterns; + //Permissions applied to the listed User name patterns. Has to be either 1 or the same amount as UserPatterns. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray UserPatternPermissions; }; @@ -189,7 +215,9 @@ struct FPubnubListUsersFromChannelWrapper { GENERATED_BODY() + //The number of users in a given channel. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") int Occupancy = 0; + //A map of user IDs and their respective state. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TMap UsersState; }; @@ -197,25 +225,35 @@ USTRUCT(BlueprintType) struct FPubnubMessageActionData { GENERATED_BODY() - + + //Message action type. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; + //Message action value. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Value = ""; + //User ID of the user who added the action. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString UserID = ""; + //Timetoken indicating when the message action was added. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ActionTimetoken = ""; + //Timetoken indicating when the message the action was added to had been sent. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString MessageTimetoken = ""; - }; USTRUCT(BlueprintType) struct FPubnubHistoryMessageData { GENERATED_BODY() - + + //The message text. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Message = ""; + //User ID of the user who sent the message. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString UserID = ""; + //Timetoken indicating when the message was sent. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Timetoken = ""; + //Additional information. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Meta = ""; + //Type of the message. Refer to Message types for more information. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString MessageType = ""; + //An array of FPubnubMessageActionData structs which are message actions that were added to the historical messages. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") TArray MessageActions; }; @@ -224,15 +262,25 @@ struct FPubnubUserData { GENERATED_BODY() + //Unique user identifier. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString UserID = ""; + //Display name for the user. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString UserName = ""; + //User's identifier in an external system. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ExternalID = ""; + //The URL of the user's profile picture. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ProfileUrl = ""; + //The user's email address. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Email = ""; + //JSON object providing custom user data. Only a single level of key-value pairs is allowed. Nested JSON objects or arrays are not supported. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Custom = ""; + //User status. Max. 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Status = ""; + //User type. Max. 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; + //The date when the user's metadata was last updated. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Updated = ""; + //Information on the object's content fingerprint. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ETag = ""; }; @@ -241,13 +289,21 @@ struct FPubnubChannelData { GENERATED_BODY() + //Unique channel identifier. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ChannelID = ""; + //Display name for the channel. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ChannelName = ""; + //Description of the channel. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Description = ""; + //JSON object providing custom channel data. Only a single level of key-value pairs is allowed. Nested JSON objects or arrays are not supported. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Custom = ""; + //Channel status. Max 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Status = ""; + //Channel type. Max 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; + //The date when the channel's metadata was last updated. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Updated = ""; + //Version identifier of the channel's metadata. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ETag = ""; }; @@ -256,11 +312,17 @@ struct FPubnubGetMembershipsWrapper { GENERATED_BODY() + //Contains channel metadata, depending on requested includes in the call UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FPubnubChannelData Channel; + //JSON providing custom data about the membership. Only a single level of key-value pairs is allowed. Nested JSON objects or arrays are not supported. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Custom = ""; + //Status of the membership. Max 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Status = ""; + //Type of the membership. Max 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; + //The date when the channel's membership was last updated. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Updated = ""; + //Version identifier of the membership metadata. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ETag = ""; }; @@ -269,10 +331,16 @@ struct FPubnubGetChannelMembersWrapper { GENERATED_BODY() + //Contains user metadata, depending on requested includes in the call UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FPubnubUserData User; + //JSON providing custom data about the member. Only a single level of key-value pairs is allowed. Nested JSON objects or arrays are not supported. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Custom = ""; + //Status of the membership. Max 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Status = ""; + //Type of the membership. Max 50 characters. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Type = ""; + //The date when the membership was last updated. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString Updated = ""; + //Version identifier of the membership metadata. UPROPERTY(BlueprintReadWrite, VisibleAnywhere, Category = "Pubnub") FString ETag = ""; }; \ No newline at end of file diff --git a/Source/PubnubLibrary/Public/PubnubSubsystem.h b/Source/PubnubLibrary/Public/PubnubSubsystem.h index b0039d0..9c9e896 100644 --- a/Source/PubnubLibrary/Public/PubnubSubsystem.h +++ b/Source/PubnubLibrary/Public/PubnubSubsystem.h @@ -58,187 +58,674 @@ class PUBNUBLIBRARY_API UPubnubSubsystem : public UGameInstanceSubsystem /* BLUEPRINT EXPOSED FUNCTIONS */ //These functions don't have actual logic, they just call corresponding private functions on Pubnub threads - + + /** + * Initializes PubNub systems. Needs to be called before starting using any other PubNub features. + * Don't call it manually if "InitializeAutomatically" in plugin settings is set to true. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Init") void InitPubnub(); - + + /** + * Deinitializes PubNub systems. Call it only if you want to manually stop all PubNub systems. + * It's called automatically when closing the game. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Init") void DeinitPubnub(); + /** + * Sets the user ID for the current session. + * + * @param UserID The user ID to set. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Users") void SetUserID(FString UserID); + /** + * Gets the current user ID. + * + * @return The current user ID. + */ UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Pubnub|Users") FString GetUserID(); + /** + * Sets the secret key for the PubNub account. Uses SecretKey provided in plugin settings. + * Don't call it manually if "SetSecretKeyAutomatically" in plugin settings is set to true. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Init") void SetSecretKey(); /** - * Publish message in Json format to a specified channel - * @param ChannelName Channel to publish message to. Can't be empty. - * @param Message Message to publish. Has to be in Json format. - * @param PublishSettings Optional advanced publish settings + * Publishes a message to a specified channel. + * + * @param Channel The ID of the channel to publish the message to. + * @param Message The message to publish. This message can be any data type that can be serialized into JSON. + * @param PublishSettings Optional settings for the publish operation. See FPubnubPublishSettings for more details. */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Publish") - void PublishMessage(FString ChannelName, FString Message, FPubnubPublishSettings PublishSettings = FPubnubPublishSettings()); + void PublishMessage(FString Channel, FString Message, FPubnubPublishSettings PublishSettings = FPubnubPublishSettings()); + /** + * Sends a signal to a specified channel. + * + * @param Channel The ID of the channel to send the signal to. + * @param Message The message to send as the signal. This message can be any data type that can be serialized into JSON. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Publish") - void Signal(FString ChannelName, FString Message); - + void Signal(FString Channel, FString Message); + + /** + * Subscribes to a specified channel - start listening for messages on that channel. + * Use OnMessageReceived Callback to get those messages. + * + * @param Channel The ID of the channel to subscribe to. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Subscribe") - void SubscribeToChannel(FString ChannelName); + void SubscribeToChannel(FString Channel); + /** + * Subscribes to a specified group - start listening for messages on that group. + * Use OnMessageReceived Callback to get those messages. + * + * @param GroupName The name of the channel to subscribe to. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Subscribe") void SubscribeToGroup(FString GroupName); + /** + * Unsubscribes from a specified channel - stop listening for messages on that channel. + * + * @param Channel The ID of the channel to unsubscribe from. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Subscribe") - void UnsubscribeFromChannel(FString ChannelName); + void UnsubscribeFromChannel(FString Channel); + /** + * Unsubscribes from a specified group - stop listening for messages on that group. + * + * @param GroupName The name of the group to unsubscribe from. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Subscribe") void UnsubscribeFromGroup(FString GroupName); - + + /** + * Unsubscribes from all subscribed channels and groups - basically stop listening for any messages. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Subscribe") void UnsubscribeFromAll(); - UFUNCTION(BlueprintCallable, Category = "Pubnub|Channels") - void AddChannelToGroup(FString ChannelName, FString ChannelGroup); + /** + * Adds a channel to a specified channel group. + * + * @Note Requires the *Stream Controller* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param Channel The ID of the channel to add to the channel group. + * @param ChannelGroup The name of the channel group to add the channel to. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Channel Groups") + void AddChannelToGroup(FString Channel, FString ChannelGroup); - UFUNCTION(BlueprintCallable, Category = "Pubnub|Channels") - void RemoveChannelFromGroup(FString ChannelName, FString ChannelGroup); - - UFUNCTION(BlueprintCallable, Category = "Pubnub|Channels") + /** + * Removes a channel from a specified channel group. + * + * @Note Requires the *Stream Controller* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param Channel The ID of the channel to remove from the channel group. + * @param ChannelGroup The name of the channel group to remove the channel from. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Channel Groups") + void RemoveChannelFromGroup(FString Channel, FString ChannelGroup); + + /** + * Lists the channels that belong to a specified channel group. + * + * @Note Requires the *Stream Controller* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param ChannelGroup The name of the channel group to list channels from. + * @param OnListChannelsResponse The callback function used to handle the result. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Channel Groups") void ListChannelsFromGroup(FString ChannelGroup, FOnListChannelsFromGroupResponse OnListChannelsResponse); - UFUNCTION(BlueprintCallable, Category = "Pubnub|Channels") + /** + * Lists the channels that belong to a specified channel group. + * + * @Note Requires the *Stream Controller* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param ChannelGroup The name of the channel group to list channels from. + * @param OnListChannelsResponse The callback function used to handle the result in JSON format. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Channel Groups") void ListChannelsFromGroup_JSON(FString ChannelGroup, FOnPubnubResponse OnListChannelsResponse); - UFUNCTION(BlueprintCallable, Category = "Pubnub|Channels") + /** + * Removes a specified channel group. + * + * @Note Requires the *Stream Controller* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param ChannelGroup The name of the channel group to remove. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Channel Groups") void RemoveChannelGroup(FString ChannelGroup); + /** + * Lists the users currently present on a specified channel. + * + * @Note Requires the *Presence* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param Channel The ID of the channel to list users from. + * @param ListUsersFromChannelResponse The callback function used to handle the result. + * @param ListUsersFromChannelSettings Optional settings for the list users operation. See FPubnubListUsersFromChannelSettings for more details. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Presence") - void ListUsersFromChannel(FString ChannelName, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); + void ListUsersFromChannel(FString Channel, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); + /** + * Lists the users currently present on a specified channel. + * + * @Note Requires the *Presence* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param Channel The ID of the channel to list users from. + * @param ListUsersFromChannelResponse The callback function used to handle the result in Json format. + * @param ListUsersFromChannelSettings Optional settings for the list users operation. See FPubnubListUsersFromChannelSettings for more details. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Presence") - void ListUsersFromChannel_JSON(FString ChannelName, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); - + void ListUsersFromChannel_JSON(FString Channel, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); + + /** + * Lists the channels that a specified user is currently subscribed to. + * + * @Note Requires the *Presence* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param UserID The user ID to list subscribed channels for. + * @param ListUserSubscribedChannelsResponse The callback function used to handle the result. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Presence") void ListUserSubscribedChannels(FString UserID, FOnListUsersSubscribedChannelsResponse ListUserSubscribedChannelsResponse); + /** + * Lists the channels that a specified user is currently subscribed to. + * + * @Note Requires the *Presence* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param UserID The user ID to list subscribed channels for. + * @param ListUserSubscribedChannelsResponse The callback function used to handle the result in JSON format. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Presence") void ListUserSubscribedChannels_JSON(FString UserID, FOnPubnubResponse ListUserSubscribedChannelsResponse); + /** + * Sets the presence state for the current user on a specified channel. + * + * @Note Requires the *Presence* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param Channel The ID of the channel to set the state on. + * @param StateJson The JSON string representing the state to set. + * @param SetStateSettings Optional settings for the set state operation. See FPubnubSetStateSettings for more details. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Presence") - void SetState(FString ChannelName, FString StateJson, FPubnubSetStateSettings SetStateSettings = FPubnubSetStateSettings()); + void SetState(FString Channel, FString StateJson, FPubnubSetStateSettings SetStateSettings = FPubnubSetStateSettings()); + /** + * Gets the presence state for a specified user on a specified channel. + * + * @Note Requires the *Presence* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param Channel The ID of the channel to get the state from. + * @param ChannelGroup The name of the channel group to get the state from. + * @param UserID The user ID to get the state for. + * @param OnGetStateResponse The callback function used to handle the result in JSON format. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Presence") - void GetState(FString ChannelName, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse); + void GetState(FString Channel, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse); + /** + * This method notifies channels and channel groups about a client's presence. + * You can send heartbeats to channels you are not subscribed to. + * + * @Note Requires the *Presence* add-on to be enabled for your key in the PubNub Admin Portal. + * + * @param Channel The ID of the channel to send the heartbeat to. + * @param ChannelGroup The name of the channel group to send the heartbeat to. + */ UFUNCTION(BlueprintCallable, Category = "Pubnub|Presence") - void Heartbeat(FString ChannelName, FString ChannelGroup); + void Heartbeat(FString Channel, FString ChannelGroup); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AccessManager") + /** + * Requests an access token from the PubNub server with the specified permissions. + * Use GrantTokenStructureToJsonString function to easily create correct PermissionObject. + * + * @Note Requires the *Access Manager* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param PermissionObject A JSON object representing the desired permissions for the token. + * @param OnGrantTokenResponse The callback function used to handle the result. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Access Manager") void GrantToken(FString PermissionObject, FOnPubnubResponse OnGrantTokenResponse); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AccessManager") + /** + * Revokes a previously granted access token. + * + * @Note Requires the *Revoke v3 Token* in *Access Manager* section to be enabled for your key in the PubNub Admin Portal + * + * @param Token The access token to revoke. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Access Manager") void RevokeToken(FString Token); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AccessManager") + /** + * Parses an access token and retrieves information about its permissions. + * + * @Note Requires the *Access Manager* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Token The access token to parse. + * @param OnParseTokenResponse The callback function used to handle the result in JSON format. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Access Manager") void ParseToken(FString Token, FOnPubnubResponse OnParseTokenResponse); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AccessManager") + /** + * This method is used by the client devices to update the authentication token granted by the server. + * + * @param Token Existing token with embedded permissions. + * + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Access Manager") void SetAuthToken(FString Token); - UFUNCTION(BlueprintCallable, Category = "Pubnub|MessagePersistence") - void FetchHistory(FString ChannelName, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); + /** + * Fetches historical messages from a specified channel using Message Persistence. + * + * @Note Requires the *Message Persistence* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The ID of the channel to fetch messages from. + * @param OnFetchHistoryResponse The callback function used to handle the result. + * @param FetchHistorySettings Optional settings for the fetch history operation. See FPubnubFetchHistorySettings for more details. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Persistence") + void FetchHistory(FString Channel, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); - UFUNCTION(BlueprintCallable, Category = "Pubnub|MessagePersistence") - void FetchHistory_JSON(FString ChannelName, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); + /** + * Fetches historical messages from a specified channel using Message Persistence. + * + * @Note Requires the *Message Persistence* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The ID of the channel to fetch messages from. + * @param OnFetchHistoryResponse The callback function used to handle the result in JSON format. + * @param FetchHistorySettings Optional settings for the fetch history operation. See FPubnubFetchHistorySettings for more details. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Persistence") + void FetchHistory_JSON(FString Channel, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); - UFUNCTION(BlueprintCallable, Category = "Pubnub|MessagePersistence") - void MessageCounts(FString ChannelName, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse); + /** + * Returns the number of messages published on one or more channels since a given time. + * The count returned is the number of messages in history with a Timetoken value greater + * than or equal to than the passed value in the Timetoken parameter. + * + * @Note Requires the *Message Persistence* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The ID of the channel to count messages for. + * @param Timetoken The timetoken to start counting messages from. + * @param OnMessageCountsResponse The callback function used to handle the result. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Persistence") + void MessageCounts(FString Channel, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + /** + * Returns a paginated list of User Metadata objects, optionally including the custom data object for each. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param OnGetAllUserMetadataResponse The callback function used to handle the result. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) void GetAllUserMetadata(FOnGetAllUserMetadataResponse OnGetAllUserMetadataResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + /** + * Returns a paginated list of User Metadata objects, optionally including the custom data object for each. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param OnGetAllUserMetadataResponse The callback function used to handle the result in JSON format. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) void GetAllUserMetadata_JSON(FOnPubnubResponse OnGetAllUserMetadataResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") + + /** + * Sets metadata for a specified User in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to set metadata. + * @param UserMetadataObj A JSON string representing the metadata to set. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") void SetUserMetadata(FString User, FString UserMetadataObj, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") + /** + * Retrieves metadata for a specified User from the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to retrieve metadata. + * @param OnGetUserMetadataResponse The callback function used to handle the result. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") void GetUserMetadata(FString User, FOnGetUserMetadataResponse OnGetUserMetadataResponse, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") + /** + * Retrieves metadata for a specified User from the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to retrieve metadata. + * @param OnGetUserMetadataResponse The callback function used to handle the result in JSON format. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") void GetUserMetadata_JSON(FString User, FOnPubnubResponse OnGetUserMetadataResponse, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") + /** + * Removes all metadata associated with a specified User from the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to remove metadata. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") void RemoveUserMetadata(FString User); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + /** + * Returns a paginated list of Channel Metadata objects, optionally including the custom data object for each. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param OnGetAllChannelMetadataResponse The callback function used to handle the result. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) void GetAllChannelMetadata(FOnGetAllChannelMetadataResponse OnGetAllChannelMetadataResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + /** + * Returns a paginated list of Channel Metadata objects, optionally including the custom data object for each. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param OnGetAllChannelMetadataResponse The callback function used to handle the result in JSON format. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) void GetAllChannelMetadata_JSON(FOnPubnubResponse OnGetAllChannelMetadataResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") - void SetChannelMetadata(FString ChannelMetadataID, FString ChannelMetadataObj, FString Include = ""); + /** + * Sets metadata for a specified Channel in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The user ID for whom to set metadata. + * @param ChannelMetadataObj A JSON string representing the metadata to set. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") + void SetChannelMetadata(FString Channel, FString ChannelMetadataObj, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") - void GetChannelMetadata(FString ChannelMetadataID, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include = ""); + /** + * Retrieves metadata for a specified Channel from the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The user ID for whom to retrieve metadata. + * @param OnGetChannelMetadataResponse The callback function used to handle the result. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") + void GetChannelMetadata(FString Channel, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") - void GetChannelMetadata_JSON(FString ChannelMetadataID, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include = ""); + /** + * Retrieves metadata for a specified Channel from the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The user ID for whom to retrieve metadata. + * @param OnGetChannelMetadataResponse The callback function used to handle the result in JSON format. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") + void GetChannelMetadata_JSON(FString Channel, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") - void RemoveChannelMetadata(FString ChannelMetadataID); + /** + * Removes all metadata associated with a specified Channel from the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The user ID for whom to remove metadata. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") + void RemoveChannelMetadata(FString Channel); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + /** + * Retrieves a list of memberships for a specified User in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to retrieve memberships. + * @param OnGetMembershipResponse The callback function used to handle the result. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) void GetMemberships(FString User, FOnGetMembershipsResponse OnGetMembershipResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + /** + * Retrieves a list of memberships for a specified User in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to retrieve memberships. + * @param OnGetMembershipResponse The callback function used to handle the result in JSON format. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) void GetMemberships_JSON(FString User, FOnPubnubResponse OnGetMembershipResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") + + /** + * Sets memberships for a specified User in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to set memberships. + * @param SetObj A JSON string representing the memberships to set. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") void SetMemberships(FString User, FString SetObj, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") + /** + * Removes memberships for a specified User from the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param User The user ID for whom to set memberships. + * @param RemoveObj A JSON string representing the memberships to remove. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") void RemoveMemberships(FString User, FString RemoveObj, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) - void GetChannelMembers(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); + /** + * Retrieves a list of members for a specified Channel in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The user ID for whom to retrieve memberships. + * @param OnGetMembersResponse The callback function used to handle the result. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + void GetChannelMembers(FString Channel, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) - void GetChannelMembers_JSON(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); + /** + * Retrieves a list of members for a specified Channel in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The user ID for whom to retrieve memberships. + * @param OnGetMembersResponse The callback function used to handle the result in JSON format. + * @param Include (Optional) A comma-separated list of property names to include in the response. + * @param Limit (Optional) The maximum number of results to return (default: 100). + * @param Filter (Optional) Expression used to filter the results. Check online documentation to see exact filter formulas; + * @param Sort (Optional) Key-value pair of a property to sort by, and a sort direction. For example: {name: 'asc'} + * @param PageNext (Optional) A string to retrieve the next page of results (if applicable). + * @param PagePrev (Optional) A string to retrieve the previous page of results (if applicable). + * @param Count (Optional) Whether to include a total count of users in the response (default: not set). + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context", meta=(AdvancedDisplay="Filter,Sort,PageNext,PagePrev,Count")) + void GetChannelMembers_JSON(FString Channel, FOnPubnubResponse OnGetMembersResponse, FString Include = "", int Limit = 100, FString Filter = "", FString Sort = "", FString PageNext = "", FString PagePrev = "", EPubnubTribool Count = EPubnubTribool::PT_NotSet); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") - void AddChannelMembers(FString ChannelMetadataID, FString AddObj, FString Include = ""); + /** + * Adds Users to a specified Channel in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The channel name to add members to. + * @param AddObj A JSON string representing the users to add. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") + void AddChannelMembers(FString Channel, FString AddObj, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") - void SetChannelMembers(FString ChannelMetadataID, FString SetObj, FString Include = ""); + /** + * Sets the members of a specified channel in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The channel name to add members to. + * @param SetObj A JSON string representing the users to set as members. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") + void SetChannelMembers(FString Channel, FString SetObj, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|AppContext") - void RemoveChannelMembers(FString ChannelMetadataID, FString RemoveObj, FString Include = ""); + /** + * Removes users from a specified channel in the PubNub App Context. + * + * @Note Requires the *App Context* add-on to be enabled for your key in the PubNub Admin Portal + * + * @param Channel The channel name to add members to. + * @param RemoveObj A JSON string representing the users to remove. + * @param Include (Optional) A comma-separated list of property names to include in the response. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|App Context") + void RemoveChannelMembers(FString Channel, FString RemoveObj, FString Include = ""); - UFUNCTION(BlueprintCallable, Category = "Pubnub|MessageActions") - void AddMessageAction(FString ChannelName, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse); - - UFUNCTION(BlueprintCallable, Category = "Pubnub|MessageActions") - void GetMessageActions(FString ChannelName, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse); + /** + * Adds a message action to a specific message in a channel. + * + * @param Channel The ID of the channel. + * @param MessageTimetoken The timetoken of the message to add the action to. + * @param ActionType The type of action to add. + * @param Value The value associated with the action. + * @param AddActionResponse The callback function used to handle the result. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Actions") + void AddMessageAction(FString Channel, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse); - UFUNCTION(BlueprintCallable, Category = "Pubnub|MessageActions") - void GetMessageActions_JSON(FString ChannelName, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse); - - UFUNCTION(BlueprintCallable, Category = "Pubnub|MessageActions") - void RemoveMessageAction(FString ChannelName, FString MessageTimetoken, FString ActionTimetoken); + /** + * Retrieves message actions for a specified channel within a given time range. + * + * @param Channel The ID of the channel. + * @param Start The starting timetoken for the range. + * @param End The ending timetoken for the range. + * @param SizeLimit The maximum number of actions to retrieve. + * @param OnGetMessageActionsResponse The callback function used to handle the result. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Actions") + void GetMessageActions(FString Channel, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse); + + /** + * Retrieves message actions for a specified channel within a given time range. + * + * @param Channel The ID of the channel. + * @param Start The starting timetoken for the range. + * @param End The ending timetoken for the range. + * @param SizeLimit The maximum number of actions to retrieve. + * @param OnGetMessageActionsResponse The callback function used to handle the result in JSON format. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Actions") + void GetMessageActions_JSON(FString Channel, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse); + + /** + * Removes a specific message action from a message in a channel. + * + * @param Channel The ID of the channel. + * @param MessageTimetoken The timetoken of the message. + * @param ActionTimetoken The timetoken of the action to remove. + */ + UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Actions") + void RemoveMessageAction(FString Channel, FString MessageTimetoken, FString ActionTimetoken); - //UFUNCTION(BlueprintCallable, Category = "Pubnub|MessageActions") + //UFUNCTION(BlueprintCallable, Category = "Pubnub|Message Actions") //void GetMessageActionsContinue(FOnPubnubResponse OnGetMessageActionsContinueResponse); #pragma endregion - UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Pubnub|AccessManager") + /** + * Helper function to create correct PermissionObject for GrantToken function. + * + * @Note For an object type there has to be 1 permission or the same amount of permissions as there are objects. + * For example. If there are 3 Channels, there can be either 1 ChannelPermission (it will be given for all those + * 3 channels) or 3 ChannelPermission (each channel will receive permission from corresponding permissions index) + * + * @param TokenStructure Structure containing all required data to GrantToken. + * @param success True if data was provided correctly. + */ + UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Pubnub|Access Manager") FString GrantTokenStructureToJsonString(FPubnubGrantTokenStructure TokenStructure, bool &success); bool CheckIsFieldEmpty(FString Field, FString FieldName, FString FunctionName); @@ -326,36 +813,36 @@ class PUBNUBLIBRARY_API UPubnubSubsystem : public UGameInstanceSubsystem void DeinitPubnub_priv(); void SetUserID_priv(FString UserID); void SetSecretKey_priv(); - void PublishMessage_priv(FString ChannelName, FString Message, FPubnubPublishSettings PublishSettings = FPubnubPublishSettings()); - void Signal_priv(FString ChannelName, FString Message); - void SubscribeToChannel_priv(FString ChannelName); + void PublishMessage_priv(FString Channel, FString Message, FPubnubPublishSettings PublishSettings = FPubnubPublishSettings()); + void Signal_priv(FString Channel, FString Message); + void SubscribeToChannel_priv(FString Channel); void SubscribeToGroup_priv(FString GroupName); - void UnsubscribeFromChannel_priv(FString ChannelName); + void UnsubscribeFromChannel_priv(FString Channel); void UnsubscribeFromGroup_priv(FString GroupName); void UnsubscribeFromAll_priv(); - void AddChannelToGroup_priv(FString ChannelName, FString ChannelGroup); - void RemoveChannelFromGroup_priv(FString ChannelName, FString ChannelGroup); + void AddChannelToGroup_priv(FString Channel, FString ChannelGroup); + void RemoveChannelFromGroup_priv(FString Channel, FString ChannelGroup); FString ListChannelsFromGroup_pn(FString ChannelGroup); void ListChannelsFromGroup_JSON_priv(FString ChannelGroup, FOnPubnubResponse OnListChannelsResponse); void ListChannelsFromGroup_DATA_priv(FString ChannelGroup, FOnListChannelsFromGroupResponse OnListChannelsResponse); void RemoveChannelGroup_priv(FString ChannelGroup); - FString ListUsersFromChannel_pn(FString ChannelName, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); - void ListUsersFromChannel_JSON_priv(FString ChannelName, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); - void ListUsersFromChannel_DATA_priv(FString ChannelName, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); + FString ListUsersFromChannel_pn(FString Channel, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); + void ListUsersFromChannel_JSON_priv(FString Channel, FOnPubnubResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); + void ListUsersFromChannel_DATA_priv(FString Channel, FOnListUsersFromChannelResponse ListUsersFromChannelResponse, FPubnubListUsersFromChannelSettings ListUsersFromChannelSettings = FPubnubListUsersFromChannelSettings()); FString ListUserSubscribedChannels_pn(FString UserID); void ListUserSubscribedChannels_JSON_priv(FString UserID, FOnPubnubResponse ListUserSubscribedChannelsResponse); void ListUserSubscribedChannels_DATA_priv(FString UserID, FOnListUsersSubscribedChannelsResponse ListUserSubscribedChannelsResponse); - void SetState_priv(FString ChannelName, FString StateJson, FPubnubSetStateSettings SetStateSettings = FPubnubSetStateSettings()); - void GetState_priv(FString ChannelName, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse); - void Heartbeat_priv(FString ChannelName, FString ChannelGroup); + void SetState_priv(FString Channel, FString StateJson, FPubnubSetStateSettings SetStateSettings = FPubnubSetStateSettings()); + void GetState_priv(FString Channel, FString ChannelGroup, FString UserID, FOnPubnubResponse OnGetStateResponse); + void Heartbeat_priv(FString Channel, FString ChannelGroup); void GrantToken_priv(FString PermissionObject, FOnPubnubResponse OnGrantTokenResponse); void RevokeToken_priv(FString Token); void ParseToken_priv(FString Token, FOnPubnubResponse OnParseTokenResponse); void SetAuthToken_priv(FString Token); - FString FetchHistory_pn(FString ChannelName, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); - void FetchHistory_JSON_priv(FString ChannelName, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); - void FetchHistory_DATA_priv(FString ChannelName, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); - void MessageCounts_priv(FString ChannelName, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse); + FString FetchHistory_pn(FString Channel, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); + void FetchHistory_JSON_priv(FString Channel, FOnPubnubResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); + void FetchHistory_DATA_priv(FString Channel, FOnFetchHistoryResponse OnFetchHistoryResponse, FPubnubFetchHistorySettings FetchHistorySettings = FPubnubFetchHistorySettings()); + void MessageCounts_priv(FString Channel, FString Timetoken, FOnPubnubIntResponse OnMessageCountsResponse); FString GetAllUserMetadata_pn(FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void GetAllUserMetadata_JSON_priv(FOnPubnubResponse OnGetAllUserMetadataResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void GetAllUserMetadata_DATA_priv(FOnGetAllUserMetadataResponse OnGetAllUserMetadataResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); @@ -367,27 +854,27 @@ class PUBNUBLIBRARY_API UPubnubSubsystem : public UGameInstanceSubsystem FString GetAllChannelMetadata_pn(FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void GetAllChannelMetadata_JSON_priv(FOnPubnubResponse OnGetAllChannelMetadataResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void GetAllChannelMetadata_DATA_priv(FOnGetAllChannelMetadataResponse OnGetAllChannelMetadataResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); - void SetChannelMetadata_priv(FString ChannelMetadataID, FString ChannelMetadataObj, FString Include); - FString GetChannelMetadata_pn(FString ChannelMetadataID, FString Include); - void GetChannelMetadata_JSON_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include); - void GetChannelMetadata_DATA_priv(FString ChannelMetadataID, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include); - void RemoveChannelMetadata_priv(FString ChannelMetadataID); + void SetChannelMetadata_priv(FString Channel, FString ChannelMetadataObj, FString Include); + FString GetChannelMetadata_pn(FString Channel, FString Include); + void GetChannelMetadata_JSON_priv(FString Channel, FOnPubnubResponse OnGetChannelMetadataResponse, FString Include); + void GetChannelMetadata_DATA_priv(FString Channel, FOnGetChannelMetadataResponse OnGetChannelMetadataResponse, FString Include); + void RemoveChannelMetadata_priv(FString Channel); FString GetMemberships_pn(FString User, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void GetMemberships_JSON_priv(FString User, FOnPubnubResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void GetMemberships_DATA_priv(FString User, FOnGetMembershipsResponse OnGetMembershipResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); void SetMemberships_priv(FString User, FString SetObj, FString Include); void RemoveMemberships_priv(FString User, FString RemoveObj, FString Include); - FString GetChannelMembers_pn(FString ChannelMetadataID, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); - void GetChannelMembers_JSON_priv(FString ChannelMetadataID, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); - void GetChannelMembers_DATA_priv(FString ChannelMetadataID, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); - void AddChannelMembers_priv(FString ChannelMetadataID, FString AddObj, FString Include); - void SetChannelMembers_priv(FString ChannelMetadataID, FString SetObj, FString Include); - void RemoveChannelMembers_priv(FString ChannelMetadataID, FString Include, FString RemoveObj); - void AddMessageAction_priv(FString ChannelName, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse); - void RemoveMessageAction_priv(FString ChannelName, FString MessageTimetoken, FString ActionTimetoken); - FString GetMessageActions_pn(FString ChannelName, FString Start, FString End, int SizeLimit); - void GetMessageActions_JSON_priv(FString ChannelName, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse); - void GetMessageActions_DATA_priv(FString ChannelName, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse); + FString GetChannelMembers_pn(FString Channel, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + void GetChannelMembers_JSON_priv(FString Channel, FOnPubnubResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + void GetChannelMembers_DATA_priv(FString Channel, FOnGetChannelMembersResponse OnGetMembersResponse, FString Include, int Limit, FString Filter, FString Sort, FString PageNext, FString PagePrev, EPubnubTribool Count); + void AddChannelMembers_priv(FString Channel, FString AddObj, FString Include); + void SetChannelMembers_priv(FString Channel, FString SetObj, FString Include); + void RemoveChannelMembers_priv(FString Channel, FString Include, FString RemoveObj); + void AddMessageAction_priv(FString Channel, FString MessageTimetoken, FString ActionType, FString Value, FOnAddMessageActionsResponse AddActionResponse); + void RemoveMessageAction_priv(FString Channel, FString MessageTimetoken, FString ActionTimetoken); + FString GetMessageActions_pn(FString Channel, FString Start, FString End, int SizeLimit); + void GetMessageActions_JSON_priv(FString Channel, FString Start, FString End, int SizeLimit, FOnPubnubResponse OnGetMessageActionsResponse); + void GetMessageActions_DATA_priv(FString Channel, FString Start, FString End, int SizeLimit, FOnGetMessageActionsResponse OnGetMessageActionsResponse); void GetMessageActionsContinue_priv(FOnPubnubResponse OnGetMessageActionsContinueResponse); #pragma endregion