mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-24 10:32:46 +02:00
Send Stickers: WidgetManager: add userWidgets
and show them in the widget picker and within the list of installed widgets of the integration manager #1860
This commit is contained in:
@@ -551,20 +551,24 @@ NSString *const kJavascriptSendResponseToModular = @"riotIOS.sendResponse('%@',
|
||||
- (void)getWidgets:(NSDictionary*)eventData
|
||||
{
|
||||
MXRoom *room = [self roomCheckWithEvent:eventData];
|
||||
NSMutableArray<NSDictionary*> *widgetStateEvents = [NSMutableArray array];
|
||||
|
||||
if (room)
|
||||
{
|
||||
NSArray<Widget*> *widgets = [[WidgetManager sharedManager] widgetsInRoom:room];
|
||||
|
||||
NSMutableArray<NSDictionary*> *widgetStateEvents = [NSMutableArray arrayWithCapacity:widgets.count];
|
||||
|
||||
for (Widget *widget in widgets)
|
||||
{
|
||||
[widgetStateEvents addObject:widget.widgetEvent.JSONDictionary];
|
||||
}
|
||||
|
||||
[self sendNSObjectResponse:widgetStateEvents toEvent:eventData];
|
||||
}
|
||||
|
||||
// Add user widgets (not linked to a specific room)
|
||||
for (Widget *widget in [[WidgetManager sharedManager] userWidgets:mxSession])
|
||||
{
|
||||
[widgetStateEvents addObject:widget.widgetEvent.JSONDictionary];
|
||||
}
|
||||
|
||||
[self sendNSObjectResponse:widgetStateEvents toEvent:eventData];
|
||||
}
|
||||
|
||||
- (void)canSendEvent:(NSDictionary*)eventData
|
||||
|
||||
Reference in New Issue
Block a user