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:
manuroe
2018-05-07 11:15:18 +02:00
parent acf230465b
commit 6a04301926
5 changed files with 58 additions and 12 deletions
@@ -53,12 +53,19 @@
MXRoom *room = [mxSession roomWithRoomId:roomId];
NSArray<Widget*> *widgets = [[WidgetManager sharedManager] widgetsNotOfTypes:@[kWidgetTypeJitsi]
NSArray<Widget*> *roomWidgets = [[WidgetManager sharedManager] widgetsNotOfTypes:@[kWidgetTypeJitsi]
inRoom:room];
NSArray<Widget*> *userWidgets = [[WidgetManager sharedManager] userWidgets:room.mxSession];
NSMutableArray<Widget*> *widgets = [NSMutableArray array];
[widgets addObjectsFromArray:roomWidgets];
[widgets addObjectsFromArray:userWidgets];
// List widgets
for (Widget *widget in widgets)
{
alertAction = [UIAlertAction actionWithTitle:widget.name
alertAction = [UIAlertAction actionWithTitle:widget.name ? widget.name : widget.type
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action)
{