diff --git a/lib/utils/socket/joinConversation.dart b/lib/utils/socket/joinConversation.dart index c404599..6cac98a 100644 --- a/lib/utils/socket/joinConversation.dart +++ b/lib/utils/socket/joinConversation.dart @@ -42,6 +42,23 @@ PhoenixChannel? joinConversationAndListen({ conversationId: event.payload!["conversation_id"], customerId: event.payload!["customer_id"], id: event.payload!["id"], + attachments: (event.payload!["attachments"] != null) + ? (event.payload!["attachments"] as List) + .map((attachment) { + return PapercupsAttachment( + contentType: attachment["content_type"], + fileName: attachment["filename"], + fileUrl: attachment["file_url"], + id: attachment["id"], + ); + }).toList() + : null, + fileIds: (event.payload!["attachments"] != null) + ? (event.payload!["attachments"] as List) + .map((attachment) { + return attachment["id"] as String; + }).toList() + : null, user: (event.payload!["user"] != null) ? User( email: event.payload!["user"]["email"],