consolidated downloads dir, nextcloud origin, upload route and chat timestamps; added webdav path tests

This commit is contained in:
2026-09-27 21:19:50 +02:00
parent aca86c506a
commit c455bb1cae
40 changed files with 464 additions and 282 deletions
@@ -13,12 +13,12 @@ import '../app_progress_indicator.dart';
/// trigger its `errorWidget`. Prefers `fileId` because the path variant
/// is unreliable on some server configurations.
String _ncPreviewUrl(RemoteFileRef remote, {int width = 1024}) {
final host = EndpointData().nextcloud().full();
final origin = EndpointData().nextcloud().origin();
final id = remote.fileId;
final selector = id != null
? 'fileId=$id'
: 'file=${Uri.encodeQueryComponent(remote.path)}';
return 'https://$host/index.php/core/preview?$selector&x=$width&y=-1&a=1';
return '$origin/index.php/core/preview?$selector&x=$width&y=-1&a=1';
}
/// Header block for the "Vorschau nicht verfügbar" screen.
+3 -3
View File
@@ -78,14 +78,14 @@ final ValueNotifier<int> _avatarCacheGeneration = ValueNotifier<int>(0);
String avatarUrl({required String id, required bool isGroup, int size = 512}) {
if (isGroup) {
final host = EndpointData().nextcloud().full();
return 'https://$host/ocs/v2.php/apps/spreed/api/v1/room/$id/avatar';
final origin = EndpointData().nextcloud().origin();
return '$origin/ocs/v2.php/apps/spreed/api/v1/room/$id/avatar';
}
return '${_userAvatarUrlPrefix(id)}$size';
}
String _userAvatarUrlPrefix(String id) =>
'https://${EndpointData().nextcloud().full()}/avatar/$id/';
'${EndpointData().nextcloud().origin()}/avatar/$id/';
/// Resolves an avatar through the shared caches: in-memory first, then disk,
/// then the network — the fetch being deduped across every concurrent caller