File tree 3 files changed +16
-3
lines changed
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ public interface IChannelClient
56
56
57
57
/// <summary>
58
58
/// <para>Mutes a channel.</para>
59
- /// Messages added to a channel will not trigger push notifications, nor change the
59
+ /// Messages added to a muted channel will not trigger push notifications, nor change the
60
60
/// unread count for the users that muted it. By default, mutes stay in place indefinitely
61
61
/// until the user removes it; however, you can optionally set an expiration time. The list
62
62
/// of muted channels and their expiration time is returned when the user connects.
@@ -66,10 +66,11 @@ public interface IChannelClient
66
66
67
67
/// <summary>
68
68
/// <para>Unmutes a channel.</para>
69
- /// Messages added to a channel will not trigger push notifications, nor change the
69
+ /// Messages added to a muted channel will not trigger push notifications, nor change the
70
70
/// unread count for the users that muted it. By default, mutes stay in place indefinitely
71
71
/// until the user removes it; however, you can optionally set an expiration time. The list
72
72
/// of muted channels and their expiration time is returned when the user connects.
73
+ /// This method removes the mute which means the users will receive notifications again.
73
74
/// </summary>
74
75
/// <remarks>https://getstream.io/chat/docs/dotnet-csharp/muting_channels/?language=csharp</remarks>
75
76
Task < ChannelUnmuteResponse > UnmuteChannelAsync ( ChannelUnmuteRequest request ) ;
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ public class Channel : CustomDataBase
50
50
51
51
[ JsonProperty ( NullValueHandling = NullValueHandling . Ignore , PropertyName = "last_message_at" ) ]
52
52
public DateTimeOffset ? LastMessageAt { get ; set ; }
53
+
54
+ [ JsonProperty ( NullValueHandling = NullValueHandling . Ignore , PropertyName = "truncated_by" ) ]
55
+ public User TruncatedBy { get ; set ; }
53
56
}
54
57
55
58
public class ChannelWithConfig : Channel
@@ -137,6 +140,12 @@ public class TruncateOptions
137
140
138
141
[ JsonProperty ( NullValueHandling = NullValueHandling . Ignore , PropertyName = "truncated_at" ) ]
139
142
public DateTimeOffset ? TruncatedAt { get ; set ; }
143
+
144
+ [ JsonProperty ( NullValueHandling = NullValueHandling . Ignore , PropertyName = "user_id" ) ]
145
+ public string UserId { get ; set ; }
146
+
147
+ [ JsonProperty ( NullValueHandling = NullValueHandling . Ignore , PropertyName = "user" ) ]
148
+ public User User { get ; set ; }
140
149
}
141
150
142
151
public class TruncateResponse : ApiResponse
Original file line number Diff line number Diff line change @@ -151,10 +151,13 @@ public async Task TestChannelTruncateAsync()
151
151
var originalChannel = await _channelClient . GetOrCreateAsync ( _channel . Type , _channel . Id , new ChannelGetRequest { State = true } ) ;
152
152
originalChannel . Messages . Should ( ) . NotBeEmpty ( ) ;
153
153
154
- await _channelClient . TruncateAsync ( _channel . Type , _channel . Id ) ;
154
+ await _channelClient . TruncateAsync ( _channel . Type , _channel . Id , new TruncateOptions { UserId = _user2 . Id } ) ;
155
155
156
156
var afterTruncateChannel = await _channelClient . GetOrCreateAsync ( _channel . Type , _channel . Id , new ChannelGetRequest { State = true } ) ;
157
157
afterTruncateChannel . Messages . Should ( ) . BeEmpty ( ) ;
158
+
159
+ // this isn't deployed to the test environment, so uncomment it a bit later:
160
+ // afterTruncateChannel.Channel.TruncatedBy.Id.Should().Be(_user2.Id);
158
161
}
159
162
160
163
[ Test ]
You can’t perform that action at this time.
0 commit comments