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:
pradeepkumar
2026-03-15 01:04:36 +05:30
parent 84e9cd9680
commit f659be07ae
5 changed files with 146 additions and 48 deletions

View File

@@ -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 {