mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 12:28:40 +00:00
fix #306
This commit is contained in:
parent
7977d171c7
commit
fc2513ddba
1 changed files with 13 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:lottie/lottie.dart';
|
import 'package:lottie/lottie.dart';
|
||||||
import 'package:no_screenshot/no_screenshot.dart';
|
import 'package:no_screenshot/no_screenshot.dart';
|
||||||
import 'package:twonly/globals.dart';
|
import 'package:twonly/globals.dart';
|
||||||
|
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||||
import 'package:twonly/src/database/tables/mediafiles.table.dart'
|
import 'package:twonly/src/database/tables/mediafiles.table.dart'
|
||||||
show DownloadState, MediaType;
|
show DownloadState, MediaType;
|
||||||
import 'package:twonly/src/database/twonly.db.dart';
|
import 'package:twonly/src/database/twonly.db.dart';
|
||||||
|
|
@ -56,6 +57,7 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
||||||
bool imageSaved = false;
|
bool imageSaved = false;
|
||||||
bool imageSaving = false;
|
bool imageSaving = false;
|
||||||
bool displayTwonlyPresent = false;
|
bool displayTwonlyPresent = false;
|
||||||
|
late String _currentMediaSender;
|
||||||
final emojiKey = GlobalKey<EmojiFloatWidgetState>();
|
final emojiKey = GlobalKey<EmojiFloatWidgetState>();
|
||||||
|
|
||||||
StreamSubscription<MediaFile?>? downloadStateListener;
|
StreamSubscription<MediaFile?>? downloadStateListener;
|
||||||
|
|
@ -69,6 +71,7 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
_currentMediaSender = widget.group.groupName;
|
||||||
|
|
||||||
if (widget.initialMessage != null) {
|
if (widget.initialMessage != null) {
|
||||||
allMediaFiles = [widget.initialMessage!];
|
allMediaFiles = [widget.initialMessage!];
|
||||||
|
|
@ -237,6 +240,15 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
||||||
displayTwonlyPresent = false;
|
displayTwonlyPresent = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!widget.group.isDirectChat) {
|
||||||
|
final sender =
|
||||||
|
await twonlyDB.contactsDao.getContactById(currentMessage!.senderId!);
|
||||||
|
if (sender != null) {
|
||||||
|
_currentMediaSender =
|
||||||
|
'${getContactDisplayName(sender)} (${widget.group.groupName})';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await notifyContactAboutOpeningMessage(
|
await notifyContactAboutOpeningMessage(
|
||||||
currentMessage!.senderId!,
|
currentMessage!.senderId!,
|
||||||
[currentMessage!.messageId],
|
[currentMessage!.messageId],
|
||||||
|
|
@ -585,7 +597,7 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
||||||
left: showSendTextMessageInput ? 0 : null,
|
left: showSendTextMessageInput ? 0 : null,
|
||||||
right: showSendTextMessageInput ? 0 : 15,
|
right: showSendTextMessageInput ? 0 : 15,
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.group.groupName,
|
_currentMediaSender,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: showSendTextMessageInput ? 24 : 14,
|
fontSize: showSendTextMessageInput ? 24 : 14,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue