* 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 Newtonsoft.Json;
using Google.Protobuf;
using LeanCloud.Storage.Internal;
using LeanCloud.Realtime.Protocol;
namespace LeanCloud.Realtime.Internal.Controller {

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,4 @@
using System;

namespace LeanCloud.Realtime {
public class LCIMRecalledMessage {
public LCIMRecalledMessage() {

View File

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