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(
contactId,
);
if (openReceipts > 2) {
if (openReceipts > 6) {
// this prevents that these types of messages are send in case the receiver is offline
return null;
}

View file

@ -1,5 +1,3 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.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/utils/misc.dart';
class FeedbackIconButtonComp extends StatefulWidget {
class FeedbackIconButtonComp extends StatelessWidget {
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
Widget build(BuildContext context) {
if (!showFeedbackShortcut) {
return StreamBuilder(
stream: userService.onUserUpdated,
builder: (context, asyncSnapshot) {
if (!userService.currentUser.showFeedbackShortcut) {
return const SizedBox.shrink();
}
return IconButton(
onPressed: () => context.push(Routes.settingsHelpContactUs),
color: Colors.grey,
tooltip: context.lang.feedbackTooltip,
icon: const FaIcon(FontAwesomeIcons.commentDots, size: 19),
);
},
);
}
}

View file

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

View file

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

View file

@ -546,8 +546,7 @@ class _MediaViewerViewState extends State<MediaViewerView> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Stack(
body: Stack(
fit: StackFit.expand,
children: [
if (_showDownloadingLoader) _loader(),
@ -736,8 +735,7 @@ class _MediaViewerViewState extends State<MediaViewerView> {
),
),
),
if (currentMessage != null)
AdditionalMessageContent(currentMessage!),
if (currentMessage != null) AdditionalMessageContent(currentMessage!),
if (currentMedia != null)
ReactionButtons(
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)
.await?
.into_iter()
.filter(|x| x.is_empty()) // filter ignored versions
.filter(|x| !x.is_empty()) // filter ignored versions
.collect();
messages.extend_from_slice(&promoting_messages);
}