implemented dual Nextcloud push registration with separate general and talk apptypes to ensure reliable Talk notification delivery; introduced stacked MessagingStyle notifications for chat threads with support for circular conversation avatars and disk caching
This commit is contained in:
@@ -2,19 +2,24 @@ import 'package:http/http.dart' as http;
|
||||
|
||||
import '../nextcloud_ocs.dart';
|
||||
|
||||
/// Revokes the current app password server-side via
|
||||
/// `DELETE /ocs/v2.php/core/apppassword`. Best-effort: the shared OCS headers
|
||||
/// authenticate with the app password itself (it revokes the credential it was
|
||||
/// made with) and the result is ignored — logout clears local state regardless.
|
||||
/// Revokes an app password server-side via
|
||||
/// `DELETE /ocs/v2.php/core/apppassword`. The endpoint revokes the credential
|
||||
/// the request authenticates WITH — by default the shared OCS headers (general
|
||||
/// app password); pass [authorizationHeader] to revoke another one (the Talk
|
||||
/// app password). Best-effort: the result is ignored — logout clears local
|
||||
/// state regardless.
|
||||
class DeleteAppPassword {
|
||||
final http.Client _client;
|
||||
|
||||
DeleteAppPassword({http.Client? client}) : _client = client ?? http.Client();
|
||||
|
||||
Future<void> run() async {
|
||||
Future<void> run({String? authorizationHeader}) async {
|
||||
await _client.delete(
|
||||
NextcloudOcs.uri('core/apppassword'),
|
||||
headers: NextcloudOcs.headers(),
|
||||
headers: {
|
||||
...NextcloudOcs.headers(),
|
||||
'Authorization': ?authorizationHeader,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class PushDeviceRegister {
|
||||
required String userPublicKey,
|
||||
required String pushToken,
|
||||
required String platform,
|
||||
required String registrationType,
|
||||
String? appVersion,
|
||||
}) async {
|
||||
try {
|
||||
@@ -30,6 +31,9 @@ class PushDeviceRegister {
|
||||
'userPublicKey': userPublicKey,
|
||||
'pushToken': pushToken,
|
||||
'platform': platform,
|
||||
// 'general' | 'talk' — the backend derives the NC hash comparison
|
||||
// value from it (general = sha512(token), talk = sha512(token+'#talk')).
|
||||
'registrationType': registrationType,
|
||||
'appVersion': ?appVersion,
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user