Browse Source

Update nextcloud server and notifications to 26.0.1

pull/267/head
jld3103 2 years ago
parent
commit
c1fd468521
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      external/nextcloud-notifications
  2. 2
      external/nextcloud-server
  3. 62
      packages/neon/neon/lib/src/utils/push_utils.dart
  4. 2
      packages/neon/neon_notifications/lib/pages/main.dart
  5. 19
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  6. 13
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  7. 10
      packages/nextcloud/lib/src/nextcloud.openapi.json
  8. 6
      packages/nextcloud/test/core.dart
  9. 2
      specs/core.json
  10. 8
      specs/notifications.json
  11. 2
      specs/templates/appinfo_core.xml
  12. 2
      specs/templates/core.json
  13. 40
      specs/templates/notifications.json
  14. 2
      tool/Dockerfile.dev

2
external/nextcloud-notifications vendored

@ -1 +1 @@
Subproject commit a380eabe8b369a7103d1f529c82d6b44dce4f6a6 Subproject commit 69069071ff7a5775ddb06418f55f39593afdbbb1

2
external/nextcloud-server vendored

@ -1 +1 @@
Subproject commit 62cfd3b4c9ff4d8cdbbe6dcc8b63a1085bb94e3d Subproject commit 8cfcb8e2a2f9ba1bbe993161f00d7dcebf07708f

62
packages/neon/neon/lib/src/utils/push_utils.dart

@ -91,38 +91,40 @@ class PushUtils {
debugPrint(s.toString()); debugPrint(s.toString());
} }
final appID = notification?.app ?? pushNotification.subject.app ?? 'nextcloud'; if (notification?.shouldNotify ?? true) {
String? appName = localizations.appImplementationName(appID); final appID = notification?.app ?? pushNotification.subject.app ?? 'nextcloud';
if (appName == '') { String? appName = localizations.appImplementationName(appID);
debugPrint('Missing app name for $appID'); if (appName == '') {
appName = null; debugPrint('Missing app name for $appID');
} appName = null;
final title = (notification?.subject ?? pushNotification.subject.subject)!; }
final message = (notification?.message.isNotEmpty ?? false) ? notification!.message : null; final title = (notification?.subject ?? pushNotification.subject.subject)!;
final when = notification != null ? DateTime.parse(notification.datetime) : null; final message = (notification?.message.isNotEmpty ?? false) ? notification!.message : null;
final when = notification != null ? DateTime.parse(notification.datetime) : null;
await localNotificationsPlugin.show( await localNotificationsPlugin.show(
_getNotificationID(instance, pushNotification), _getNotificationID(instance, pushNotification),
message != null && appName != null ? '$appName: $title' : title, message != null && appName != null ? '$appName: $title' : title,
message, message,
NotificationDetails( NotificationDetails(
android: AndroidNotificationDetails( android: AndroidNotificationDetails(
appID, appID,
appName ?? appID, appName ?? appID,
subText: accounts.length > 1 && account != null ? account.client.humanReadableID : null, subText: accounts.length > 1 && account != null ? account.client.humanReadableID : null,
groupKey: 'app_$appID', groupKey: 'app_$appID',
icon: '@mipmap/ic_launcher', icon: '@mipmap/ic_launcher',
when: when?.millisecondsSinceEpoch, when: when?.millisecondsSinceEpoch,
color: themePrimaryColor, color: themePrimaryColor,
category: pushNotification.type == 'voip' ? AndroidNotificationCategory.call : null, category: pushNotification.type == 'voip' ? AndroidNotificationCategory.call : null,
importance: Importance.max, importance: Importance.max,
priority: pushNotification.priority == 'high' priority: pushNotification.priority == 'high'
? (pushNotification.type == 'voip' ? Priority.max : Priority.high) ? (pushNotification.type == 'voip' ? Priority.max : Priority.high)
: Priority.defaultPriority, : Priority.defaultPriority,
),
), ),
), payload: json.encode(pushNotification.toJson()),
payload: json.encode(pushNotification.toJson()), );
); }
} }
Global.onPushNotificationReceived?.call(instance); Global.onPushNotificationReceived?.call(instance);

2
packages/neon/neon_notifications/lib/pages/main.dart

