smaller improvements

This commit is contained in:
otsmr 2026-04-26 02:38:01 +02:00
parent dcca2cbec0
commit ce60f4e2f1
6 changed files with 221 additions and 242 deletions

View file

@ -341,7 +341,7 @@ Future<(Uint8List, Uint8List?)?> sendCipherText(
final openReceipts = await twonlyDB.receiptsDao.getReceiptCountForContact( final openReceipts = await twonlyDB.receiptsDao.getReceiptCountForContact(
contactId, contactId,
); );
if (openReceipts > 2) { if (openReceipts > 6) {
// this prevents that these types of messages are send in case the receiver is offline // this prevents that these types of messages are send in case the receiver is offline
return null; return null;
} }

View file

@ -1,5 +1,3 @@
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@ -7,40 +5,24 @@ import 'package:twonly/locator.dart';
import 'package:twonly/src/constants/routes.keys.dart'; import 'package:twonly/src/constants/routes.keys.dart';
import 'package:twonly/src/utils/misc.dart'; import 'package:twonly/src/utils/misc.dart';
class FeedbackIconButtonComp extends StatefulWidget { class FeedbackIconButtonComp extends StatelessWidget {
const FeedbackIconButtonComp({super.key}); const FeedbackIconButtonComp({super.key});
@override
State<FeedbackIconButtonComp> createState() => _FeedbackIconButtonCompState();
}
class _FeedbackIconButtonCompState extends State<FeedbackIconButtonComp> {
bool showFeedbackShortcut = false;
@override
void initState() {
super.initState();
unawaited(initAsync());
}
Future<void> initAsync() async {
if (!mounted) return;
setState(() {
showFeedbackShortcut = userService.currentUser.showFeedbackShortcut;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (!showFeedbackShortcut) { return StreamBuilder(
stream: userService.onUserUpdated,
builder: (context, asyncSnapshot) {
if (!userService.currentUser.showFeedbackShortcut) {
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
return IconButton( return IconButton(
onPressed: () => context.push(Routes.settingsHelpContactUs), onPressed: () => context.push(Routes.settingsHelpContactUs),
color: Colors.grey, color: Colors.grey,
tooltip: context.lang.feedbackTooltip, tooltip: context.lang.feedbackTooltip,
icon: const FaIcon(FontAwesomeIcons.commentDots, size: 19), icon: const FaIcon(FontAwesomeIcons.commentDots, size: 19),
); );
},
);
} }
} }

View file

@ -125,7 +125,7 @@ class _ChatMessagesViewState extends State<ChatMessagesView> {
if (userService.currentUser.typingIndicators) { if (userService.currentUser.typingIndicators) {
unawaited(sendTypingIndication(widget.groupId, false)); unawaited(sendTypingIndication(widget.groupId, false));
_nextTypingIndicator = Timer.periodic(const Duration(seconds: 4), ( _nextTypingIndicator = Timer.periodic(const Duration(seconds: 2), (
_, _,
) async { ) async {
await sendTypingIndication(widget.groupId, false); await sendTypingIndication(widget.groupId, false);

View file

@ -28,7 +28,7 @@ bool hasChatOpen(GroupMember member) {
member.lastChatOpened!, member.lastChatOpened!,
) )
.inSeconds <= .inSeconds <=
6; 3;
} }
class TypingIndicator extends StatefulWidget { class TypingIndicator extends StatefulWidget {

View file

@ -546,8 +546,7 @@ class _MediaViewerViewState extends State<MediaViewerView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: SafeArea( body: Stack(
child: Stack(
fit: StackFit.expand, fit: StackFit.expand,
children: [ children: [
if (_showDownloadingLoader) _loader(), if (_showDownloadingLoader) _loader(),
@ -736,8 +735,7 @@ class _MediaViewerViewState extends State<MediaViewerView> {
), ),
), ),
), ),
if (currentMessage != null) if (currentMessage != null) AdditionalMessageContent(currentMessage!),
AdditionalMessageContent(currentMessage!),
if (currentMedia != null) if (currentMedia != null)
ReactionButtons( ReactionButtons(
show: showShortReactions, show: showShortReactions,
@ -758,7 +756,6 @@ class _MediaViewerViewState extends State<MediaViewerView> {
), ),
], ],
), ),
),
); );
} }
} }

View file

@ -221,7 +221,7 @@ impl<Store: UserDiscoveryStore, Utils: UserDiscoveryUtils> UserDiscovery<Store,
.get_own_promotions_after_version(received_version.promotion) .get_own_promotions_after_version(received_version.promotion)
.await? .await?
.into_iter() .into_iter()
.filter(|x| x.is_empty()) // filter ignored versions .filter(|x| !x.is_empty()) // filter ignored versions
.collect(); .collect();
messages.extend_from_slice(&promoting_messages); messages.extend_from_slice(&promoting_messages);
} }