2020-03-19 15:12:50 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using LeanCloud.Realtime.Protocol;
|
2020-03-12 16:23:21 +08:00
|
|
|
|
|
|
|
|
|
namespace LeanCloud.Realtime {
|
|
|
|
|
public class LCIMChatRoom : LCIMConversation {
|
2020-03-27 15:52:34 +08:00
|
|
|
|
public LCIMChatRoom(LCIMClient client) :
|
|
|
|
|
base(client) {
|
2020-03-12 16:23:21 +08:00
|
|
|
|
}
|
2020-03-19 15:12:50 +08:00
|
|
|
|
|
|
|
|
|
public async Task<int> GetOnlineMembersCount() {
|
|
|
|
|
return await GetMembersCount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<List<string>> GetOnlineMembers(int limit = 50) {
|
|
|
|
|
ConvCommand conv = new ConvCommand {
|
|
|
|
|
Cid = Id,
|
|
|
|
|
Limit = limit
|
|
|
|
|
};
|
2020-03-25 16:42:30 +08:00
|
|
|
|
GenericCommand request = Client.NewCommand(CommandType.Conv, OpType.Members);
|
2020-03-19 15:12:50 +08:00
|
|
|
|
request.ConvMessage = conv;
|
2020-03-25 16:42:30 +08:00
|
|
|
|
GenericCommand response = await Client.Connection.SendRequest(request);
|
2020-03-19 15:12:50 +08:00
|
|
|
|
List<string> memberList = response.ConvMessage.M.ToList();
|
|
|
|
|
return memberList;
|
|
|
|
|
}
|
2020-03-12 16:23:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|