From 6d3064e29d1d9577f395eff5749fd9d11542cc45 Mon Sep 17 00:00:00 2001 From: oneRain Date: Wed, 20 May 2020 12:34:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E5=90=8D=E7=A7=B0=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/LCIMConversationController.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Realtime/Realtime/Internal/Controller/LCIMConversationController.cs b/Realtime/Realtime/Internal/Controller/LCIMConversationController.cs index c7e7d16..1f23ead 100644 --- a/Realtime/Realtime/Internal/Controller/LCIMConversationController.cs +++ b/Realtime/Realtime/Internal/Controller/LCIMConversationController.cs @@ -43,18 +43,21 @@ namespace LeanCloud.Realtime.Internal.Controller { if (members != null) { conv.M.AddRange(members); } - if (!string.IsNullOrEmpty(name)) { - conv.N = name; - } if (temporary) { conv.TempConv = temporary; conv.TempConvTTL = temporaryTtl; } - if (properties != null) { - conv.Attr = new JsonObjectMessage { - Data = JsonConvert.SerializeObject(LCEncoder.Encode(properties)) - }; + Dictionary attrs = new Dictionary(); + if (!string.IsNullOrEmpty(name)) { + attrs["name"] = name; } + if (properties != null) { + attrs = properties.Union(attrs) + .ToDictionary(k => k.Key, v => v.Value); + } + conv.Attr = new JsonObjectMessage { + Data = JsonConvert.SerializeObject(LCEncoder.Encode(attrs)) + }; if (Client.SignatureFactory != null) { LCIMSignature signature = await Client.SignatureFactory.CreateStartConversationSignature(Client.Id, members); conv.S = signature.Signature;