doc: realtime
parent
28e6890e94
commit
1cf7684597
|
@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Chatroom
|
/// LCIMChatRoom is a local representation of chatroom in LeanCloud.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LCIMChatRoom : LCIMConversation {
|
public class LCIMChatRoom : LCIMConversation {
|
||||||
public LCIMChatRoom(LCIMClient client) :
|
public LCIMChatRoom(LCIMClient client) :
|
||||||
|
@ -25,14 +25,29 @@ namespace LeanCloud.Realtime {
|
||||||
return await Client.ConversationController.GetOnlineMembers(Id, limit);
|
return await Client.ConversationController.GetOnlineMembers(Id, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds members to this conversation.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="clientIds"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public override Task<LCIMPartiallySuccessResult> AddMembers(IEnumerable<string> clientIds) {
|
public override Task<LCIMPartiallySuccessResult> AddMembers(IEnumerable<string> clientIds) {
|
||||||
throw new Exception("Add members is not allowed in chat room.");
|
throw new Exception("Add members is not allowed in chat room.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Flags the read status of this conversation.
|
||||||
|
/// But it's nothing to do in LCIMChatRoom.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
public override Task Read() {
|
public override Task Read() {
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fetchs the recipt timestamps of this conversation.
|
||||||
|
/// But it's nothing to do in LCIMChatRoom.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
public override Task FetchReciptTimestamps() {
|
public override Task FetchReciptTimestamps() {
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ using System.Collections.ObjectModel;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Conversation
|
/// LCIMConversation is a local representation of general conversation
|
||||||
|
/// in LeanCloud.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LCIMConversation {
|
public class LCIMConversation {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMConversationMemberInfo represents the member info of the conversation.
|
||||||
|
/// </summary>
|
||||||
public class LCIMConversationMemberInfo {
|
public class LCIMConversationMemberInfo {
|
||||||
public const string Owner = "Owner";
|
public const string Owner = "Owner";
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,12 @@ using System.Collections;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using LeanCloud.Storage.Internal.Query;
|
using LeanCloud.Storage.Internal.Query;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMConversationQuery is the query for conversation.
|
||||||
|
/// </summary>
|
||||||
public class LCIMConversationQuery {
|
public class LCIMConversationQuery {
|
||||||
internal const int CompactFlag = 0x1;
|
internal const int CompactFlag = 0x1;
|
||||||
internal const int WithLastMessageFlag = 0x2;
|
internal const int WithLastMessageFlag = 0x2;
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMMessageQueryEndpoint is the parameter that controls the limitation
|
||||||
|
/// of querying messages.
|
||||||
|
/// </summary>
|
||||||
public class LCIMMessageQueryEndpoint {
|
public class LCIMMessageQueryEndpoint {
|
||||||
public string MessageId {
|
public string MessageId {
|
||||||
get; set;
|
get; set;
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMServiceConversation is a local representation of service conversation
|
||||||
|
/// in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMServiceConversation : LCIMConversation {
|
public class LCIMServiceConversation : LCIMConversation {
|
||||||
public LCIMServiceConversation(LCIMClient client) : base(client) {
|
public LCIMServiceConversation(LCIMClient client) : base(client) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMTemporaryConversation is a local representation of temporary conversation
|
||||||
|
/// in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMTemporaryConversation : LCIMConversation {
|
public class LCIMTemporaryConversation : LCIMConversation {
|
||||||
public DateTime ExpiredAt {
|
public DateTime ExpiredAt {
|
||||||
get;
|
get;
|
||||||
|
|
|
@ -29,6 +29,9 @@ namespace LeanCloud.Realtime {
|
||||||
get; private set;
|
get; private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Device Id
|
||||||
|
/// </summary>
|
||||||
public string DeviceId {
|
public string DeviceId {
|
||||||
get; private set;
|
get; private set;
|
||||||
}
|
}
|
||||||
|
@ -235,6 +238,13 @@ namespace LeanCloud.Realtime {
|
||||||
|
|
||||||
#region 接口
|
#region 接口
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs a LCIMClient with client id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="clientId"></param>
|
||||||
|
/// <param name="tag"></param>
|
||||||
|
/// <param name="deviceId"></param>
|
||||||
|
/// <param name="signatureFactory"></param>
|
||||||
public LCIMClient(string clientId,
|
public LCIMClient(string clientId,
|
||||||
string tag = null,
|
string tag = null,
|
||||||
string deviceId = null,
|
string deviceId = null,
|
||||||
|
@ -245,6 +255,13 @@ namespace LeanCloud.Realtime {
|
||||||
SetUpClient(clientId, tag, deviceId, signatureFactory);
|
SetUpClient(clientId, tag, deviceId, signatureFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs a LCIMClient with a LCUser.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <param name="tag"></param>
|
||||||
|
/// <param name="deviceId"></param>
|
||||||
|
/// <param name="signatureFactory"></param>
|
||||||
public LCIMClient(LCUser user,
|
public LCIMClient(LCUser user,
|
||||||
string tag = null,
|
string tag = null,
|
||||||
string deviceId = null,
|
string deviceId = null,
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
using LeanCloud.Realtime.Internal.Connection;
|
using LeanCloud.Realtime.Internal.Connection;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCRealtime contains static functions that handle the global connection.
|
||||||
|
/// </summary>
|
||||||
public class LCRealtime {
|
public class LCRealtime {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Every application uses a connection.
|
/// Every application uses a connection.
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMAudioMessage is a local representation of audio message in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMAudioMessage : LCIMFileMessage {
|
public class LCIMAudioMessage : LCIMFileMessage {
|
||||||
public double Duration {
|
public double Duration {
|
||||||
get; private set;
|
get; private set;
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMBinaryMessage is a local representation of binary message in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMBinaryMessage : LCIMMessage {
|
public class LCIMBinaryMessage : LCIMMessage {
|
||||||
public byte[] Data {
|
public byte[] Data {
|
||||||
get; internal set;
|
get; internal set;
|
||||||
|
|
|
@ -5,6 +5,9 @@ using LeanCloud.Storage;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMFileMessage is a local representation of file message in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMFileMessage : LCIMTextMessage {
|
public class LCIMFileMessage : LCIMTextMessage {
|
||||||
public LCFile File {
|
public LCFile File {
|
||||||
get; set;
|
get; set;
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMImageMessage is a local representation of image message in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMImageMessage : LCIMFileMessage {
|
public class LCIMImageMessage : LCIMFileMessage {
|
||||||
public int Width {
|
public int Width {
|
||||||
get; private set;
|
get; private set;
|
||||||
|
|
|
@ -3,6 +3,9 @@ using System.Collections.Generic;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMLocationMessage is a local representation of location message in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMLocationMessage : LCIMTextMessage {
|
public class LCIMLocationMessage : LCIMTextMessage {
|
||||||
public LCGeoPoint Location {
|
public LCGeoPoint Location {
|
||||||
get; set;
|
get; set;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMTextMessage is a local representation of text message in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMTextMessage : LCIMTypedMessage {
|
public class LCIMTextMessage : LCIMTypedMessage {
|
||||||
public string Text {
|
public string Text {
|
||||||
get; set;
|
get; set;
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMVideoMessage is a local representation of video message in LeanCloud.
|
||||||
|
/// </summary>
|
||||||
public class LCIMVideoMessage : LCIMFileMessage {
|
public class LCIMVideoMessage : LCIMFileMessage {
|
||||||
public int Width {
|
public int Width {
|
||||||
get; private set;
|
get; private set;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMOperationFailure is the result that handles the operation of conversation.
|
||||||
|
/// </summary>
|
||||||
public class LCIMOperationFailure {
|
public class LCIMOperationFailure {
|
||||||
public int Code {
|
public int Code {
|
||||||
get; set;
|
get; set;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMPageResult represents the results of query.
|
||||||
|
/// </summary>
|
||||||
public class LCIMPageResult {
|
public class LCIMPageResult {
|
||||||
public ReadOnlyCollection<string> Results {
|
public ReadOnlyCollection<string> Results {
|
||||||
get; internal set;
|
get; internal set;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMPartiallySuccessResult is the result that handles the operation of conversation.
|
||||||
|
/// </summary>
|
||||||
public class LCIMPartiallySuccessResult {
|
public class LCIMPartiallySuccessResult {
|
||||||
public List<string> SuccessfulClientIdList {
|
public List<string> SuccessfulClientIdList {
|
||||||
get; internal set;
|
get; internal set;
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
public interface ILCIMSignatureFactory {
|
public interface ILCIMSignatureFactory {
|
||||||
Task<LCIMSignature> CreateConnectSignature(string clientId);
|
Task<LCIMSignature> CreateConnectSignature(string clientId);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
namespace LeanCloud.Realtime {
|
namespace LeanCloud.Realtime {
|
||||||
|
/// <summary>
|
||||||
|
/// LCIMSignature represents a LCRealtime signature.
|
||||||
|
/// </summary>
|
||||||
public class LCIMSignature {
|
public class LCIMSignature {
|
||||||
public string Signature {
|
public string Signature {
|
||||||
get; set;
|
get; set;
|
||||||
|
|
Loading…
Reference in New Issue