Skip to content

Commit 13c1e7c

Browse files
committed
Merge remote-tracking branch 'origin/feature/qms-images' into develop
2 parents f1fdff8 + d23a3bc commit 13c1e7c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Modules/Sources/ParsingClient/Parsers/QMSParser.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,19 @@ public struct QMSChatParser {
5151

5252
private static func parseAttachments(_ array: [[Any]]) -> [QMSMessage.Attachment] {
5353
return array.map { attachment in
54+
let type = attachment[1] as! Int
55+
let downloadCount = if type == 1 {
56+
1 // FIXME: Quickfix for images. In normal situation they should handling by another way.
57+
} else {
58+
attachment[4] as! Int
59+
}
60+
5461
return QMSMessage.Attachment(
5562
id: attachment[0] as! Int,
5663
flag: attachment[1] as! Int,
5764
name: attachment[2] as! String,
5865
size: attachment[3] as! Int,
59-
downloadsCount: attachment[4] as! Int
66+
downloadsCount: downloadCount
6067
)
6168
}
6269
}

0 commit comments

Comments
 (0)