consolidated downloads dir, nextcloud origin, upload route and chat timestamps; added webdav path tests
This commit is contained in:
@@ -304,9 +304,7 @@ class _ChatViewState extends State<ChatView> with RouteAware {
|
||||
for (final element in response.sortByTimestamp()) {
|
||||
if (ChatSearchController.isHiddenSystemMessage(element)) continue;
|
||||
|
||||
final elementDate = DateTime.fromMillisecondsSinceEpoch(
|
||||
element.timestamp * 1000,
|
||||
);
|
||||
final elementDate = element.sentAt;
|
||||
|
||||
if (!elementDate.isSameDay(lastDate)) {
|
||||
lastDate = elementDate;
|
||||
|
||||
@@ -106,7 +106,7 @@ class ChatMessage {
|
||||
errorListener: (value) {},
|
||||
httpHeaders: SessionManager().requireNextcloud().authHeaders,
|
||||
imageUrl:
|
||||
'https://${EndpointData().nextcloud().full()}/index.php/core/preview?fileId=${file.id}&x=130&y=-1&a=1',
|
||||
'${EndpointData().nextcloud().origin()}/index.php/core/preview?fileId=${file.id}&x=130&y=-1&a=1',
|
||||
),
|
||||
if (originalMessage != '{file}') ...[
|
||||
SizedBox(height: 5),
|
||||
|
||||
@@ -511,7 +511,7 @@ class _SharedItemTileState extends State<_SharedItemTile>
|
||||
}
|
||||
|
||||
String get _previewUrl =>
|
||||
'https://${EndpointData().nextcloud().full()}'
|
||||
'${EndpointData().nextcloud().origin()}'
|
||||
'/index.php/core/preview?fileId=${_file.id}&x=300&y=300&a=1';
|
||||
|
||||
bool get _isVideo => _isVideoFile(_file.name);
|
||||
@@ -586,7 +586,7 @@ class _SharedItemTileState extends State<_SharedItemTile>
|
||||
title: Text(_file.name, maxLines: 2, overflow: TextOverflow.ellipsis),
|
||||
subtitle: Text(
|
||||
'${widget.item.actorDisplayName} · '
|
||||
'${DateTime.fromMillisecondsSinceEpoch(widget.item.timestamp * 1000).formatDateShort()}',
|
||||
'${widget.item.sentAt.formatDateShort()}',
|
||||
),
|
||||
trailing: _isDownloading
|
||||
? SizedBox(
|
||||
|
||||
@@ -257,9 +257,7 @@ class _ChatBubbleState extends State<ChatBubble>
|
||||
: actorText;
|
||||
|
||||
final timeText = Text(
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
widget.bubbleData.timestamp * 1000,
|
||||
).formatHm(),
|
||||
widget.bubbleData.sentAt.formatHm(),
|
||||
textAlign: TextAlign.end,
|
||||
style: const TextStyle(color: _kTimeIconColor, fontSize: _kTimeIconSize),
|
||||
);
|
||||
|
||||
@@ -67,9 +67,7 @@ void showChatMessageOptionsDialog(
|
||||
final hasReactions = bubbleData.reactions?.isNotEmpty ?? false;
|
||||
final canDelete =
|
||||
isSender &&
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
bubbleData.timestamp * 1000,
|
||||
).add(const Duration(hours: 6)).isAfter(DateTime.now());
|
||||
bubbleData.sentAt.add(const Duration(hours: 6)).isAfter(DateTime.now());
|
||||
final attachedFile = _attachedFile(bubbleData);
|
||||
|
||||
showDetailsBottomSheet(
|
||||
|
||||
@@ -2,12 +2,12 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:persistent_bottom_nav_bar_v2/persistent_bottom_nav_bar_v2.dart';
|
||||
|
||||
import '../../../../api/marianumcloud/talk/room/get_room_response.dart';
|
||||
import '../../../../api/marianumcloud/talk/send_message/send_message.dart';
|
||||
import '../../../../api/marianumcloud/talk/send_message/send_message_params.dart';
|
||||
import '../../../../api/marianumcloud/talk/share_files_to_chat.dart';
|
||||
import '../../../../routing/app_routes.dart';
|
||||
import '../../../../state/app/modules/chat/bloc/chat_bloc.dart';
|
||||
import '../../../../state/app/modules/chat/bloc/chat_state.dart';
|
||||
import '../../../../state/app/modules/settings/bloc/settings_cubit.dart';
|
||||
@@ -18,7 +18,6 @@ import '../../../../widget/downloads/download_tray.dart';
|
||||
import '../../../../widget/emoji_picker_dialog.dart';
|
||||
import '../../../../widget/file_pick.dart';
|
||||
import '../../../../widget/focus_behaviour.dart';
|
||||
import '../../files/files_upload_dialog.dart';
|
||||
import 'answer_reference.dart';
|
||||
import 'poll_create_sheet.dart';
|
||||
|
||||
@@ -71,15 +70,12 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
|
||||
if (!mounted) return;
|
||||
unawaited(
|
||||
pushScreen(
|
||||
AppRoutes.openFilesUpload(
|
||||
context,
|
||||
withNavBar: false,
|
||||
screen: FilesUploadDialog(
|
||||
filePaths: paths,
|
||||
remotePath: talkShareFolder,
|
||||
onUploadFinished: share,
|
||||
uniqueNames: true,
|
||||
),
|
||||
filePaths: paths,
|
||||
remotePath: talkShareFolder,
|
||||
onUploadFinished: share,
|
||||
uniqueNames: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ class _ChatTileState extends State<ChatTile> {
|
||||
],
|
||||
),
|
||||
subtitle: Text(
|
||||
'${DateTime.fromMillisecondsSinceEpoch(widget.data.lastMessage.timestamp * 1000).formatRelative()}: '
|
||||
'${widget.data.lastMessage.sentAt.formatRelative()}: '
|
||||
'${_lastMessagePreview()}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user