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( final arguments = ConversationPageArguments(
event.jid, event.jid,
event.initialText, event.initialText,
event.type, conversation.type,
); );
final navEvent = event.removeUntilConversations final navEvent = event.removeUntilConversations
? (PushedNamedAndRemoveUntilEvent( ? (PushedNamedAndRemoveUntilEvent(

View File

@@ -20,8 +20,7 @@ class RequestedConversationEvent extends ConversationEvent {
RequestedConversationEvent( RequestedConversationEvent(
this.jid, this.jid,
this.title, this.title,
this.avatarUrl, this.avatarUrl, {
this.type, {
this.removeUntilConversations = false, this.removeUntilConversations = false,
this.initialText, this.initialText,
}); });
@@ -34,9 +33,6 @@ class RequestedConversationEvent extends ConversationEvent {
/// Initial value to put in the input field. /// Initial value to put in the input field.
final String? initialText; final String? initialText;
/// Type of the conversation
final ConversationType type;
} }
/// Triggered by the UI when a user should be blocked /// 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/commands.dart';
import 'package:moxxyv2/shared/error_types.dart'; import 'package:moxxyv2/shared/error_types.dart';
import 'package:moxxyv2/shared/events.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/conversation_bloc.dart';
import 'package:moxxyv2/ui/bloc/conversations_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.jid,
joinEvent.conversation.title, joinEvent.conversation.title,
joinEvent.conversation.avatarPath, joinEvent.conversation.avatarPath,
ConversationType.groupchat,
), ),
); );
} }

View File

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

View File

@@ -107,7 +107,6 @@ class StartChatBloc extends Bloc<StartChatEvent, StartChatState> {
addResult.conversation!.jid, addResult.conversation!.jid,
addResult.conversation!.title, addResult.conversation!.title,
addResult.conversation!.avatarPath, addResult.conversation!.avatarPath,
addResult.conversation!.type,
removeUntilConversations: true, 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/commands.dart';
import 'package:moxxyv2/shared/eventhandler.dart'; import 'package:moxxyv2/shared/eventhandler.dart';
import 'package:moxxyv2/shared/events.dart'; import 'package:moxxyv2/shared/events.dart';
import 'package:moxxyv2/shared/models/conversation.dart';
import 'package:moxxyv2/shared/synchronized_queue.dart'; import 'package:moxxyv2/shared/synchronized_queue.dart';
import 'package:moxxyv2/ui/bloc/blocklist_bloc.dart' as blocklist; import 'package:moxxyv2/ui/bloc/blocklist_bloc.dart' as blocklist;
import 'package:moxxyv2/ui/bloc/conversation_bloc.dart' as conversation; import 'package:moxxyv2/ui/bloc/conversation_bloc.dart' as conversation;
@@ -171,8 +170,6 @@ Future<void> onNotificationTappend(
event.conversationJid, event.conversationJid,
event.title, event.title,
event.avatarPath, event.avatarPath,
// TODO: Pull this from somewhere
ConversationType.chat,
), ),
); );
} }

View File

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

View File

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