feat(communication): module messagerie unifié + contact policies + blocages
Aligné avec le backend MessagingResource : - Nouveau module communication (conversations, messages, participants) - Respect des ContactPolicy (qui peut parler à qui par rôle) - Gestion MemberBlock (blocages individuels) - UI : conversations list, conversation detail, broadcast, tiles - BLoC : MessagingBloc avec events (envoyer, démarrer conversation rôle, etc.)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
/// États du BLoC Messaging
|
||||
/// États du BLoC Messagerie v4
|
||||
library messaging_state;
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
import '../../domain/entities/conversation.dart';
|
||||
import '../../domain/entities/message.dart';
|
||||
|
||||
@@ -18,18 +19,24 @@ class MessagingInitial extends MessagingState {}
|
||||
/// Chargement en cours
|
||||
class MessagingLoading extends MessagingState {}
|
||||
|
||||
/// Conversations chargées
|
||||
class ConversationsLoaded extends MessagingState {
|
||||
final List<Conversation> conversations;
|
||||
final int unreadCount;
|
||||
/// Liste des conversations chargée
|
||||
class MesConversationsLoaded extends MessagingState {
|
||||
final List<ConversationSummary> conversations;
|
||||
|
||||
const ConversationsLoaded({
|
||||
required this.conversations,
|
||||
this.unreadCount = 0,
|
||||
});
|
||||
const MesConversationsLoaded(this.conversations);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [conversations, unreadCount];
|
||||
List<Object?> get props => [conversations];
|
||||
}
|
||||
|
||||
/// Conversation ouverte (détail avec messages)
|
||||
class ConversationOuverte extends MessagingState {
|
||||
final Conversation conversation;
|
||||
|
||||
const ConversationOuverte(this.conversation);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [conversation];
|
||||
}
|
||||
|
||||
/// Messages d'une conversation chargés
|
||||
@@ -48,44 +55,35 @@ class MessagesLoaded extends MessagingState {
|
||||
List<Object?> get props => [conversationId, messages, hasMore];
|
||||
}
|
||||
|
||||
/// Message envoyé avec succès
|
||||
class MessageSent extends MessagingState {
|
||||
/// Message envoyé avec succès — la conversation s'actualise
|
||||
class MessageEnvoye extends MessagingState {
|
||||
final Message message;
|
||||
final String conversationId;
|
||||
|
||||
const MessageSent(this.message);
|
||||
const MessageEnvoye({required this.message, required this.conversationId});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [message];
|
||||
List<Object?> get props => [message, conversationId];
|
||||
}
|
||||
|
||||
/// Broadcast envoyé avec succès
|
||||
class BroadcastSent extends MessagingState {
|
||||
final Message message;
|
||||
|
||||
const BroadcastSent(this.message);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [message];
|
||||
}
|
||||
|
||||
/// Conversation créée
|
||||
class ConversationCreated extends MessagingState {
|
||||
/// Conversation créée (après démarrage direct/rôle)
|
||||
class ConversationCreee extends MessagingState {
|
||||
final Conversation conversation;
|
||||
|
||||
const ConversationCreated(this.conversation);
|
||||
const ConversationCreee(this.conversation);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [conversation];
|
||||
}
|
||||
|
||||
/// Compteur de non lus chargé
|
||||
class UnreadCountLoaded extends MessagingState {
|
||||
final int count;
|
||||
/// Action silencieuse réussie (marquer lu, supprimer message, etc.)
|
||||
class MessagingActionOk extends MessagingState {
|
||||
final String action;
|
||||
|
||||
const UnreadCountLoaded(this.count);
|
||||
const MessagingActionOk(this.action);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [count];
|
||||
List<Object?> get props => [action];
|
||||
}
|
||||
|
||||
/// Erreur
|
||||
|
||||
Reference in New Issue
Block a user