2020-04-24 15:38:10 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.ObjectModel;
|
2020-03-19 15:12:50 +08:00
|
|
|
|
using System.Threading.Tasks;
|
2020-03-12 16:23:21 +08:00
|
|
|
|
|
|
|
|
|
namespace LeanCloud.Realtime {
|
2020-04-24 15:38:10 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 聊天室
|
|
|
|
|
/// </summary>
|
2020-03-12 16:23:21 +08:00
|
|
|
|
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
|
|
|
|
|
2020-04-24 15:38:10 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在线用户数量
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2020-03-19 15:12:50 +08:00
|
|
|
|
public async Task<int> GetOnlineMembersCount() {
|
|
|
|
|
return await GetMembersCount();
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-24 15:38:10 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取在线用户
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="limit"></param>
|
|
|
|
|
/// <returns></returns>
|
2020-04-14 14:51:14 +08:00
|
|
|
|
public async Task<ReadOnlyCollection<string>> GetOnlineMembers(int limit = 50) {
|
|
|
|
|
return await Client.ConversationController.GetOnlineMembers(Id, limit);
|
2020-03-19 15:12:50 +08:00
|
|
|
|
}
|
2020-04-24 15:38:10 +08:00
|
|
|
|
|
|
|
|
|
public override Task<LCIMPartiallySuccessResult> AddMembers(IEnumerable<string> clientIds) {
|
|
|
|
|
throw new Exception("Add members is not allowed in chat room.");
|
|
|
|
|
}
|
2020-03-12 16:23:21 +08:00
|
|
|
|
}
|
|
|
|
|
}
|