Editar

Compartir vía


PartyChatTextReceivedStateChange

Information specific to the ChatTextReceived type of state change.

Syntax

struct PartyChatTextReceivedStateChange : PartyStateChange {  
    PartyChatControl* senderChatControl;  
    uint32_t receiverChatControlCount;  
    PartyLocalChatControlArray receiverChatControls;  
    PartyString languageCode;  
    PartyString chatText;  
    uint32_t dataSize;  
    const void* data;  
    uint32_t translationCount;  
    PartyTranslation* translations;  
    PartyChatTextReceivedOptions options;  
    PartyString originalChatText;  
    PartyError errorDetail;  
}  

Members

senderChatControl   PartyChatControl*

The chat control object that originated the text message.

receiverChatControlCount   uint32_t

The number of local receiver chat controls to which the text message is addressed.

receiverChatControls   PartyLocalChatControlArray
array of size receiverChatControlCount

The local receiver chat controls to which the text message is addressed.

languageCode   PartyString

The language of the chat text.

The language is only provided when translation to the local language is enabled. If translation isn't enabled, or failure is encountered during translation, the language code is an empty string.

The language code is in BCP 47 format, such as en-US for English (United States). Supported language codes are enumerated in Language support.

chatText   PartyString

The received chat text.

The string may be up to c_maxChatTextMessageLength characters long, not including the null terminator.

When filtering is enabled, this text may not be the exact text sent by the remote user. The exact source text can be retrieved from the originalChatText field.

dataSize   uint32_t

The size of the data associated with this text message.

data   const void*
buffer of size dataSize bytes

The data associated with this text message.

translationCount   uint32_t

The number of translations associated with the chat text.

Translations are provided if PartyTextChatOptions::TranslateToLocalLanguage has previously been specified via PartyLocalChatControl::SetTextChatOptions() on a chat control local to this device. There may be more than one translation if multiple local chat controls have enabled translation and the local chat controls have specified different languages via PartyLocalDevice::CreateChatControl(). In that case, the app can compare the languageCode field of each PartyTranslation in translations against the language code, obtained via PartyLocalChatControl::GetLanguage(), for each local chat control in receiverChatControls to determine the target local chat control for each translation.

translations   PartyTranslation*
array of size translationCount

An array containing the translations of the chat text string.

Translations are provided if PartyTextChatOptions::TranslateToLocalLanguage has previously been specified via PartyLocalChatControl::SetTextChatOptions() on a chat control local to this device. There may be more than one translation if multiple local chat controls have enabled translation and the local chat controls have specified different languages via PartyLocalDevice::CreateChatControl(). In that case, the app can compare the languageCode field of each PartyTranslation in translations against the language code, obtained via PartyLocalChatControl::GetLanguage(), for each local chat control in receiverChatControls to determine the target local chat control for each translation.

options   PartyChatTextReceivedOptions

Flags describing additional information about the chat text.

originalChatText   PartyString

The original version of the incoming text chat.

This field is always the unfiltered source text sent by the remote user. If filtering isn't enabled, it's a pointer to chatText. If filtering is enabled but filtering was not needed, as indicated by PartyChatTextReceivedOptions::None in the options field, then this is a pointer to chatText.

errorDetail   PartyError

A diagnostic value providing additional troubleshooting information regarding any potential error condition.

This error is intended for diagnostic purposes only. If an error occurs, the PartyChatTextReceivedOptions::FilteredDueToError flag will be present in the options field.

Requirements

Header: Party.h

See also

Party members
PartyLocalDevice::CreateChatControl
PartyLocalChatControl::SendText
PartyLocalChatControl::SetTextChatOptions