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:
@@ -1257,9 +1257,10 @@
|
||||
// If the setting is disabled, do not show the icon
|
||||
self.navigationItem.rightBarButtonItems = @[self.navigationItem.rightBarButtonItem];
|
||||
}
|
||||
else if (self.widgetsCount)
|
||||
else if ([self widgetsCount:NO])
|
||||
{
|
||||
// Show there are widgets by changing the "apps" icon color
|
||||
// Show it in red only for room widgets, not user's widgets
|
||||
// TODO: Design must be reviewed
|
||||
UIImage *icon = self.navigationItem.rightBarButtonItems[1].image;
|
||||
icon = [MXKTools paintImage:icon withColor:kRiotColorPinkRed];
|
||||
@@ -3063,7 +3064,7 @@
|
||||
// Matrix Apps button
|
||||
else if (self.navigationItem.rightBarButtonItems.count == 2 && sender == self.navigationItem.rightBarButtonItems[1])
|
||||
{
|
||||
if (self.widgetsCount)
|
||||
if ([self widgetsCount:YES])
|
||||
{
|
||||
WidgetPickerViewController *widgetPicker = [[WidgetPickerViewController alloc] initForMXSession:self.roomDataSource.mxSession
|
||||
inRoom:self.roomDataSource.roomId];
|
||||
@@ -3643,10 +3644,16 @@
|
||||
[[AppDelegate theDelegate] showErrorAsAlert:error];
|
||||
}
|
||||
|
||||
- (NSUInteger)widgetsCount
|
||||
- (NSUInteger)widgetsCount:(BOOL)includeUserWidgets
|
||||
{
|
||||
return [[WidgetManager sharedManager] widgetsNotOfTypes:@[kWidgetTypeJitsi]
|
||||
inRoom:self.roomDataSource.room].count;
|
||||
NSUInteger widgetsCount = [[WidgetManager sharedManager] widgetsNotOfTypes:@[kWidgetTypeJitsi]
|
||||
inRoom:self.roomDataSource.room].count;
|
||||
if (includeUserWidgets)
|
||||
{
|
||||
widgetsCount = [[WidgetManager sharedManager] userWidgets:self.roomDataSource.room.mxSession].count;
|
||||
}
|
||||
|
||||
return widgetsCount;
|
||||
}
|
||||
|
||||
#pragma mark - Unreachable Network Handling
|
||||
|
||||
Reference in New Issue
Block a user