Files
Client/lib/share_intent/remote_file_ref.dart
T

21 lines
847 B
Dart

import '../api/marianumcloud/talk/chat/get_chat_response.dart';
import '../api/marianumcloud/webdav/queries/list_files/cacheable_file.dart';
/// References a file that already lives on the Nextcloud server. Used by the
/// in-app share/save flows that operate on remote paths instead of local
/// cache files (no upload needed).
class RemoteFileRef {
final String path;
final String name;
const RemoteFileRef({required this.path, required this.name});
/// Caller must verify `file.path != null` first — Talk message parameters
/// without a path (system events, mentions, polls) are not file refs.
factory RemoteFileRef.fromTalk(RichObjectString file) =>
RemoteFileRef(path: file.path!, name: file.name);
factory RemoteFileRef.fromCacheable(CacheableFile file) =>
RemoteFileRef(path: file.path, name: file.name);
}