Skip to content

Commit

Permalink
Support attachments on recieved messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilaair committed Oct 17, 2021
1 parent 983b6b4 commit 95252be
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/utils/socket/joinConversation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<dynamic>)
.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<dynamic>)
.map((attachment) {
return attachment["id"] as String;
}).toList()
: null,
user: (event.payload!["user"] != null)
? User(
email: event.payload!["user"]["email"],
Expand Down

0 comments on commit 95252be

Please sign in to comment.