public FileMessage(FileMessage fileMessage, MESSAGE_FLAG MessageFlag)
 {
     _MessageFlag      = MessageFlag;
     _MessageId        = fileMessage.GetMessageId();
     _MessageType      = fileMessage.GetMessageType();
     _MessageText      = fileMessage.GetText();
     _IsOfflineMessage = fileMessage.IsOfflineMessage();
     _Ts             = fileMessage.GetServerReceiveTs();
     _RawMessageData = fileMessage.GetRawMessageData();
     _Length         = fileMessage.GetRawMessageLength();
     _Size           = fileMessage.GetSize();
     _MediaId        = fileMessage.GetMediaId();
     _Thumbnail      = fileMessage.GetThumbnailData();
     _FileName       = fileMessage.GetFileName();
 }
Esempio n. 2
0
 private static void OnFileMediaUploadResultCallback(int id, Int64 requestId, IntPtr fileMessagePtr, UPLOAD_MEDIA_ERR_CODE code)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMediaUploadResult != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             FileMessage fileMessage = new FileMessage(fileMessagePtr, FileMessage.MESSAGE_FLAG.SEND);
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMediaUploadResult != null)
                 {
                     clientEventHandlerHandlerDic[id].OnFileMediaUploadResult(id, requestId, fileMessage, code);
                 }
             });
         }
     }
 }
Esempio n. 3
0
 private static void OnFileMessageReceivedFromPeerCallback(int id, string peerId, IntPtr message)
 {
     if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMessageReceivedFromPeer != null)
     {
         if (AgoraCallbackObject.GetInstance()._CallbackQueue != null)
         {
             FileMessage fileMessage  = new FileMessage(message, FileMessage.MESSAGE_FLAG.SEND);
             FileMessage _fileMessage = new FileMessage(fileMessage, FileMessage.MESSAGE_FLAG.RECEIVE);
             fileMessage.SetMessagePtr(IntPtr.Zero);
             AgoraCallbackObject.GetInstance()._CallbackQueue.EnQueue(() => {
                 if (clientEventHandlerHandlerDic.ContainsKey(id) && clientEventHandlerHandlerDic[id].OnFileMessageReceivedFromPeer != null)
                 {
                     clientEventHandlerHandlerDic[id].OnFileMessageReceivedFromPeer(id, peerId, _fileMessage);
                 }
             });
         }
     }
 }