fix: 修复设置对话名称无效的 bug

oneRain 2020-05-20 12:34:16 +08:00
parent d2cdb7bd69
commit 6d3064e29d
1 changed files with 10 additions and 7 deletions

View File

@ -43,18 +43,21 @@ namespace LeanCloud.Realtime.Internal.Controller {
if (members != null) { if (members != null) {
conv.M.AddRange(members); conv.M.AddRange(members);
} }
if (!string.IsNullOrEmpty(name)) {
conv.N = name;
}
if (temporary) { if (temporary) {
conv.TempConv = temporary; conv.TempConv = temporary;
conv.TempConvTTL = temporaryTtl; conv.TempConvTTL = temporaryTtl;
} }
if (properties != null) { Dictionary<string, object> attrs = new Dictionary<string, object>();
conv.Attr = new JsonObjectMessage { if (!string.IsNullOrEmpty(name)) {
Data = JsonConvert.SerializeObject(LCEncoder.Encode(properties)) 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) { if (Client.SignatureFactory != null) {
LCIMSignature signature = await Client.SignatureFactory.CreateStartConversationSignature(Client.Id, members); LCIMSignature signature = await Client.SignatureFactory.CreateStartConversationSignature(Client.Id, members);
conv.S = signature.Signature; conv.S = signature.Signature;