Skip to content

Commit 03069f7

Browse files
stefanceriubnjbvr
authored andcommitted
fix: fix what permissions get_element_call_required_permissions returns and have them match what Element Call actually expects
1 parent f7aee0e commit 03069f7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

bindings/matrix-sdk-ffi/src/widget.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,12 @@ pub fn new_virtual_element_call_widget(
260260
/// but should only be done as temporal workarounds until this function is
261261
/// adjusted
262262
#[uniffi::export]
263-
pub fn get_element_call_required_permissions() -> WidgetCapabilities {
263+
pub fn get_element_call_required_permissions(own_user_id: String) -> WidgetCapabilities {
264264
use ruma::events::StateEventType;
265265

266266
WidgetCapabilities {
267267
read: vec![
268+
WidgetEventFilter::StateWithType { event_type: "org.matrix.msc3401.call".to_owned() },
268269
WidgetEventFilter::StateWithType { event_type: StateEventType::CallMember.to_string() },
269270
WidgetEventFilter::StateWithType { event_type: StateEventType::RoomMember.to_string() },
270271
WidgetEventFilter::MessageLikeWithType {
@@ -275,11 +276,14 @@ pub fn get_element_call_required_permissions() -> WidgetCapabilities {
275276
},
276277
],
277278
send: vec![
278-
WidgetEventFilter::StateWithType { event_type: StateEventType::CallMember.to_string() },
279-
WidgetEventFilter::StateWithType {
279+
WidgetEventFilter::StateWithTypeAndStateKey {
280+
event_type: StateEventType::CallMember.to_string(),
281+
state_key: own_user_id.clone(),
282+
},
283+
WidgetEventFilter::MessageLikeWithType {
280284
event_type: "org.matrix.rageshake_request".to_owned(),
281285
},
282-
WidgetEventFilter::StateWithType {
286+
WidgetEventFilter::MessageLikeWithType {
283287
event_type: "io.element.call.encryption_keys".to_owned(),
284288
},
285289
],

0 commit comments

Comments
 (0)