Skip to content

Commit 35f6e24

Browse files
committed
Merge remote-tracking branch 'origin/develop' into release/v5.4.0
2 parents eb5b56a + 9117a89 commit 35f6e24

100 files changed

Lines changed: 5242 additions & 94 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/Plugins/StreamChat/Core/IStreamChatClient.cs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,32 @@ public interface IStreamChatClient : IDisposable, IStreamChatClientEventsListene
7070
/// </summary>
7171
event ChannelMemberRemovedHandler RemovedFromChannelAsMember;
7272

73+
/// <summary>
74+
/// Raised when an <see cref="IStreamThread"/> becomes available locally. Use this to bind
75+
/// per-thread UI and to subscribe to the thread's own events such as
76+
/// <see cref="IStreamThread.Updated"/>, <see cref="IStreamThread.ReplyReceived"/> and
77+
/// <see cref="IStreamThread.ReadStateChanged"/>.
78+
///
79+
/// Fires when:
80+
/// - A channel watch (<see cref="GetOrCreateChannelWithIdAsync"/>, <see cref="QueryChannelsAsync"/>)
81+
/// returns a channel that contains threads.
82+
/// - You call <see cref="GetThreadAsync"/> or <see cref="QueryThreadsAsync"/>.
83+
///
84+
/// A thread started by another user in a channel you are watching but where you are NOT a
85+
/// thread participant will not raise this event - the server delivers only the reply, with
86+
/// no thread payload. To learn about such threads call <see cref="QueryThreadsAsync"/>.
87+
/// </summary>
88+
event StreamThreadChangeHandler ThreadTracked;
89+
90+
/// <summary>
91+
/// Raised when an <see cref="IStreamThread"/> is no longer available locally. Use this to
92+
/// tear down per-thread UI.
93+
///
94+
/// Fires when the thread's parent message is hard-deleted - the thread is destroyed and
95+
/// will no longer appear in <see cref="QueryThreadsAsync"/> results.
96+
/// </summary>
97+
event StreamThreadChangeHandler ThreadUntracked;
98+
7399
/// <summary>
74100
/// Current connection state
75101
/// </summary>
@@ -222,6 +248,28 @@ Task<IEnumerable<IStreamChannel>> QueryChannelsAsync(IEnumerable<IFieldFilterRul
222248
Task<IEnumerable<StreamUserBanInfo>> QueryBannedUsersAsync(
223249
StreamQueryBannedUsersRequest streamQueryBannedUsersRequest);
224250

251+
/// <summary>
252+
/// Get a thread by its parent message id.
253+
/// A thread groups replies to a parent <see cref="IStreamMessage"/> in a <see cref="IStreamChannel"/>.
254+
/// </summary>
255+
/// <param name="parentMessageId">The id of the parent message of the thread</param>
256+
/// <param name="replyLimit">[Optional] Number of replies to fetch</param>
257+
/// <param name="participantLimit">[Optional] Number of participants to fetch</param>
258+
/// <param name="memberLimit">[Optional] Number of channel members to include</param>
259+
/// <param name="watch">[Optional] Whether to start watching the channel this thread belongs to. Defaults to true.</param>
260+
/// <returns>The requested thread</returns>
261+
Task<IStreamThread> GetThreadAsync(string parentMessageId,
262+
int? replyLimit = null,
263+
int? participantLimit = null,
264+
int? memberLimit = null,
265+
bool watch = true);
266+
267+
/// <summary>
268+
/// Query threads with optional filters and sorting
269+
/// </summary>
270+
/// <param name="request">Query request</param>
271+
Task<StreamQueryThreadsResponse> QueryThreadsAsync(StreamQueryThreadsRequest request);
272+
225273
/// <summary>
226274
/// Upsert users. Upsert means update this user or create if not found
227275
/// </summary>

Assets/Plugins/StreamChat/Core/InternalDTO/Events/NotificationMarkReadEventInternalDTO.cs

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,45 +13,126 @@ namespace StreamChat.Core.InternalDTO.Events
1313
{
1414
using System = global::System;
1515

16+
/// <summary>
17+
/// Emitted when a channel/thread is marked as read.
18+
/// </summary>
1619
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
1720
internal partial class NotificationMarkReadEventInternalDTO
1821
{
22+
/// <summary>
23+
/// The channel object which was marked as read
24+
/// </summary>
1925
[Newtonsoft.Json.JsonProperty("channel", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2026
public ChannelResponseInternalDTO Channel { get; set; }
2127

28+
[Newtonsoft.Json.JsonProperty("channel_custom", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
29+
public System.Collections.Generic.Dictionary<string, object> ChannelCustom { get; set; }
30+
31+
/// <summary>
32+
/// The ID of the channel which was marked as read
33+
/// </summary>
2234
[Newtonsoft.Json.JsonProperty("channel_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2335
public string ChannelId { get; set; }
2436

37+
/// <summary>
38+
/// The number of members in the channel
39+
/// </summary>
2540
[Newtonsoft.Json.JsonProperty("channel_member_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
26-
public int ChannelMemberCount { get; set; }
41+
public int? ChannelMemberCount { get; set; }
42+
43+
[Newtonsoft.Json.JsonProperty("channel_message_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
44+
public long? ChannelMessageCount { get; set; }
2745

46+
/// <summary>
47+
/// The type of the channel which was marked as read
48+
/// </summary>
2849
[Newtonsoft.Json.JsonProperty("channel_type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2950
public string ChannelType { get; set; }
3051

52+
/// <summary>
53+
/// The CID of the channel which was marked as read
54+
/// </summary>
3155
[Newtonsoft.Json.JsonProperty("cid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3256
public string Cid { get; set; }
3357

58+
/// <summary>
59+
/// Date/time of creation
60+
/// </summary>
3461
[Newtonsoft.Json.JsonProperty("created_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3562
public System.DateTimeOffset CreatedAt { get; set; }
3663

64+
[Newtonsoft.Json.JsonProperty("custom", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
65+
public System.Collections.Generic.Dictionary<string, object> Custom { get; set; } = new System.Collections.Generic.Dictionary<string, object>();
66+
67+
[Newtonsoft.Json.JsonProperty("grouped_unread_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
68+
public System.Collections.Generic.Dictionary<string, int> GroupedUnreadChannels { get; set; }
69+
70+
/// <summary>
71+
/// The ID of the last read message
72+
/// </summary>
73+
[Newtonsoft.Json.JsonProperty("last_read_message_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
74+
public string LastReadMessageId { get; set; }
75+
76+
[Newtonsoft.Json.JsonProperty("received_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
77+
public System.DateTimeOffset? ReceivedAt { get; set; }
78+
79+
/// <summary>
80+
/// The team ID
81+
/// </summary>
3782
[Newtonsoft.Json.JsonProperty("team", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3883
public string Team { get; set; }
3984

85+
/// <summary>
86+
/// The thread object which was marked as read
87+
/// </summary>
88+
[Newtonsoft.Json.JsonProperty("thread", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
89+
public ThreadResponseInternalDTO Thread { get; set; }
90+
91+
/// <summary>
92+
/// The ID of the thread which was marked as read
93+
/// </summary>
94+
[Newtonsoft.Json.JsonProperty("thread_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
95+
public string ThreadId { get; set; }
96+
97+
/// <summary>
98+
/// The total number of unread messages
99+
/// </summary>
40100
[Newtonsoft.Json.JsonProperty("total_unread_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
41101
public int TotalUnreadCount { get; set; }
42102

103+
/// <summary>
104+
/// The type of event: "notification.mark_read" in this case
105+
/// </summary>
43106
[Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
44107
public string Type { get; set; } = "notification.mark_read";
45108

109+
/// <summary>
110+
/// The number of channels with unread messages
111+
/// </summary>
46112
[Newtonsoft.Json.JsonProperty("unread_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
47113
public int UnreadChannels { get; set; }
48114

115+
/// <summary>
116+
/// The total number of unread messages
117+
/// </summary>
49118
[Newtonsoft.Json.JsonProperty("unread_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
50119
public int UnreadCount { get; set; }
51120

121+
/// <summary>
122+
/// The total number of unread messages in the threads
123+
/// </summary>
124+
[Newtonsoft.Json.JsonProperty("unread_thread_messages", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
125+
public int? UnreadThreadMessages { get; set; }
126+
127+
/// <summary>
128+
/// The number of unread threads
129+
/// </summary>
52130
[Newtonsoft.Json.JsonProperty("unread_threads", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
53-
public int UnreadThreads { get; set; }
131+
public int? UnreadThreads { get; set; }
54132

133+
/// <summary>
134+
/// The user who marked the channel as read
135+
/// </summary>
55136
[Newtonsoft.Json.JsonProperty("user", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
56137
public UserObjectInternalDTO User { get; set; }
57138

Assets/Plugins/StreamChat/Core/InternalDTO/Events/NotificationMarkUnreadEventInternalDTO.cs

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,138 @@ namespace StreamChat.Core.InternalDTO.Events
1313
{
1414
using System = global::System;
1515

16+
/// <summary>
17+
/// Emitted when a channel/thread is marked as unread.
18+
/// </summary>
1619
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
1720
internal partial class NotificationMarkUnreadEventInternalDTO
1821
{
22+
/// <summary>
23+
/// The channel object which was marked as read
24+
/// </summary>
1925
[Newtonsoft.Json.JsonProperty("channel", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2026
public ChannelResponseInternalDTO Channel { get; set; }
2127

28+
[Newtonsoft.Json.JsonProperty("channel_custom", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
29+
public System.Collections.Generic.Dictionary<string, object> ChannelCustom { get; set; }
30+
31+
/// <summary>
32+
/// The ID of the channel which was marked as unread
33+
/// </summary>
2234
[Newtonsoft.Json.JsonProperty("channel_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2335
public string ChannelId { get; set; }
2436

37+
/// <summary>
38+
/// The number of members in the channel
39+
/// </summary>
2540
[Newtonsoft.Json.JsonProperty("channel_member_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
26-
public int ChannelMemberCount { get; set; }
41+
public int? ChannelMemberCount { get; set; }
42+
43+
[Newtonsoft.Json.JsonProperty("channel_message_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
44+
public long? ChannelMessageCount { get; set; }
2745

46+
/// <summary>
47+
/// The type of the channel which was marked as unread
48+
/// </summary>
2849
[Newtonsoft.Json.JsonProperty("channel_type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
2950
public string ChannelType { get; set; }
3051

52+
/// <summary>
53+
/// The CID of the channel which was marked as unread
54+
/// </summary>
3155
[Newtonsoft.Json.JsonProperty("cid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3256
public string Cid { get; set; }
3357

58+
/// <summary>
59+
/// Date/time of creation
60+
/// </summary>
3461
[Newtonsoft.Json.JsonProperty("created_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3562
public System.DateTimeOffset CreatedAt { get; set; }
3663

64+
[Newtonsoft.Json.JsonProperty("custom", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
65+
public System.Collections.Generic.Dictionary<string, object> Custom { get; set; } = new System.Collections.Generic.Dictionary<string, object>();
66+
67+
/// <summary>
68+
/// The ID of the first unread message
69+
/// </summary>
3770
[Newtonsoft.Json.JsonProperty("first_unread_message_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
3871
public string FirstUnreadMessageId { get; set; }
3972

73+
[Newtonsoft.Json.JsonProperty("grouped_unread_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
74+
public System.Collections.Generic.Dictionary<string, int> GroupedUnreadChannels { get; set; }
75+
76+
/// <summary>
77+
/// The time when the channel/thread was marked as unread
78+
/// </summary>
4079
[Newtonsoft.Json.JsonProperty("last_read_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
41-
public System.DateTimeOffset LastReadAt { get; set; }
80+
public System.DateTimeOffset? LastReadAt { get; set; }
4281

82+
/// <summary>
83+
/// The ID of the last read message
84+
/// </summary>
4385
[Newtonsoft.Json.JsonProperty("last_read_message_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
4486
public string LastReadMessageId { get; set; }
4587

88+
[Newtonsoft.Json.JsonProperty("received_at", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
89+
public System.DateTimeOffset? ReceivedAt { get; set; }
90+
91+
/// <summary>
92+
/// The team ID
93+
/// </summary>
4694
[Newtonsoft.Json.JsonProperty("team", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
4795
public string Team { get; set; }
4896

97+
/// <summary>
98+
/// The ID of the thread which was marked as unread
99+
/// </summary>
100+
[Newtonsoft.Json.JsonProperty("thread_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
101+
public string ThreadId { get; set; }
102+
103+
/// <summary>
104+
/// The total number of unread messages
105+
/// </summary>
49106
[Newtonsoft.Json.JsonProperty("total_unread_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
50-
public int TotalUnreadCount { get; set; }
107+
public int? TotalUnreadCount { get; set; }
51108

109+
/// <summary>
110+
/// The type of event: "notification.mark_unread" in this case
111+
/// </summary>
52112
[Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
53113
public string Type { get; set; } = "notification.mark_unread";
54114

115+
/// <summary>
116+
/// The number of channels with unread messages
117+
/// </summary>
55118
[Newtonsoft.Json.JsonProperty("unread_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
56-
public int UnreadChannels { get; set; }
119+
public int? UnreadChannels { get; set; }
57120

121+
/// <summary>
122+
/// The total number of unread messages
123+
/// </summary>
58124
[Newtonsoft.Json.JsonProperty("unread_count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
59-
public int UnreadCount { get; set; }
125+
public int? UnreadCount { get; set; }
60126

127+
/// <summary>
128+
/// The number of unread messages in the channel/thread after first_unread_message_id
129+
/// </summary>
61130
[Newtonsoft.Json.JsonProperty("unread_messages", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
62-
public int UnreadMessages { get; set; }
131+
public int? UnreadMessages { get; set; }
132+
133+
/// <summary>
134+
/// The total number of unread messages in the threads
135+
/// </summary>
136+
[Newtonsoft.Json.JsonProperty("unread_thread_messages", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
137+
public int? UnreadThreadMessages { get; set; }
63138

139+
/// <summary>
140+
/// The number of unread threads
141+
/// </summary>
64142
[Newtonsoft.Json.JsonProperty("unread_threads", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
65-
public int UnreadThreads { get; set; }
143+
public int? UnreadThreads { get; set; }
66144

145+
/// <summary>
146+
/// The user who marked the channel as unread
147+
/// </summary>
67148
[Newtonsoft.Json.JsonProperty("user", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
68149
public UserObjectInternalDTO User { get; set; }
69150

0 commit comments

Comments
 (0)