|
Stream Chat Unreal SDK
|
The client-side representation of a Stream Chat channel. More...
#include <ChatChannel.h>
Public Member Functions | |
| bool | IsValid () const |
| Does this represent a non-null channel? | |
| void | Delete (TFunction< void()> Callback={}) const |
| Delete this channel from the server. | |
| void | PartialUpdate (const TSharedRef< FJsonObject > &Set={}, const TArray< FString > &Unset={}, TFunction< void()> Callback={}) |
| Updates certain fields of the channel. | |
| void | Update (const FAdditionalFields &Data, const TOptional< FMessage > &Message={}, TFunction< void()> Callback={}) |
| Change channel data. Any data that is present on the channel and not included in a full update will be deleted. | |
| void | Truncate (bool bHardDelete=false, const TOptional< FDateTime > &TruncatedAt={}, const TOptional< FMessage > &Message={}, bool bSkipPush=false, TFunction< void()> Callback={}) |
| Delete all messages in this channel. | |
| void | QueryMembers (const FFilter &Filter={}, const TArray< FUserSortOption > &Sort={}, const FMessagePaginationOptions &Pagination={}, TFunction< void(const TArray< FMember > &)> Callback={}) |
| List and paginate members for this channel. | |
| void | AddMembers (const TArray< FString > &MemberIds, const TOptional< FMessage > &Message={}, TFunction< void()> Callback={}) |
| Add given users as members. | |
| void | RemoveMembers (const TArray< FString > &MemberIds, const TOptional< FMessage > &Message={}, TFunction< void()> Callback={}) |
| Remove given users as members. | |
| void | Hide (bool bClearHistory=false, TFunction< void()> Callback={}) const |
| Remove this channel from query channel requests for the current user until a new message is added. Hiding a channel is only available to members of that channel. | |
| void | Show (TFunction< void()> Callback={}) const |
| Un-hide this channel. It will again appear in query channel requests for the current user. | |
| void | StopWatching (TFunction< void()> Callback={}) const |
| Stop receiving channel events. | |
Event | |
Send, subscribe and unsubscribe to events | |
| template<class TEvent > | |
| void | SendEvent (const TEvent &) |
| Send a custom event on this channel. | |
| template<class TEvent > | |
| FDelegateHandle | On (TEventDelegate< TEvent > Callback) |
| Subscribe to a channel event using your own delegate object. | |
| template<class TEvent , class UserClass > | |
| TEnableIf< TIsDerivedFrom< UserClass, UObject >::IsDerived, FDelegateHandle >::Type | On (UserClass *Obj, TEventDelegateUObjectMethodPtr< TEvent, UserClass > Method) |
| Subscribe to a channel event using a UObject-based member function delegate. | |
| template<class TEvent , class UserClass > | |
| TEnableIf<!TIsDerivedFrom< UserClass, UObject >::IsDerived, FDelegateHandle >::Type | On (UserClass *Obj, TEventDelegateSpMethodPtr< TEvent, UserClass > Method) |
| Subscribe to a channel event using a shared pointer-based (fast, not thread-safe) member function delegate. | |
| template<class TEvent , typename FunctorType , typename... VarTypes> | |
| TEnableIf< TIsInvocable< FunctorType, constTEvent &, VarTypes... >::Value, FDelegateHandle >::Type | On (FunctorType &&Functor, VarTypes... Vars) |
| Subscribe to a channel event using a C++ lambda. | |
| template<class TEvent > | |
| bool | Unsubscribe (FDelegateHandle) const |
| Unsubscribe from a previously subscribed channel event. | |
Static Public Member Functions | |
| static UChatChannel * | Create (UObject *Outer, const TSharedRef< FChatApi >, const TSharedRef< IChatSocket >, const FChannelStateResponseFieldsDto &) |
| Create a new channel object. | |
| static UChatChannel * | Create (UObject *Outer, const TSharedRef< FChatApi >, const TSharedRef< IChatSocket >) |
| Create a new null channel object. | |
Public Attributes | |
| FChannelProperties | Properties |
| The local static properties of the channel. | |
| FChannelState | State |
| The local state of the channel. | |
Message | |
Paginate, send, update and delete messages. | |
| FMessagesUpdatedDelegate | MessagesUpdated |
| Fired when any of the messages we have locally change. | |
| FMessageDelegate | MessageSent |
| Fired when a message is first sent client-side. | |
| FMessageDelegate | MessageReceived |
| Fired when a message is first received from the server (but not updated, deleted, etc) | |
| FUnreadChangedDelegate | UnreadChanged |
| Fired when the unread count changes for the current user. | |
| void | SendMessageBP (const FMessage &Message, const UObject *WorldContextObject, FLatentActionInfo LatentInfo, bool &bSuccess) |
| Send a message on this channel. | |
| void | SendMessage (const FMessage &Message, const TFunction< void(const bool &bSuccess)>={}) |
| void | UploadFileBP (const FString &FileName, const TArray< uint8 > &Content, const UObject *WorldContextObject, FLatentActionInfo LatentInfo, FAttachment &OutAttachment) |
| Upload a file to this channel, ready to be attached to a message. | |
| void | UploadFile (const FString &FileName, const TArray< uint8 > &Content, const TFunction< void(const FAttachment &)> Callback={}) |
| void | UploadImageBP (const FString &FileName, const TArray< uint8 > &Content, const UObject *WorldContextObject, FLatentActionInfo LatentInfo, FAttachment &OutAttachment) |
| Upload an image to this channel, ready to be attached to a message. | |
| void | UploadImage (const FString &FileName, const TArray< uint8 > &Content, const TFunction< void(const FAttachment &)> Callback={}) |
| void | DeleteAttachmentBP (const FAttachment &Attachment, const UObject *WorldContextObject, FLatentActionInfo LatentInfo, bool &bSuccess) |
| Delete a previously uploaded attachment from this channel. | |
| void | DeleteAttachment (const FAttachment &Attachment, const TFunction< void(const bool &bSuccess)> Callback={}) |
| void | GetMessageBP (const FString &MessageId, const UObject *WorldContextObject, FLatentActionInfo LatentInfo, FMessage &OutMessage) |
| Get a single message by its ID from the server. | |
| void | GetMessage (const FString &MessageId, const TFunction< void(const FMessage &)> Callback={}) |
| void | UpdateMessage (const FMessage &Message) |
| Update (user might see "Edit") a message which exists on this channel. | |
| void | ResendMessage (const FMessage &Message) |
| Send a message again, after a first attempt did not reach the channel. | |
| void | DeleteMessage (const FMessage &Message) |
| Soft delete a message in this channel. | |
| void | QueryAdditionalMessages (EPaginationDirection Direction=EPaginationDirection::Top, int32 Limit=20, TFunction< void()> Callback={}) |
| Fetch more messages from the server. | |
| void | MarkRead (const TOptional< FMessage > &Message={}) |
| Manually mark all messages in this channel as read by the current user. | |
| void | MarkRead (const FMessage &Message) |
| Manually mark all messages in this channel as read by the current user. | |
| void | MarkReadLocal () |
| Clear unread count locally. | |
| void | Query (EChannelFlags Flags=EChannelFlags::State, const TOptional< FMessagePaginationOptions > MessagePagination={}, const TOptional< FUserPaginationOptions > MemberPagination={}, const TOptional< FUserPaginationOptions > WatcherPagination={}, TFunction< void()> Callback={}) |
| Get messages, members or other channel fields. | |
| void | SearchMessages (const TOptional< FString > &Query={}, const TOptional< FFilter > &MessageFilter={}, const TArray< FMessageSortOption > &Sort={}, TOptional< uint32 > MessageLimit={}, TFunction< void(const TArray< FMessage > &)> Callback={}) const |
| Search the messages in this channel. | |
| void | SearchMessages (const FString &Query, const FFilter &MessageFilter, const TArray< FMessageSortOption > &Sort, int32 MessageLimit, const UObject *WorldContextObject, FLatentActionInfo LatentInfo, TArray< FMessage > &OutMessages) |
| Search the messages in this channel. | |
Thread | |
Reply in threads, and paginate a thread's replies. | |
| FRepliesUpdatedDelegate | RepliesUpdated |
| void | SendReplyBP (const FMessage &Reply, const FMessage &ParentMessage, bool bAlsoSendInChannel, const UObject *WorldContextObject, FLatentActionInfo LatentInfo, bool &bSuccess) |
| Reply to a message, in that message's thread. | |
| void | SendReply (const FMessage &Reply, const FMessage &ParentMessage, bool bAlsoSendInChannel=false, const TFunction< void(const bool &bSuccess)> Callback={}) |
| void | QueryReplies (const FMessage &ParentMessage, int32 Limit=20, TFunction< void(const TArray< FMessage > &)> Callback={}) |
| Fetch the replies of a thread from the server, most recent last. | |
| void | QueryAdditionalReplies (const FMessage &ParentMessage, int32 Limit=20, TFunction< void(const TArray< FMessage > &)> Callback={}) |
| Fetch replies older than the oldest one held locally, for scrolling up a thread. | |
| const FMessages & | GetReplies (const FMessage &ParentMessage) const |
| Get the replies of a thread held locally, oldest first. Empty until they have been fetched. | |
| TArray< FMessage > | GetRepliesBP (const FMessage &ParentMessage) const |
| Get the replies of a thread held locally, oldest first. | |
Typing | |
| FTypingIndicatorDelegate | OnTypingIndicator |
| Fired whenever any user starts or stops typing, in the channel or in any of its threads. | |
| FThreadTypingIndicatorDelegate | OnThreadTypingIndicator |
| void | KeyStroke (const FString &ParentMessageId=TEXT("")) |
Should be called on every keystroke. Sends typing.start and typing.stop events accordingly. | |
| void | StopTyping (const FString &ParentMessageId=TEXT("")) |
| Should be called when the user sends the message (or aborts). Manually sends the typing.stop event, and cancels any pending typing.stop event queued by Keystroke() | |
Reaction | |
Send and delete reactions. | |
| FReaction | SendReaction (const FMessage &Message, const FName &ReactionType, int32 Score=1, bool bEnforceUnique=false) |
| Add a reaction to a given message. | |
| void | GetReactions (const FMessage &Message, const FPaginationOptions &Pagination={}, TFunction< void(const TArray< FReaction > &)> Callback={}) |
| Fetch or paginate more reactions for a given message. | |
| void | DeleteReaction (const FMessage &Message, const FReaction &Reaction) |
| Remove a reaction from a given message. | |
Moderation | |
| void | BanMemberBP (const FUserRef &User, FTimespan Timeout, FString Reason, bool bIpBan) const |
| Ban a member from this channel. When a user is banned, they will not be allowed to post messages until the ban is removed or expired but will be able to connect to Chat and to channels as before. | |
| void | BanMember (const FUserRef &User, const TOptional< FTimespan > &Timeout={}, const TOptional< FString > &Reason={}, bool bIpBan=false) const |
| void | UnbanMember (const FUserRef &User) const |
| Remove previously applied ban. | |
| void | ShadowBanMemberBP (const FUserRef &User, FTimespan Timeout) const |
| Shadow ban a member from this channel. When a user is shadow banned, they will still be allowed to post messages, but any message sent during the will only be visible to the messages author and invisible to other users of the App. | |
| void | ShadowBanMember (const FUserRef &User, const TOptional< FTimespan > &Timeout={}) const |
| void | ShadowUnbanMember (const FUserRef &User) const |
| Remove previously applied shadow ban. | |
| void | MuteBP (FTimespan Timeout) |
| Mutes channel for current user. | |
| void | Mute (const TOptional< FTimespan > &Timeout={}) |
| void | Unmute () const |
| Unmutes channel for current user. | |
| bool | IsMuted () const |
| Is this channel muted for the current user. | |
| void | EnableSlowMode (FTimespan Cooldown) |
| Enable slow mode with the given cooldown. | |
| void | DisableSlowMode () |
| Disable slow mode (no more cooldown between consecutive messages) | |
The client-side representation of a Stream Chat channel.
| void UChatChannel::AddMembers | ( | const TArray< FString > & | MemberIds, |
| const TOptional< FMessage > & | Message = {}, | ||
| TFunction< void()> | Callback = {} ) |
Add given users as members.
| MemberIds | IDs of users to add to the channel as members |
| Message | Optionally include a message object that will be used to populate a system message |
| Callback | Called when response is received. |
| void UChatChannel::BanMemberBP | ( | const FUserRef & | User, |
| FTimespan | Timeout, | ||
| FString | Reason, | ||
| bool | bIpBan ) const |
Ban a member from this channel. When a user is banned, they will not be allowed to post messages until the ban is removed or expired but will be able to connect to Chat and to channels as before.
| User | User to ban |
| Timeout | Timeout of ban in minutes. User will be unbanned after this period of time (unlimited if zero) |
| Reason | Ban reason (optional) |
| bIpBan | Whether to perform IP ban or not |
| void UChatChannel::Delete | ( | TFunction< void()> | Callback = {} | ) | const |
Delete this channel from the server.
| Callback | Called when response is received. |
| void UChatChannel::DeleteAttachmentBP | ( | const FAttachment & | Attachment, |
| const UObject * | WorldContextObject, | ||
| FLatentActionInfo | LatentInfo, | ||
| bool & | bSuccess ) |
Delete a previously uploaded attachment from this channel.
Routed to the image or the file endpoint depending on the attachment, so callers do not have to remember which one it was uploaded through.
| void UChatChannel::DeleteMessage | ( | const FMessage & | Message | ) |
Soft delete a message in this channel.
A message which never reached the server, including one moderation bounced, is only removed locally: there is nothing on the server to delete.
| Message | Message which already exists in this channel |
Remove a reaction from a given message.
| Message | The message in this channel to react to |
| Reaction | The reaction to remove |
| void UChatChannel::GetReactions | ( | const FMessage & | Message, |
| const FPaginationOptions & | Pagination = {}, | ||
| TFunction< void(const TArray< FReaction > &)> | Callback = {} ) |
Fetch or paginate more reactions for a given message.
| Message | The message in this channel to fetch reactions for |
| Pagination | Limit and offset for pagination of reactions |
| Callback | Called when response is received |
Get the replies of a thread held locally, oldest first.
Empty until they have been fetched with Query Replies.
| void UChatChannel::Hide | ( | bool | bClearHistory = false, |
| TFunction< void()> | Callback = {} ) const |
Remove this channel from query channel requests for the current user until a new message is added. Hiding a channel is only available to members of that channel.
| bClearHistory | Clear the entire message history of that channel for the user |
| Callback | Called when response is received. |
| void UChatChannel::KeyStroke | ( | const FString & | ParentMessageId = TEXT("") | ) |
Should be called on every keystroke. Sends typing.start and typing.stop events accordingly.
| ParentMessageId | In the case of a thread, the ID of the parent message (optional) |
| void UChatChannel::MarkRead | ( | const FMessage & | Message | ) |
Manually mark all messages in this channel as read by the current user.
| Message | Optionally provide a Message that is considered last read |
| void UChatChannel::MarkRead | ( | const TOptional< FMessage > & | Message = {} | ) |
Manually mark all messages in this channel as read by the current user.
| Message | Optionally provide a Message that is considered last read |
| void UChatChannel::MuteBP | ( | FTimespan | Timeout | ) |
Mutes channel for current user.
| Timeout | Duration of mute (never unmuted if left zero) |
| TEnableIf< TIsInvocable< FunctorType, constTEvent &, VarTypes... >::Value, FDelegateHandle >::Type UChatChannel::On | ( | FunctorType && | Functor, |
| VarTypes... | Vars ) |
Subscribe to a channel event using a C++ lambda.
| TEvent | Event type |
| Functor | Lambda to execute when event occurs. Should have signature similar to: [](const TEvent& Event){} |
| Vars | Additional variables to pass to the lambda |
| TEnableIf<!TIsDerivedFrom< UserClass, UObject >::IsDerived, FDelegateHandle >::Type UChatChannel::On | ( | UserClass * | Obj, |
| TEventDelegateSpMethodPtr< TEvent, UserClass > | Method ) |
Subscribe to a channel event using a shared pointer-based (fast, not thread-safe) member function delegate.
| TEvent | Event type |
| Obj | Object with given method |
| Method | Method to call when event occurs. Should have signature: void OnMyEvent(const TEvent& Event) |
| TEnableIf<!TIsDerivedFrom< UserClass, UObject >::IsDerived, FDelegateHandle >::Type UChatChannel::On | ( | UserClass * | Obj, |
| TEventDelegateUObjectMethodPtr< TEvent, UserClass > | Method ) |
Subscribe to a channel event using a UObject-based member function delegate.
| TEvent | Event type |
| Obj | UObject with given method |
| Method | Method to call when event occurs. Should have signature: void OnMyEvent(const TEvent& Event) |
| void UChatChannel::PartialUpdate | ( | const TSharedRef< FJsonObject > & | Set = {}, |
| const TArray< FString > & | Unset = {}, | ||
| TFunction< void()> | Callback = {} ) |
Updates certain fields of the channel.
| Set | Sets new field values |
| Unset | Array of field names to unset |
| Callback | Called when response is received. |
| void UChatChannel::Query | ( | EChannelFlags | Flags = EChannelFlags::State, |
| const TOptional< FMessagePaginationOptions > | MessagePagination = {}, | ||
| const TOptional< FUserPaginationOptions > | MemberPagination = {}, | ||
| const TOptional< FUserPaginationOptions > | WatcherPagination = {}, | ||
| TFunction< void()> | Callback = {} ) |
Get messages, members or other channel fields.
| Callback | Called when response is received. |
| Flags | Additional actions to perform, like watch, or fetch presence. |
| MessagePagination | Pagination details for returned messages. |
| MemberPagination | Pagination details for returned members. |
| WatcherPagination | Pagination details for returned watchers/ |
| void UChatChannel::QueryAdditionalMessages | ( | EPaginationDirection | Direction = EPaginationDirection::Top, |
| int32 | Limit = 20, | ||
| TFunction< void()> | Callback = {} ) |
Fetch more messages from the server.
| Direction | Top if the user is scrolling up, Bottom if the user is scrolling down |
| Limit | Number of messages returned is limited by this value. Maximum 200. |
| Callback | Called when a response is received from the backend |
| void UChatChannel::QueryAdditionalReplies | ( | const FMessage & | ParentMessage, |
| int32 | Limit = 20, | ||
| TFunction< void(const TArray< FMessage > &)> | Callback = {} ) |
Fetch replies older than the oldest one held locally, for scrolling up a thread.
| ParentMessage | The message in this channel whose thread to paginate |
| Limit | Number of replies returned is limited by this value. Maximum 300. |
| Callback | Called with the fetched replies when a response is received |
| void UChatChannel::QueryMembers | ( | const FFilter & | Filter = {}, |
| const TArray< FUserSortOption > & | Sort = {}, | ||
| const FMessagePaginationOptions & | Pagination = {}, | ||
| TFunction< void(const TArray< FMember > &)> | Callback = {} ) |
List and paginate members for this channel.
| Filter | Conditions to use to filter the members |
| Sort | The sorting used for the members matching the filters. Sorting is based on field and direction, multiple sorting options can be provided. |
| Pagination | Limit, offset, and member selection by user id GtId, GteId, LtId and LteId fields are for user IDs |
| Callback | Called when response is received. |
| void UChatChannel::QueryReplies | ( | const FMessage & | ParentMessage, |
| int32 | Limit = 20, | ||
| TFunction< void(const TArray< FMessage > &)> | Callback = {} ) |
Fetch the replies of a thread from the server, most recent last.
A channel query returns the channel's history and not its threads, so a thread's replies have to be fetched separately, once per thread the user opens.
| ParentMessage | The message in this channel whose thread to fetch |
| Limit | Number of replies returned is limited by this value. Maximum 300. |
| Callback | Called with the fetched replies when a response is received |
| void UChatChannel::RemoveMembers | ( | const TArray< FString > & | MemberIds, |
| const TOptional< FMessage > & | Message = {}, | ||
| TFunction< void()> | Callback = {} ) |
Remove given users as members.
| MemberIds | IDs of users to remove from the channel as members |
| Message | Optionally include a message object that will be used to populate a system message |
| Callback | Called when response is received. |
| void UChatChannel::ResendMessage | ( | const FMessage & | Message | ) |
Send a message again, after a first attempt did not reach the channel.
Written for a message moderation bounced: that message was never stored server side, so it has to be sent afresh rather than edited. The previous verdict and error type are cleared, so the message stops reading as rejected while the new attempt is in flight.
Sending the same text again will usually be bounced again. Let the author edit it first, unless your moderation rules are configured to let a resend through.
| Message | Message held by this channel which failed to send |
| void UChatChannel::SearchMessages | ( | const FString & | Query, |
| const FFilter & | MessageFilter, | ||
| const TArray< FMessageSortOption > & | Sort, | ||
| int32 | MessageLimit, | ||
| const UObject * | WorldContextObject, | ||
| FLatentActionInfo | LatentInfo, | ||
| TArray< FMessage > & | OutMessages ) |
Search the messages in this channel.
All parameters are optional, but a minimum of either a query or message filter is required
| Query | Search phrase (Optional) |
| MessageFilter | Message filter conditions (Optional) |
| Sort | Sort parameters (Optional) |
| MessageLimit | Number of messages to return (Optional) |
| OutMessages | The result of the search |
| void UChatChannel::SearchMessages | ( | const TOptional< FString > & | Query = {}, |
| const TOptional< FFilter > & | MessageFilter = {}, | ||
| const TArray< FMessageSortOption > & | Sort = {}, | ||
| TOptional< uint32 > | MessageLimit = {}, | ||
| TFunction< void(const TArray< FMessage > &)> | Callback = {} ) const |
Search the messages in this channel.
All parameters are optional, but a minimum of either a query or message filter is required
| Query | Search phrase |
| MessageFilter | Message filter conditions |
| Sort | Sort parameters. Cannot be used with non-zero offset. |
| MessageLimit | Number of messages to return |
| Callback | Called when response is received |
| void UChatChannel::SendMessageBP | ( | const FMessage & | Message, |
| const UObject * | WorldContextObject, | ||
| FLatentActionInfo | LatentInfo, | ||
| bool & | bSuccess ) |
Send a message on this channel.
| Message | A message struct containing information of the message to be sent |
| FReaction UChatChannel::SendReaction | ( | const FMessage & | Message, |
| const FName & | ReactionType, | ||
| int32 | Score = 1, | ||
| bool | bEnforceUnique = false ) |
Add a reaction to a given message.
| Message | The message in this channel to react to |
| ReactionType | The type of reaction to send |
| bEnforceUnique | Should all other reactions from this user be removed |
| Score | The score of the reaction. Defaults to 1. |
| void UChatChannel::SendReplyBP | ( | const FMessage & | Reply, |
| const FMessage & | ParentMessage, | ||
| bool | bAlsoSendInChannel, | ||
| const UObject * | WorldContextObject, | ||
| FLatentActionInfo | LatentInfo, | ||
| bool & | bSuccess ) |
Reply to a message, in that message's thread.
Replying to a message which isn't in a thread yet starts one. A reply does not appear in the channel message list, and does not count towards the channel's unread count, unless bAlsoSendInChannel is set.
Equivalent to setting ParentId (and bShowInChannel) on the message and calling SendMessage.
| Reply | A message struct containing information of the reply to be sent |
| ParentMessage | The message in this channel to reply to |
| bAlsoSendInChannel | Additionally show this reply in the main channel message list |
| void UChatChannel::ShadowBanMemberBP | ( | const FUserRef & | User, |
| FTimespan | Timeout ) const |
Shadow ban a member from this channel. When a user is shadow banned, they will still be allowed to post messages, but any message sent during the will only be visible to the messages author and invisible to other users of the App.
| User | User to shadow ban |
| Timeout | Timeout of ban in minutes. User will be unbanned after this period of time (never unbanned if zero) |
| void UChatChannel::ShadowUnbanMember | ( | const FUserRef & | User | ) | const |
Remove previously applied shadow ban.
| User | User to unban |
| void UChatChannel::Show | ( | TFunction< void()> | Callback = {} | ) | const |
Un-hide this channel. It will again appear in query channel requests for the current user.
| Callback | Called when response is received. |
| void UChatChannel::StopTyping | ( | const FString & | ParentMessageId = TEXT("") | ) |
Should be called when the user sends the message (or aborts). Manually sends the typing.stop event, and cancels any pending typing.stop event queued by Keystroke()
| ParentMessageId | In the case of a thread, the ID of the parent message (optional) |
| void UChatChannel::StopWatching | ( | TFunction< void()> | Callback = {} | ) | const |
Stop receiving channel events.
| Callback | Called when response is received. |
| void UChatChannel::Truncate | ( | bool | bHardDelete = false, |
| const TOptional< FDateTime > & | TruncatedAt = {}, | ||
| const TOptional< FMessage > & | Message = {}, | ||
| bool | bSkipPush = false, | ||
| TFunction< void()> | Callback = {} ) |
Delete all messages in this channel.
| bHardDelete | Actually delete messages, instead of soft-deleting (hiding) them |
| TruncatedAt | Truncate this channel only up to given time |
| Message | A system message to be added after truncation |
| bSkipPush | If a message is included, don't send the push notification |
| Callback | Called when response is received |
| void UChatChannel::UnbanMember | ( | const FUserRef & | User | ) | const |
Remove previously applied ban.
| User | User to unban |
| bool UChatChannel::Unsubscribe | ( | FDelegateHandle | Handle | ) | const |
Unsubscribe from a previously subscribed channel event.
| TEvent | Event type |
| void UChatChannel::Update | ( | const FAdditionalFields & | Data, |
| const TOptional< FMessage > & | Message = {}, | ||
| TFunction< void()> | Callback = {} ) |
Change channel data. Any data that is present on the channel and not included in a full update will be deleted.
| Data | Properties to set on the channel |
| Message | Optionally include a message object that will be used to populate a system message |
| Callback | Called when response is received. |
| void UChatChannel::UpdateMessage | ( | const FMessage & | Message | ) |
Update (user might see "Edit") a message which exists on this channel.
| Message | Message which already exists in this channel |
| void UChatChannel::UploadFileBP | ( | const FString & | FileName, |
| const TArray< uint8 > & | Content, | ||
| const UObject * | WorldContextObject, | ||
| FLatentActionInfo | LatentInfo, | ||
| FAttachment & | OutAttachment ) |
Upload a file to this channel, ready to be attached to a message.
Uploading and sending are separate steps. Upload first, then put the resulting attachment in FMessage::Attachments and send that message. The SDK takes bytes rather than a path, so the choice of file picker, and the platform differences that come with it, stay in the app.
Stream accepts any file type by default, up to 100 MB.
| FileName | Original filename, shown to recipients and used to infer the MIME type |
| Content | Raw bytes of the file |
| void UChatChannel::UploadImageBP | ( | const FString & | FileName, |
| const TArray< uint8 > & | Content, | ||
| const UObject * | WorldContextObject, | ||
| FLatentActionInfo | LatentInfo, | ||
| FAttachment & | OutAttachment ) |
Upload an image to this channel, ready to be attached to a message.
Prefer this over UploadFile for images: the backend recognises them, may generate a thumbnail, and clients render them inline. Accepts BMP, GIF, JPEG, PNG, WebP, HEIC, HEIF and SVG, up to 100 MB.
| FileName | Original filename, shown to recipients and used to infer the MIME type |
| Content | Raw bytes of the image |
| FThreadTypingIndicatorDelegate UChatChannel::OnThreadTypingIndicator |
Fired whenever any user starts or stops typing in a thread, carrying the thread it happened in. OnTypingIndicator fires for these too, so subscribe here only to tell threads apart.
| FRepliesUpdatedDelegate UChatChannel::RepliesUpdated |
Fired when any of the replies we have locally for a thread change. MessagesUpdated also fires, so a channel-level message list needs no extra wiring.