@ -81,7 +81,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
width: 40, width: 40,
height: 40, height: 40,
child: NeonCachedUrlImage( child: NeonCachedUrlImage(
url: notification.icon, url: notification.icon!,
width: 40, width: 40,
height: 40, height: 40,
svgColor: Theme.of(context).colorScheme.primary, svgColor: Theme.of(context).colorScheme.primary,

19
packages/nextcloud/lib/src/nextcloud.openapi.dart

@ -4743,12 +4743,13 @@ class NextcloudNotificationsNotification {
required this.subject, required this.subject,
required this.message, required this.message,
required this.link, required this.link,
required this.subjectRich,
required this.subjectRichParameters,
required this.messageRich,
required this.messageRichParameters,
required this.icon,
required this.actions, required this.actions,
this.subjectRich,
this.subjectRichParameters,
this.messageRich,
this.messageRichParameters,
this.icon,
this.shouldNotify,
}); });
// coverage:ignore-start // coverage:ignore-start
@ -4782,15 +4783,17 @@ class NextcloudNotificationsNotification {
final String link; final String link;
final String subjectRich; final String? subjectRich;
final dynamic subjectRichParameters; final dynamic subjectRichParameters;
final String messageRich; final String? messageRich;
final dynamic messageRichParameters; final dynamic messageRichParameters;
final String icon; final String? icon;
final bool? shouldNotify;
final List<NextcloudNotificationsNotificationAction> actions; final List<NextcloudNotificationsNotificationAction> actions;

13
packages/nextcloud/lib/src/nextcloud.openapi.g.dart

@ -1541,6 +1541,7 @@ NextcloudNotificationsNotification _$NextcloudNotificationsNotificationFromJson(
'messageRich', 'messageRich',
'messageRichParameters', 'messageRichParameters',
'icon', 'icon',
'shouldNotify',
'actions' 'actions'
], ],
); );
@ -1554,14 +1555,15 @@ NextcloudNotificationsNotification _$NextcloudNotificationsNotificationFromJson(
subject: json['subject'] as String, subject: json['subject'] as String,
message: json['message'] as String, message: json['message'] as String,
link: json['link'] as String, link: json['link'] as String,
subjectRich: json['subjectRich'] as String,
subjectRichParameters: json['subjectRichParameters'],
messageRich: json['messageRich'] as String,
messageRichParameters: json['messageRichParameters'],
icon: json['icon'] as String,
actions: (json['actions'] as List<dynamic>) actions: (json['actions'] as List<dynamic>)
.map((e) => NextcloudNotificationsNotificationAction.fromJson(e as Map<String, dynamic>)) .map((e) => NextcloudNotificationsNotificationAction.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
subjectRich: json['subjectRich'] as String?,
subjectRichParameters: json['subjectRichParameters'],
messageRich: json['messageRich'] as String?,
messageRichParameters: json['messageRichParameters'],
icon: json['icon'] as String?,
shouldNotify: json['shouldNotify'] as bool?,
); );
} }
@ -1581,6 +1583,7 @@ Map<String, dynamic> _$NextcloudNotificationsNotificationToJson(NextcloudNotific
'messageRich': instance.messageRich, 'messageRich': instance.messageRich,
'messageRichParameters': instance.messageRichParameters, 'messageRichParameters': instance.messageRichParameters,
'icon': instance.icon, 'icon': instance.icon,
'shouldNotify': instance.shouldNotify,
'actions': instance.actions.map((e) => e.toJson()).toList(), 'actions': instance.actions.map((e) => e.toJson()).toList(),
}; };

10
packages/nextcloud/lib/src/nextcloud.openapi.json

