fix(ui): Fix hardcoded ConversationTypes

This commit is contained in:
2023-09-24 15:36:53 +02:00
parent d3d5a62187
commit 79bebe9270
8 changed files with 2 additions and 18 deletions

View File

@@ -63,7 +63,7 @@ class ConversationBloc extends Bloc<ConversationEvent, ConversationState> {
final arguments = ConversationPageArguments(
event.jid,
event.initialText,
event.type,
conversation.type,
);
final navEvent = event.removeUntilConversations
? (PushedNamedAndRemoveUntilEvent(

View File

@@ -20,8 +20,7 @@ class RequestedConversationEvent extends ConversationEvent {
RequestedConversationEvent(
this.jid,
this.title,
this.avatarUrl,
this.type, {
this.avatarUrl, {
this.removeUntilConversations = false,
this.initialText,
});
@@ -34,9 +33,6 @@ class RequestedConversationEvent extends ConversationEvent {
/// Initial value to put in the input field.
final String? initialText;
/// Type of the conversation
final ConversationType type;
}
/// Triggered by the UI when a user should be blocked

View File

@@ -6,7 +6,6 @@ import 'package:moxxyv2/i18n/strings.g.dart';
import 'package:moxxyv2/shared/commands.dart';
import 'package:moxxyv2/shared/error_types.dart';
import 'package:moxxyv2/shared/events.dart';
import 'package:moxxyv2/shared/models/conversation.dart';
import 'package:moxxyv2/ui/bloc/conversation_bloc.dart';
import 'package:moxxyv2/ui/bloc/conversations_bloc.dart';
@@ -95,7 +94,6 @@ class JoinGroupchatBloc extends Bloc<JoinGroupchatEvent, JoinGroupchatState> {
joinEvent.conversation.jid,
joinEvent.conversation.title,
joinEvent.conversation.avatarPath,
ConversationType.groupchat,
),
);
}

View File

@@ -52,7 +52,6 @@ class NewConversationBloc
event.jid,
event.title,
event.avatarUrl,
event.type,
removeUntilConversations: true,
),
);
@@ -82,7 +81,6 @@ class NewConversationBloc
event.jid,
event.title,
event.avatarUrl,
event.type,
removeUntilConversations: true,
),
);

View File

@@ -107,7 +107,6 @@ class StartChatBloc extends Bloc<StartChatEvent, StartChatState> {
addResult.conversation!.jid,
addResult.conversation!.title,
addResult.conversation!.avatarPath,
addResult.conversation!.type,
removeUntilConversations: true,
),
);

View File

@@ -7,7 +7,6 @@ import 'package:moxxy_native/moxxy_native.dart';
import 'package:moxxyv2/shared/commands.dart';
import 'package:moxxyv2/shared/eventhandler.dart';
import 'package:moxxyv2/shared/events.dart';
import 'package:moxxyv2/shared/models/conversation.dart';
import 'package:moxxyv2/shared/synchronized_queue.dart';
import 'package:moxxyv2/ui/bloc/blocklist_bloc.dart' as blocklist;
import 'package:moxxyv2/ui/bloc/conversation_bloc.dart' as conversation;
@@ -171,8 +170,6 @@ Future<void> onNotificationTappend(
event.conversationJid,
event.title,
event.avatarPath,
// TODO: Pull this from somewhere
ConversationType.chat,
),
);
}

View File

@@ -162,7 +162,6 @@ class ConversationsPageState extends State<ConversationsPage>
item.jid,
item.title,
item.avatarPath,
item.type,
),
);
},

View File

@@ -1,7 +1,6 @@
import 'package:get_it/get_it.dart';
import 'package:logging/logging.dart';
import 'package:moxxyv2/shared/constants.dart';
import 'package:moxxyv2/shared/models/conversation.dart';
import 'package:moxxyv2/ui/bloc/conversation_bloc.dart';
import 'package:moxxyv2/ui/bloc/sendfiles_bloc.dart';
import 'package:moxxyv2/ui/bloc/share_selection_bloc.dart';
@@ -44,8 +43,6 @@ class UISharingService {
conversationJid!,
'',
null,
// TODO: Pull this from somewhere
ConversationType.chat,
removeUntilConversations: true,
initialText: media.content,
),