fix: make sure room is postLoaded before starting calls

more logging
This commit is contained in:
td 2024-05-23 14:10:20 +05:30
parent 5cf4a884ec
commit 06728b4b75
No known key found for this signature in database
GPG Key ID: 62A30523D4D6CE28
2 changed files with 21 additions and 2 deletions

View File

@ -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}
''',
);
}
}

View File

@ -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}
''',
);
}