feat: Enable direct chat initiation from agent network, improve GIF rendering in chat, and fix message order and webview authentication.
This commit is contained in:
@@ -49,6 +49,24 @@ class MessagingRepository {
|
||||
}
|
||||
}
|
||||
|
||||
/// POST /messages/conversations (agent → user)
|
||||
Future<Conversation> startConversationWithUser(String userId) async {
|
||||
try {
|
||||
final response = await _dio.post(
|
||||
ApiConstants.conversations,
|
||||
data: {'userId': userId},
|
||||
);
|
||||
return Conversation.fromJson(
|
||||
response.data['data'] as Map<String, dynamic>);
|
||||
} on DioException catch (e) {
|
||||
if (e.error is ApiException) throw e.error as ApiException;
|
||||
throw ApiException(
|
||||
message: e.message ?? 'Failed to start conversation',
|
||||
statusCode: e.response?.statusCode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// GET /messages/conversations/:id
|
||||
Future<Conversation> getConversation(String id) async {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user