* LCIMMessage.cs:

* LCIMFileMessage.cs:
* LCIMBinaryMessage.cs:
* LCIMLocationMessage.cs:
* LCIMRecalledMessage.cs:
* LCIMMessageController.cs:

* LCIMTextMessage.cs: chore
oneRain 2020-03-27 17:46:45 +08:00
parent 8d059f106a
commit 02e84e69d8
7 changed files with 6 additions and 14 deletions

View File

@ -3,7 +3,6 @@ using System.Threading.Tasks;
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
using Google.Protobuf; using Google.Protobuf;
using LeanCloud.Storage.Internal;
using LeanCloud.Realtime.Protocol; using LeanCloud.Realtime.Protocol;
namespace LeanCloud.Realtime.Internal.Controller { namespace LeanCloud.Realtime.Internal.Controller {

View File

@ -1,7 +1,4 @@
using System; namespace LeanCloud.Realtime {
using System.Collections.Generic;
namespace LeanCloud.Realtime {
public class LCIMBinaryMessage : LCIMMessage { public class LCIMBinaryMessage : LCIMMessage {
public byte[] Data { public byte[] Data {
get; internal set; get; internal set;

View File

@ -37,6 +37,8 @@ namespace LeanCloud.Realtime {
File = file; File = file;
} }
internal override int MessageType => FileMessageType;
internal override Dictionary<string, object> Encode() { internal override Dictionary<string, object> Encode() {
if (File == null) { if (File == null) {
throw new Exception("File MUST NOT be null before sent."); throw new Exception("File MUST NOT be null before sent.");
@ -73,7 +75,5 @@ namespace LeanCloud.Realtime {
File.MetaData = metaData as Dictionary<string, object>; File.MetaData = metaData as Dictionary<string, object>;
} }
} }
internal override int MessageType => FileMessageType;
} }
} }

View File

@ -1,5 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json;
using LeanCloud.Storage; using LeanCloud.Storage;
namespace LeanCloud.Realtime { namespace LeanCloud.Realtime {

View File

@ -1,7 +1,5 @@
using System; using System;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using LeanCloud.Realtime.Protocol;
namespace LeanCloud.Realtime { namespace LeanCloud.Realtime {
public abstract class LCIMMessage { public abstract class LCIMMessage {

View File

@ -1,5 +1,4 @@
using System; 
namespace LeanCloud.Realtime { namespace LeanCloud.Realtime {
public class LCIMRecalledMessage { public class LCIMRecalledMessage {
public LCIMRecalledMessage() { public LCIMRecalledMessage() {

View File

@ -21,13 +21,13 @@ namespace LeanCloud.Realtime {
return data; return data;
} }
internal override int MessageType => TextMessageType;
protected override void DecodeMessageData(Dictionary<string, object> msgData) { protected override void DecodeMessageData(Dictionary<string, object> msgData) {
base.DecodeMessageData(msgData); base.DecodeMessageData(msgData);
if (msgData.TryGetValue("_lctext", out object value)) { if (msgData.TryGetValue("_lctext", out object value)) {
Text = value as string; Text = value as string;
} }
} }
internal override int MessageType => TextMessageType;
} }
} }