chore: 完善对话接口和事件
parent
659da6acc8
commit
fa2b4d9c79
|
@ -252,7 +252,7 @@ namespace LeanCloud.Realtime.Internal.Controller {
|
||||||
Cid = convId
|
Cid = convId
|
||||||
};
|
};
|
||||||
conv.M.AddRange(clientIds);
|
conv.M.AddRange(clientIds);
|
||||||
GenericCommand request = NewCommand(CommandType.Conv, OpType.Remove);
|
GenericCommand request = NewCommand(CommandType.Conv, OpType.RemoveShutup);
|
||||||
request.ConvMessage = conv;
|
request.ConvMessage = conv;
|
||||||
GenericCommand response = await Client.Connection.SendRequest(request);
|
GenericCommand response = await Client.Connection.SendRequest(request);
|
||||||
return NewPartiallySuccessResult(response.ConvMessage.AllowedPids, response.ConvMessage.FailedPids);
|
return NewPartiallySuccessResult(response.ConvMessage.AllowedPids, response.ConvMessage.FailedPids);
|
||||||
|
@ -580,6 +580,9 @@ namespace LeanCloud.Realtime.Internal.Controller {
|
||||||
case OpType.Blocked:
|
case OpType.Blocked:
|
||||||
await OnBlocked(convMessage);
|
await OnBlocked(convMessage);
|
||||||
break;
|
break;
|
||||||
|
case OpType.Unblocked:
|
||||||
|
await OnUnblocked(convMessage);
|
||||||
|
break;
|
||||||
case OpType.MembersBlocked:
|
case OpType.MembersBlocked:
|
||||||
await OnMembersBlocked(convMessage);
|
await OnMembersBlocked(convMessage);
|
||||||
break;
|
break;
|
||||||
|
@ -589,6 +592,9 @@ namespace LeanCloud.Realtime.Internal.Controller {
|
||||||
case OpType.Shutuped:
|
case OpType.Shutuped:
|
||||||
await OnMuted(convMessage);
|
await OnMuted(convMessage);
|
||||||
break;
|
break;
|
||||||
|
case OpType.Unshutuped:
|
||||||
|
await OnUnmuted(convMessage);
|
||||||
|
break;
|
||||||
case OpType.MembersShutuped:
|
case OpType.MembersShutuped:
|
||||||
await OnMembersMuted(convMessage);
|
await OnMembersMuted(convMessage);
|
||||||
break;
|
break;
|
||||||
|
@ -662,6 +668,16 @@ namespace LeanCloud.Realtime.Internal.Controller {
|
||||||
Client.OnMuted?.Invoke(conversation, convMessage.InitBy);
|
Client.OnMuted?.Invoke(conversation, convMessage.InitBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前用户被解除禁言
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="convMessage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task OnUnmuted(ConvCommand convMessage) {
|
||||||
|
LCIMConversation conversation = await Client.GetOrQueryConversation(convMessage.Cid);
|
||||||
|
Client.OnUnmuted?.Invoke(conversation, convMessage.InitBy);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 有成员被禁言
|
/// 有成员被禁言
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -696,6 +712,16 @@ namespace LeanCloud.Realtime.Internal.Controller {
|
||||||
Client.OnBlocked?.Invoke(conversation, convMessage.InitBy);
|
Client.OnBlocked?.Invoke(conversation, convMessage.InitBy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当前用户被解除黑名单
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="convMessage"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private async Task OnUnblocked(ConvCommand convMessage) {
|
||||||
|
LCIMConversation conversation = await Client.GetOrQueryConversation(convMessage.Cid);
|
||||||
|
Client.OnUnblocked?.Invoke(conversation, convMessage.InitBy);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 有用户被拉黑
|
/// 有用户被拉黑
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue