Skip to content

Commit 2db06df

Browse files
authored
Merge pull request #201 from easemob/dev_1.2.0
Dev 1.2.0
2 parents b4aaf45 + 8dc1824 commit 2db06df

File tree

20 files changed

+891
-835
lines changed

20 files changed

+891
-835
lines changed

AgoraChatSDK/AgoraChat/Managers/ChatThreadManager.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using AgoraChat.SimpleJSON;
33

44
namespace AgoraChat
@@ -331,10 +331,10 @@ public void FetchThreadMembers(string threadId, string cursor = null, int pageSi
331331
{
332332
return jn.IsString ? jn.Value : null;
333333
});
334-
335-
cursor_msg.FromJsonObject(jsonNode.AsObject);
336-
return cursor_msg;
337-
334+
335+
cursor_msg.FromJsonObject(jsonNode.AsObject);
336+
return cursor_msg;
337+
338338
};
339339

340340
NativeCall<CursorResult<string>>(SDKMethod.fetchChatThreadMember, jo_param, callback, process);
@@ -380,10 +380,10 @@ public void FetchThreadListOfGroup(string groupId, bool joined, string cursor =
380380
{
381381
return ModelHelper.CreateWithJsonObject<ChatThread>(jn);
382382
});
383-
384-
cursor_msg.FromJsonObject(jsonNode.AsObject);
385-
return cursor_msg;
386-
383+
384+
cursor_msg.FromJsonObject(jsonNode.AsObject);
385+
return cursor_msg;
386+
387387
};
388388

389389
NativeCall<CursorResult<ChatThread>>(SDKMethod.fetchChatThreadsWithParentId, jo_param, callback, process);
@@ -423,10 +423,10 @@ public void FetchMineJoinedThreadList(string cursor = null, int pageSize = 20, V
423423
{
424424
return ModelHelper.CreateWithJsonObject<ChatThread>(jn);
425425
});
426-
427-
cursor_msg.FromJsonObject(jsonNode.AsObject);
428-
return cursor_msg;
429-
426+
427+
cursor_msg.FromJsonObject(jsonNode.AsObject);
428+
return cursor_msg;
429+
430430
};
431431

432432
NativeCall<CursorResult<ChatThread>>(SDKMethod.fetchJoinedChatThreads, jo_param, callback, process);

AgoraChatSDK/AgoraChat/Managers/PresenceManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using AgoraChat.SimpleJSON;
33

