diff --git a/lib/src/voip/utils/famedly_call_extension.dart b/lib/src/voip/utils/famedly_call_extension.dart index 4f5a70b1..23719e2d 100644 --- a/lib/src/voip/utils/famedly_call_extension.dart +++ b/lib/src/voip/utils/famedly_call_extension.dart @@ -129,7 +129,14 @@ extension FamedlyCallMemberEventsExtension on Room { ); } else { throw MatrixSDKVoipException( - 'User ${client.userID}:${client.deviceID} is not allowed to send famedly call member events in room $id, canJoinGroupCall: $canJoinGroupCall, room.canJoinGroupCall: $groupCallsEnabledForEveryone', + ''' + User ${client.userID}:${client.deviceID} is not allowed to join famedly calls in room $id, + canJoinGroupCall: $canJoinGroupCall, + groupCallsEnabledForEveryone: $groupCallsEnabledForEveryone, + needed: ${powerForChangingStateEvent(EventTypes.GroupCallMember)}, + own: $ownPowerLevel} + plMap: ${getState(EventTypes.RoomPowerLevels)?.content} + ''', ); } } diff --git a/lib/src/voip/voip.dart b/lib/src/voip/voip.dart index 7a752c04..847eca56 100644 --- a/lib/src/voip/voip.dart +++ b/lib/src/voip/voip.dart @@ -769,13 +769,25 @@ class VoIP { String? scope, { bool preShareKey = true, }) async { + // somehow user were mising their powerlevels events and got stuck + // with the exception below, this part just makes sure importantStateEvents + // does not cause it. + await room.postLoad(); + if (!room.groupCallsEnabledForEveryone) { await room.enableGroupCalls(); } if (!room.canJoinGroupCall) { throw MatrixSDKVoipException( - 'User ${client.userID}:${client.deviceID} is not allowed to join famedly calls in room ${room.id}, canJoinGroupCall: ${room.canJoinGroupCall}, room.canJoinGroupCall: ${room.groupCallsEnabledForEveryone}', + ''' + User ${client.userID}:${client.deviceID} is not allowed to join famedly calls in room ${room.id}, + canJoinGroupCall: ${room.canJoinGroupCall}, + groupCallsEnabledForEveryone: ${room.groupCallsEnabledForEveryone}, + needed: ${room.powerForChangingStateEvent(EventTypes.GroupCallMember)}, + own: ${room.ownPowerLevel}} + plMap: ${room.getState(EventTypes.RoomPowerLevels)?.content} + ''', ); }