Commit 81643749 authored by Valere's avatar Valere

Refactor due to SDK changes for native_widgets

parent 20b8eed0
......@@ -259,7 +259,7 @@ class IntegrationManagerActivity : AbstractWidgetActivity() {
Log.d(LOG_TAG, "Received request to get widget in room " + mRoom!!.roomId)
val widgets = widgetManager.getActiveWidgets(mSession, mRoom)
val widgets = WidgetsManager.getActiveWidgets(mSession, mRoom)
val responseData = ArrayList<JsonDict<Any>>()
for (widget in widgets) {
......
......@@ -1772,7 +1772,7 @@ public class VectorRoomActivity extends MXCActionBarActivity implements
String domain = UrlUtilKt.extractDomain(JitsiCallActivity.JITSI_SERVER_URL);
if (domain == null) return; //display a toast?
boolean isAllowed = mSession.getIntegrationManager().isVideoConfDomainAllowed(domain);
boolean isAllowed = mSession.getIntegrationManager().isNativeWidgetAllowed("jitsi", domain);
if (isAllowed) {
final Intent intent = new Intent(this, JitsiCallActivity.class);
intent.putExtra(JitsiCallActivity.EXTRA_WIDGET_ID, widget);
......
......@@ -54,7 +54,7 @@ class RoomWidgetPermissionViewModel(val session: MXSession, val widget: Widget,
})
} else {
session.integrationManager.seVideoConfDomainAllowed(state.widgetDomain
session.integrationManager.setNativeWidgetDomainAllowed("jitsi", state.widgetDomain
?: "", true, object : SimpleApiCallback<Void?>() {
override fun onSuccess(info: Void?) {
......@@ -75,7 +75,7 @@ class RoomWidgetPermissionViewModel(val session: MXSession, val widget: Widget,
})
} else {
session.integrationManager.seVideoConfDomainAllowed(state.widgetDomain
session.integrationManager.setNativeWidgetDomainAllowed("jitsi", state.widgetDomain
?: "", false, object : SimpleApiCallback<Void?>() {
override fun onSuccess(info: Void?) {
......
......@@ -165,9 +165,7 @@ class RoomWidgetViewModel(initialState: RoomWidgetViewModelState, val widget: Wi
val isAllowed = session
?.integrationManager
?.getKnownWidgetPermissions()
?.find { it.stateEventId == widget.widgetEvent.eventId }
?.allowed
?.isWidgetAllowed( widget.widgetEvent.eventId)
?: false
if (!isAllowed) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment