28 lines
920 B
C#
28 lines
920 B
C#
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using LeanCloud.Realtime.Protocol;
|
|
|
|
namespace LeanCloud.Realtime {
|
|
public class LCIMChatRoom : LCIMConversation {
|
|
public LCIMChatRoom(LCIMClient client) : base(client) {
|
|
}
|
|
|
|
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
|
|
};
|
|
GenericCommand request = client.NewCommand(CommandType.Conv, OpType.Members);
|
|
request.ConvMessage = conv;
|
|
GenericCommand response = await client.connection.SendRequest(request);
|
|
List<string> memberList = response.ConvMessage.M.ToList();
|
|
return memberList;
|
|
}
|
|
}
|
|
}
|