// // /*=============================================================================== // // Copyright (C) 2024 PhantomsXR Ltd. All Rights Reserved. // // // // This file is part of the Phantom.XRMOD.VoiceModule.Runtime. // // // // The XR-MOD cannot be copied, distributed, or made available to // // third-parties for commercial purposes without written permission of PhantomsXR Ltd. // // // // Contact nswell@phantomsxr.com for licensing requests. // // ===============================================================================*/ using System; using System.Threading.Tasks; using Unity.Services.Vivox; namespace Phantom.XRMOD.GameServices.Runtime { public class TextMessage { /// /// The account URI of the sender of the message for internal use. /// internal string SenderURI; /// /// The URI of the channel a message is related to for internal use. /// internal string ChannelURI; /// /// The PlayerId of the sender of the message. /// public string SenderPlayerId { get; internal set; } /// /// The DisplayName of the sender of the message. /// public string SenderDisplayName { get; internal set; } /// /// The PlayerId of the recipient of the message. /// This will only be populated in VivoxMessages provided by a /// public string RecipientPlayerId { get; internal set; } /// /// The ChannelName of the channel the message was sent in. /// IMPORTANT: null if the message was a DirectedMessage. /// public string ChannelName { get; internal set; } /// /// The text body of the message that was sent /// public string MessageText { get; internal set; } /// /// Whether or not the message was sent from the user to the channel. /// public bool FromSelf { get; internal set; } /// /// At what time the message was received. /// public DateTime ReceivedTime { get; internal set; } /// /// The language preference of the user that sent the message. /// public string Language { get; internal set; } /// /// Unique message id of the text message. /// public string MessageId { get; internal set; } /// /// Denotes if this message has been read/seen or not. /// public bool IsRead { get; internal set; } /// /// Denotes if this message was created as a result of a Speech-to-Text transcription. /// public bool IsTranscribedMessage { get; internal set; } internal Func OnSetMessageAsReadAsync; public async Task SetMessageAsReadAsync(DateTime? _time = null) { if (OnSetMessageAsReadAsync != null) await OnSetMessageAsReadAsync.Invoke(_time); else await Task.Yield(); } } }