mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-03 06:36:58 +02:00
Jitsi widget: Show/hide the widget presence in RoomVC at runtime
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
NSString *const kWidgetEventTypeString = @"im.vector.modular.widgets";
|
||||
NSString *const kWidgetTypeJitsi = @"jitsi";
|
||||
|
||||
NSString *const kMXKWidgetManagerDidUpdateWidgetNotification = @"kMXKWidgetManagerDidUpdateWidgetNotification";
|
||||
|
||||
@interface WidgetManager ()
|
||||
{
|
||||
// UserId -> Listener for matrix events for widgets.
|
||||
@@ -67,7 +69,7 @@ NSString *const kWidgetTypeJitsi = @"jitsi";
|
||||
// We assume that returned events are ordered chronologically
|
||||
for (MXEvent *widgetEvent in widgetEvents.reverseObjectEnumerator)
|
||||
{
|
||||
// (widgetEvent.stateKey = widget id)
|
||||
// widgetEvent.stateKey = widget id
|
||||
if (!widgets[widgetEvent.stateKey])
|
||||
{
|
||||
Widget *widget = [[Widget alloc] initWithWidgetEvent:widgetEvent inMatrixSession:room.mxSession];
|
||||
@@ -97,8 +99,11 @@ NSString *const kWidgetTypeJitsi = @"jitsi";
|
||||
|
||||
if (direction == MXTimelineDirectionForwards)
|
||||
{
|
||||
// @TODO
|
||||
NSLog(@"event : %@", event);
|
||||
Widget *widget = [[Widget alloc] initWithWidgetEvent:event inMatrixSession:mxSession];
|
||||
if (widget)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kMXKWidgetManagerDidUpdateWidgetNotification object:widget];
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user