44
namespace AgoraChat
Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
using System.Collections.Generic;
2-
using AgoraChat.SimpleJSON;
3-
4-
namespace AgoraChat
5-
{
6-
public class CursorResult<T> : BaseModel
7-
{
8-
/**
9-
* \~chinese
10-
* 游标。
11-
*
12-
* \~english
13-
* The cursor.
14-
*/
15-
public string Cursor { get; internal set; }
16-
17-
/**
18-
* \~chinese
19-
* 数据列表。
20-
*
21-
* \~english
22-
* The data list.
23-
*/
24-
public List<T> Data { get; internal set; }
25-
26-
internal CursorResult() { }
27-
28-
internal CursorResult(string jsonString, ItemCallback callback = null)
29-
{
30-
this.callback = callback;
31-
}
32-
33-
internal CursorResult(JSONObject jsonObject, ItemCallback callback = null)
34-
{
35-
this.callback = callback;
36-
}
37-
38-
internal override void FromJsonObject(JSONObject jsonObject)
39-
{
40-
Cursor = jsonObject["cursor"];
41-
JSONNode jn = jsonObject["list"];
42-
if (jn.IsArray)
43-
{
44-
JSONArray jsonArray = jn.AsArray;
45-
Data = new List<T>();
46-
foreach (var jsonObj in jsonArray)
47-
{
48-
object ret = callback(jsonObj);
49-
if (ret != null)
50-
{
51-
Data.Add((T)ret);
52-
}
53-
}
54-
}
55-
callback = null;
56-
}
57-
58-
internal override JSONObject ToJsonObject()
59-
{
60-
JSONObject jo = new JSONObject();
61-
jo.AddWithoutNull("cursor", Cursor);
62-
// Note: Data type?
63-
return jo;
64-
}
65-
66-
private ItemCallback callback;
67-
internal delegate T ItemCallback(JSONNode jsonNode);
68-
}
1+
using System.Collections.Generic;
2+
using AgoraChat.SimpleJSON;
3+
4+
namespace AgoraChat
5+
{
6+
public class CursorResult<T> : BaseModel
7+
{
8+
/**
9+
* \~chinese
10+
* 游标。
11+
*
12+
* \~english
13+
* The cursor.
14+
*/
15+
public string Cursor { get; internal set; }
16+
17+
/**
18+
* \~chinese
19+
* 数据列表。
20+
*
21+
* \~english
22+
* The data list.
23+
*/
24+
public List<T> Data { get; internal set; }
25+
26+
internal CursorResult() { }
27+
28+
internal CursorResult(string jsonString, ItemCallback callback = null)
29+
{
30+
this.callback = callback;
31+
}
32+
33+
internal CursorResult(JSONObject jsonObject, ItemCallback callback = null)
34+
{
35+
this.callback = callback;
36+
}
37+
38+
internal override void FromJsonObject(JSONObject jsonObject)
39+
{
40+
Cursor = jsonObject["cursor"];
41+
JSONNode jn = jsonObject["list"];
42+
if (jn.IsArray)
43+
{
44+
JSONArray jsonArray = jn.AsArray;
45+
Data = new List<T>();
46+
foreach (var jsonObj in jsonArray)
47+
{
48+
object ret = callback(jsonObj);
49+
if (ret != null)
50+
{
51+
Data.Add((T)ret);
52+
}
53+
}
54+
}
55+
callback = null;
56+
}
57+
58+
internal override JSONObject ToJsonObject()
59+
{
60+
JSONObject jo = new JSONObject();
61+
jo.AddWithoutNull("cursor", Cursor);
62+
// Note: Data type?
63+
return jo;
64+
}
65+
66+
private ItemCallback callback;
67+
internal delegate T ItemCallback(JSONNode jsonNode);
68+
}
6969
}
Lines changed: 99 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,99 @@
1-
using System.Collections.Generic;
2-
using AgoraChat.SimpleJSON;
3-
namespace AgoraChat
4-
{
5-
/**
6-
* \~chinese
7-
* 消息 Reaction 实体类,有如下属性:
8-
*
9-
* Reaction:消息 Reaction。
10-
* UserCount:添加了指定 Reaction 的用户数量。
11-
* UserList:添加了指定 Reaction 的用户列表。
12-
* State 当前用户是否添加了该 Reaction。
13-
*
14-
* \~english
15-
* The message Reaction instance class, which has the following attributes:
16-
*
17-
* Reaction: The message Reaction.
18-
* UserCount: The count of users that added the Reaction.
19-
* UserList: The list of users that added the Reaction.
20-
* State: Whether the current user added this Reaction.
21-
*/
22-
public class MessageReaction : BaseModel
23-
{
24-
/**
25-
* \~chinese
26-
* 获取 Reaction 内容。
27-
*
28-
* \~english
29-
* Gets the Reaction.
30-
*/
31-
public string Reaction;
32-
33-
/**
34-
* \~chinese
35-
* 获取添加了指定 Reaction 的用户数量。
36-
*
37-
* \~english
38-
* Gets the count of users that added this Reaction.
39-
*/
40-
public int Count;
41-
42-
/**
43-
* \~chinese
44-
* 获取添加了指定 Reaction 的用户列表。
45-
*
46-
* **Note**
47-
* 只有通过 {@link IChatManager#GetReactionDetail} 接口获取的是全部用户的分页数据;其他相关接口如{@link IChatManager#GetReactionList}等都只包含前三个用户。
48-
*
49-
* @return 用户列表。
50-
*
51-
* \~english
52-
* Gets the list of users that added this Reaction.
53-
*
54-
* **Note**
55-
* {@link IChatManager#GetReactionDetail} can return the entire list of users that added this Reaction with pagination, whereas other methods such as {@link IChatManager#GetReactionList} can only return the first three users.
56-
* @return The list of users that added this Reaction.
57-
*/
58-
public List<string> UserList;
59-
60-
/**
61-
* \~chinese
62-
* 获取当前用户是否添加过该 Reaction。
63-
*
64-
* - `true`:是;
65-
* - `false`:否。
66-
*
67-
* \~english
68-
* Gets whether the current user has added the Reaction.
69-
*
70-
* - `true`: Yes.
71-
* - `false`: No.
72-
*/
73-
public bool State;
74-
75-
internal MessageReaction() { }
76-
77-
internal MessageReaction(string jsonString) : base(jsonString) { }
78-
79-
internal MessageReaction(JSONObject jsonObject) : base(jsonObject) { }
80-
81-
internal override void FromJsonObject(JSONObject jsonObject)
82-
{
83-
Reaction = jsonObject["reaction"];
84-
Count = jsonObject["count"].AsInt;
85-
UserList = List.StringListFromJsonArray(jsonObject["userList"]);
86-
State = jsonObject["isAddedBySelf"].AsBool;
87-
}
88-
89-
internal override JSONObject ToJsonObject()
90-
{
91-
JSONObject jo = new JSONObject();
92-
jo.AddWithoutNull("reaction", Reaction);
93-
jo.AddWithoutNull("count", Count);
94-
jo.AddWithoutNull("userList", JsonObject.JsonArrayFromStringList(UserList));
95-
jo.AddWithoutNull("isAddedBySelf", State);
96-
return jo;
97-
}
98-
}
99-
}
1+
using System.Collections.Generic;
2+
using AgoraChat.SimpleJSON;
3+
namespace AgoraChat
4+
{
5+
/**
6+
* \~chinese
7+
* 消息 Reaction 实体类,有如下属性:
8+
*
9+
* Reaction:消息 Reaction。
10+
* UserCount:添加了指定 Reaction 的用户数量。
11+
* UserList:添加了指定 Reaction 的用户列表。
12+
* State 当前用户是否添加了该 Reaction。
13+
*
14+
* \~english
15+
* The message Reaction instance class, which has the following attributes:
16+
*
17+
* Reaction: The message Reaction.
18+
* UserCount: The count of users that added the Reaction.
19+
* UserList: The list of users that added the Reaction.
20+
* State: Whether the current user added this Reaction.
21+
*/
22+
public class MessageReaction : BaseModel
23+
{
24+
/**
25+
* \~chinese
26+
* 获取 Reaction 内容。
27+
*
28+
* \~english
29+
* Gets the Reaction.
30+
*/
31+
public string Reaction;
32+
33+
/**
34+
* \~chinese
35+
* 获取添加了指定 Reaction 的用户数量。
36+
*
37+
* \~english
38+
* Gets the count of users that added this Reaction.
39+
*/
40+
public int Count;
41+
42+
/**
43+
* \~chinese
44+
* 获取添加了指定 Reaction 的用户列表。
45+
*
46+
* **Note**
47+
* 只有通过 {@link IChatManager#GetReactionDetail} 接口获取的是全部用户的分页数据;其他相关接口如{@link IChatManager#GetReactionList}等都只包含前三个用户。
48+
*
49+
* @return 用户列表。
50+
*
51+
* \~english
52+
* Gets the list of users that added this Reaction.
53+
*
54+
* **Note**
55+
* {@link IChatManager#GetReactionDetail} can return the entire list of users that added this Reaction with pagination, whereas other methods such as {@link IChatManager#GetReactionList} can only return the first three users.
56+
* @return The list of users that added this Reaction.
57+
*/
58+
public List<string> UserList;
59+
60+
/**
61+
* \~chinese
62+
* 获取当前用户是否添加过该 Reaction。
63+
*
64+
* - `true`:是;
65+
* - `false`:否。
66+
*
67+
* \~english
68+
* Gets whether the current user has added the Reaction.
69+
*
70+
* - `true`: Yes.
71+
* - `false`: No.
72+
*/
73+
public bool State;
74+
75+
internal MessageReaction() { }
76+
77+
internal MessageReaction(string jsonString) : base(jsonString) { }
78+
79+
internal MessageReaction(JSONObject jsonObject) : base(jsonObject) { }
80+
81+
internal override void FromJsonObject(JSONObject jsonObject)
82+
{
83+
Reaction = jsonObject["reaction"];
84+
Count = jsonObject["count"].AsInt;
85+
UserList = List.StringListFromJsonArray(jsonObject["userList"]);
86+
State = jsonObject["isAddedBySelf"].AsBool;
87+
}
88+
89+
internal override JSONObject ToJsonObject()
90+
{
91+
JSONObject jo = new JSONObject();
92+
jo.AddWithoutNull("reaction", Reaction);
93+
jo.AddWithoutNull("count", Count);
94+
jo.AddWithoutNull("userList", JsonObject.JsonArrayFromStringList(UserList));
95+
jo.AddWithoutNull("isAddedBySelf", State);
96+
return jo;
97+
}
98+
}
99+
}

0 commit comments

Comments
 (0)