Skip to content

Commit 4a0e880

Browse files
authored
fix(llc): properly disconnect blocked user (#987)
* properly disconnect blocked user * changelog
1 parent da2f881 commit 4a0e880

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

packages/stream_video/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
## Unreleased
2+
3+
✅ Added
24
* Added `handleCallInterruptionCallbacks` method to `RtcMediaDeviceNotifier` that provides an option to handle system audio interruption like incoming calls, or other media playing
35

6+
🐞 Fixed
7+
* Fixed the handling of user blocking event to disconnect the blocked user with a proper reason.
8+
49
## 0.9.5
510

611
✅ Added

packages/stream_video/lib/src/call/state/mixins/state_coordinator_mixin.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@ mixin StateCoordinatorMixin on StateNotifier<CallState> {
512512

513513
void coordinatorCallUserBlocked(StreamCallUserBlockedEvent event) {
514514
state = state.copyWith(
515+
status: event.user.id == state.currentUserId
516+
? CallStatus.disconnected(
517+
const DisconnectReason.blocked(),
518+
)
519+
: null,
515520
blockedUserIds: [
516521
...state.blockedUserIds,
517522
event.user.id,

packages/stream_video/lib/src/models/disconnect_reason.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ abstract class DisconnectReason extends Equatable {
1919
CallRejectReason? reason,
2020
}) = DisconnectReasonRejected;
2121

22+
const factory DisconnectReason.blocked() = DisconnectReasonBlocked;
23+
2224
const factory DisconnectReason.cancelled({
2325
required String byUserId,
2426
}) = DisconnectReasonCancelled;
@@ -84,6 +86,15 @@ class DisconnectReasonRejected extends DisconnectReason {
8486
}
8587
}
8688

89+
class DisconnectReasonBlocked extends DisconnectReason {
90+
const DisconnectReasonBlocked();
91+
92+
@override
93+
String toString() {
94+
return 'Blocked';
95+
}
96+
}
97+
8798
class DisconnectReasonCancelled extends DisconnectReason {
8899
const DisconnectReasonCancelled({
89100
required this.byUserId,

packages/stream_video_flutter/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
## Unreleased
2+
3+
✅ Added
24
* Added `handleCallInterruptionCallbacks` method to `RtcMediaDeviceNotifier` that provides an option to handle system audio interruption like incoming calls, or other media playing
35

6+
🐞 Fixed
7+
* Fixed the handling of user blocking event to disconnect the blocked user with a proper reason.
8+
49
## 0.9.5
510

611
✅ Added

0 commit comments

Comments
 (0)