Compare commits

...

3 Commits

6 changed files with 45 additions and 10 deletions

View File

@ -41,6 +41,7 @@ class OmemoService {
final db = GetIt.I.get<DatabaseService>();
var device = await db.loadOmemoDevice(jid);
var commitTrustManager = false;
if (device == null) {
_log.info('No OMEMO marker found. Generating OMEMO identity...');
// Generate the identity in the background
@ -48,7 +49,8 @@ class OmemoService {
await commitDevice(device!);
await commitDeviceMap(<String, List<int>>{});
await commitTrustManager(await omemoManager.trustManager.toJson());
commitTrustManager = true;
} else {
_log.info('OMEMO marker found. Restoring OMEMO state...');
final ratchetMap = <RatchetMapKey, OmemoDoubleRatchet>{};
@ -73,6 +75,10 @@ class OmemoService {
ratchetMap,
await db.loadOmemoDeviceList(),
);
if (commitTrustManager) {
await commitTrustManager(await omemoManager.trustManager.toJson());
}
}
omemoManager.eventStream.listen((event) async {

View File

@ -24,6 +24,8 @@ const Color bubbleColorReceivedQuoted = bubbleColorReceived;
const Color bubbleColorUnencrypted = Color(0xffd40000);
const Color bubbleColorNewDevice = Color(0xffeee8d5);
const Color bubbleTextColor = Color(0xffffffff);
const Color settingsSectionTitleColor = Color(0xffb72fe7);
const double paddingVeryLarge = 64;

View File

@ -55,7 +55,7 @@ class SettingsAboutPage extends StatelessWidget {
child: Text(
// TODO(Unknown): Generate this at build time
t.pages.settings.about.version(
version: '0.3.0',
version: '0.4.0',
),
textAlign: TextAlign.center,
style: const TextStyle(

View File

@ -9,10 +9,10 @@ import 'package:moxxyv2/ui/widgets/chat/media/sticker.dart';
import 'package:moxxyv2/ui/widgets/chat/media/video.dart';
import 'package:moxxyv2/ui/widgets/chat/playbutton.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/audio.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/base.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/file.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/image.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/sticker.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/text.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/video.dart';
import 'package:moxxyv2/ui/widgets/chat/shared/audio.dart';
import 'package:moxxyv2/ui/widgets/chat/shared/file.dart';
@ -96,12 +96,7 @@ Widget buildQuoteMessageWidget(Message message, bool sent, { void Function()? re
case MessageType.sticker:
return QuotedStickerWidget(message, sent, resetQuote: resetQuote);
case MessageType.text:
return QuoteBaseWidget(
message,
Text(message.body),
sent,
resetQuotedMessage: resetQuote,
);
return QuotedTextWidget(message, sent, resetQuote: resetQuote);
case MessageType.image:
return QuotedImageWidget(message, sent, resetQuote: resetQuote);
case MessageType.video:

View File

@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
import 'package:moxxyv2/shared/models/message.dart';
import 'package:moxxyv2/ui/constants.dart';
import 'package:moxxyv2/ui/widgets/chat/quote/base.dart';
class QuotedTextWidget extends StatelessWidget {
const QuotedTextWidget(
this.message,
this.sent, {
this.resetQuote,
super.key,
}
);
final Message message;
final bool sent;
final void Function()? resetQuote;
@override
Widget build(BuildContext context) {
return QuoteBaseWidget(
message,
Text(
message.body,
style: const TextStyle(
color: bubbleTextColor,
),
),
sent,
resetQuotedMessage: resetQuote,
);
}
}

View File

@ -56,7 +56,7 @@ class TextChatWidget extends StatelessWidget {
child: ParsedText(
text: getMessageText(),
style: TextStyle(
color: const Color(0xffffffff),
color: bubbleTextColor,
fontSize: fontsize,
),
parse: [