@ -2,7 +2,7 @@
"openapi": "3.1.0", "openapi": "3.1.0",
"info": { "info": {
"title": "Nextcloud", "title": "Nextcloud",
"version": "26.0.0", "version": "26.0.1",
"description": "All supported Nextcloud APIs in one", "description": "All supported Nextcloud APIs in one",
"license": { "license": {
"name": "agpl", "name": "agpl",
@ -1274,11 +1274,6 @@
"subject", "subject",
"message", "message",
"link", "link",
"subjectRich",
"subjectRichParameters",
"messageRich",
"messageRichParameters",
"icon",
"actions" "actions"
], ],
"properties": { "properties": {
@ -1324,6 +1319,9 @@
"icon": { "icon": {
"type": "string" "type": "string"
}, },
"shouldNotify": {
"type": "boolean"
},
"actions": { "actions": {
"type": "array", "type": "array",
"items": { "items": {

6
packages/nextcloud/test/core.dart

@ -27,8 +27,8 @@ Future run(final DockerImage image) async {
expect(status.installed, true); expect(status.installed, true);
expect(status.maintenance, false); expect(status.maintenance, false);
expect(status.needsDbUpgrade, false); expect(status.needsDbUpgrade, false);
expect(status.version, startsWith('26.0.0')); expect(status.version, startsWith('26.0.1'));
expect(status.versionstring, '26.0.0'); expect(status.versionstring, '26.0.1');
expect(status.edition, ''); expect(status.edition, '');
expect(status.productname, 'Nextcloud'); expect(status.productname, 'Nextcloud');
expect(status.extendedSupport, false); expect(status.extendedSupport, false);
@ -37,7 +37,7 @@ Future run(final DockerImage image) async {
test('Get capabilities', () async { test('Get capabilities', () async {
final capabilities = await client.core.getCapabilities(); final capabilities = await client.core.getCapabilities();
expect(capabilities.ocs.data.version.major.toString(), '26'); expect(capabilities.ocs.data.version.major.toString(), '26');
expect(capabilities.ocs.data.version.string, '26.0.0'); expect(capabilities.ocs.data.version.string, '26.0.1');
expect(capabilities.ocs.data.capabilities.theming!.name, 'Nextcloud'); expect(capabilities.ocs.data.capabilities.theming!.name, 'Nextcloud');
expect(capabilities.ocs.data.capabilities.theming!.url, 'https://nextcloud.com'); expect(capabilities.ocs.data.capabilities.theming!.url, 'https://nextcloud.com');
expect(capabilities.ocs.data.capabilities.theming!.slogan, 'a safe home for all your data'); expect(capabilities.ocs.data.capabilities.theming!.slogan, 'a safe home for all your data');

2
specs/core.json

@ -2,7 +2,7 @@
"openapi": "3.1.0", "openapi": "3.1.0",
"info": { "info": {
"title": "Core", "title": "Core",
"version": "26.0.0", "version": "26.0.1",
"description": "Core functionality of Nextcloud", "description": "Core functionality of Nextcloud",
"license": { "license": {
"name": "agpl", "name": "agpl",

8
specs/notifications.json

@ -89,11 +89,6 @@
"subject", "subject",
"message", "message",
"link", "link",
"subjectRich",
"subjectRichParameters",
"messageRich",
"messageRichParameters",
"icon",
"actions" "actions"
], ],
"properties": { "properties": {
@ -139,6 +134,9 @@
"icon": { "icon": {
"type": "string" "type": "string"
}, },
"shouldNotify": {
"type": "boolean"
},
"actions": { "actions": {
"type": "array", "type": "array",
"items": { "items": {

2
specs/templates/appinfo_core.xml

@ -4,6 +4,6 @@
<name>Core</name> <name>Core</name>
<summary>Core functionality of Nextcloud</summary> <summary>Core functionality of Nextcloud</summary>
<description><![CDATA[Core functionality of Nextcloud]]></description> <description><![CDATA[Core functionality of Nextcloud]]></description>
<version>26.0.0</version> <version>26.0.1</version>
<licence>agpl</licence> <licence>agpl</licence>
</info> </info>

2
specs/templates/core.json

@ -2,7 +2,7 @@
"openapi": "3.1.0", "openapi": "3.1.0",
"info": { "info": {
"title": "Core", "title": "Core",
"version": "26.0.0", "version": "26.0.1",
"description": "Core functionality of Nextcloud", "description": "Core functionality of Nextcloud",
"license": { "license": {
"name": "agpl", "name": "agpl",

40
specs/templates/notifications.json

@ -114,6 +114,46 @@
} }
} }
}, },
"/ocs/v2.php/apps/notifications/api/{apiVersion}/notifications/exists": {
"parameters": [
{
"name": "apiVersion",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"post": {
"operationId": "endpoint-confirmidsforuser-TODO",
"tags": [
"notifications"
],
"parameters": [
{
"name": "ids",
"in": "query",
"required": true,
"schema": {
"type": "array"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/ocs/v2.php/apps/notifications/api/{apiVersion}/push": { "/ocs/v2.php/apps/notifications/api/{apiVersion}/push": {
"parameters": [ "parameters": [
{ {

2
tool/Dockerfile.dev

@ -1,4 +1,4 @@
FROM nextcloud:26.0.0 FROM nextcloud:26.0.1
WORKDIR /usr/src/nextcloud WORKDIR /usr/src/nextcloud
RUN chown -R www-data:www-data . RUN chown -R www-data:www-data .
USER www-data USER www-data

Loading…
Cancel
Save