mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Fix release 5.2
This commit is contained in:
parent
422f84e92d
commit
2db146787e
3 changed files with 48 additions and 71 deletions
|
|
@ -610,9 +610,9 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
var viewer: MediaViewer = VIEW(MediaViewer.compositeViewDescription())
|
||||
|
||||
var image = UIImage()
|
||||
if chatMessage.contents.first!.type == "image" {
|
||||
if chatMessage.contents.filter({$0.isFile}).first!.type == "image" {
|
||||
if VFSUtil.vfsEnabled(groupName: kLinphoneMsgNotificationAppGroupId) {
|
||||
var plainFile = chatMessage.contents.first!.exportPlainFile()
|
||||
var plainFile = chatMessage.contents.filter({$0.isFile}).first!.exportPlainFile()
|
||||
|
||||
image = UIImage(contentsOfFile: plainFile)!
|
||||
|
||||
|
|
@ -620,15 +620,15 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
plainFile = ""
|
||||
|
||||
}else {
|
||||
image = UIImage(contentsOfFile: chatMessage.contents.first!.filePath!)!
|
||||
image = UIImage(contentsOfFile: chatMessage.contents.filter({$0.isFile}).first!.filePath!)!
|
||||
}
|
||||
}
|
||||
|
||||
viewer.imageViewer = image
|
||||
viewer.imageNameViewer = (chatMessage.contents.first!.name!.isEmpty ? "" : chatMessage.contents.first!.name)!
|
||||
viewer.imageNameViewer = (chatMessage.contents.filter({$0.isFile}).first!.name!.isEmpty ? "" : chatMessage.contents.filter({$0.isFile}).first!.name)!
|
||||
|
||||
viewer.imagePathViewer = chatMessage.contents.first!.exportPlainFile()
|
||||
viewer.contentType = chatMessage.contents.first!.type
|
||||
viewer.imagePathViewer = chatMessage.contents.filter({$0.isFile}).first!.exportPlainFile()
|
||||
viewer.contentType = chatMessage.contents.filter({$0.isFile}).first!.type
|
||||
PhoneMainView.instance().changeCurrentView(viewer.compositeViewDescription())
|
||||
|
||||
} else {
|
||||
|
|
@ -636,14 +636,14 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
self.previewItems = []
|
||||
|
||||
if VFSUtil.vfsEnabled(groupName: kLinphoneMsgNotificationAppGroupId) {
|
||||
var plainFile = chatMessage.contents.first?.exportPlainFile()
|
||||
var plainFile = chatMessage.contents.filter({$0.isFile}).first?.exportPlainFile()
|
||||
|
||||
self.previewItems.append(self.getPreviewItem(filePath: plainFile!))
|
||||
|
||||
ChatConversationViewModel.sharedModel.removeTmpFile(filePath: plainFile)
|
||||
plainFile = ""
|
||||
}else if chatMessage.contents.first?.filePath != nil {
|
||||
self.previewItems.append(self.getPreviewItem(filePath: (chatMessage.contents.first?.filePath)!))
|
||||
}else if chatMessage.contents.filter({$0.isFile}).first?.filePath != nil {
|
||||
self.previewItems.append(self.getPreviewItem(filePath: (chatMessage.contents.filter({$0.isFile}).first?.filePath)!))
|
||||
}
|
||||
|
||||
afterPreviewIndex = index
|
||||
|
|
@ -666,7 +666,7 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
if (VFSUtil.vfsEnabled(groupName: kLinphoneMsgNotificationAppGroupId) || ConfigManager.instance().lpConfigBoolForKey(key: "use_in_app_file_viewer_for_non_encrypted_files", section: "app")){
|
||||
|
||||
var text = ""
|
||||
var filePathString = VFSUtil.vfsEnabled(groupName: kLinphoneMsgNotificationAppGroupId) ? chatMessage!.contents[index].exportPlainFile() : chatMessage!.contents[index].filePath
|
||||
var filePathString = VFSUtil.vfsEnabled(groupName: kLinphoneMsgNotificationAppGroupId) ? chatMessage!.contents.filter({$0.isFile})[index].exportPlainFile() : chatMessage!.contents.filter({$0.isFile})[index].filePath
|
||||
if let urlEncoded = filePathString!.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed){
|
||||
if !urlEncoded.isEmpty {
|
||||
if let urlFile = URL(string: "file://" + urlEncoded){
|
||||
|
|
@ -677,24 +677,24 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
if chatMessage != nil {
|
||||
|
||||
viewer.textViewer = text
|
||||
viewer.textNameViewer = (chatMessage!.contents[index].name!.isEmpty ? "" : chatMessage!.contents[index].name)!
|
||||
viewer.textNameViewer = (chatMessage!.contents.filter({$0.isFile})[index].name!.isEmpty ? "" : chatMessage!.contents.filter({$0.isFile})[index].name)!
|
||||
PhoneMainView.instance().changeCurrentView(viewer.compositeViewDescription())
|
||||
}
|
||||
|
||||
} catch {
|
||||
var extensionFile = ""
|
||||
if chatMessage!.contents[index].name != nil {
|
||||
extensionFile = chatMessage!.contents[index].name!.lowercased().components(separatedBy: ".").last ?? ""
|
||||
if chatMessage!.contents.filter({$0.isFile})[index].name != nil {
|
||||
extensionFile = chatMessage!.contents.filter({$0.isFile})[index].name!.lowercased().components(separatedBy: ".").last ?? ""
|
||||
}
|
||||
|
||||
if text == "" && (chatMessage!.contents[index].type == "image" || chatMessage!.contents[index].type == "video" || chatMessage!.contents[index].name!.lowercased().components(separatedBy: ".").last == "pdf" || (["mkv", "avi", "mov", "mp4"].contains(extensionFile))){
|
||||
if text == "" && (chatMessage!.contents.filter({$0.isFile})[index].type == "image" || chatMessage!.contents.filter({$0.isFile})[index].type == "video" || chatMessage!.contents.filter({$0.isFile})[index].name!.lowercased().components(separatedBy: ".").last == "pdf" || (["mkv", "avi", "mov", "mp4"].contains(extensionFile))){
|
||||
let viewer: MediaViewer = VIEW(MediaViewer.compositeViewDescription())
|
||||
|
||||
var image = UIImage()
|
||||
if chatMessage != nil {
|
||||
if chatMessage!.contents[index].type == "image" {
|
||||
if chatMessage!.contents.filter({$0.isFile})[index].type == "image" {
|
||||
if VFSUtil.vfsEnabled(groupName: kLinphoneMsgNotificationAppGroupId) {
|
||||
var plainFile = chatMessage!.contents[index].exportPlainFile()
|
||||
var plainFile = chatMessage!.contents.filter({$0.isFile})[index].exportPlainFile()
|
||||
|
||||
image = UIImage(contentsOfFile: plainFile)!
|
||||
|
||||
|
|
@ -702,14 +702,14 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
plainFile = ""
|
||||
|
||||
}else {
|
||||
image = UIImage(contentsOfFile: chatMessage!.contents[index].filePath!)!
|
||||
image = UIImage(contentsOfFile: chatMessage!.contents.filter({$0.isFile})[index].filePath!)!
|
||||
}
|
||||
}
|
||||
|
||||
viewer.imageViewer = image
|
||||
viewer.imageNameViewer = (chatMessage!.contents[index].name!.isEmpty ? "" : chatMessage!.contents[index].name)!
|
||||
viewer.imagePathViewer = chatMessage!.contents[index].exportPlainFile()
|
||||
viewer.contentType = chatMessage!.contents[index].type
|
||||
viewer.imageNameViewer = (chatMessage!.contents.filter({$0.isFile})[index].name!.isEmpty ? "" : chatMessage!.contents.filter({$0.isFile})[index].name)!
|
||||
viewer.imagePathViewer = chatMessage!.contents.filter({$0.isFile})[index].exportPlainFile()
|
||||
viewer.contentType = chatMessage!.contents.filter({$0.isFile})[index].type
|
||||
PhoneMainView.instance().changeCurrentView(viewer.compositeViewDescription())
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -88,13 +88,14 @@ class MessageView: UIView, UITextViewDelegate {
|
|||
messageWithEmojiView.addArrangedSubview(emojisButton)
|
||||
emojisButton.alignParentRight().matchParentHeight().done()
|
||||
|
||||
if #available(iOS 17.0, *) {
|
||||
emojisButton.isHidden = true
|
||||
}
|
||||
emojisButton.isHidden = true
|
||||
|
||||
UIDeviceBridge.displayModeSwitched.readCurrentAndObserve { _ in
|
||||
self.backgroundColor = VoipTheme.voipToolbarBackgroundColor.get()
|
||||
self.messageWithEmojiView.backgroundColor = VoipTheme.backgroundWhiteBlack.get()
|
||||
if self.messageText.textColor != UIColor.lightGray {
|
||||
self.messageText.textColor = VoipTheme.backgroundBlackWhite.get()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,11 +104,6 @@ class MessageView: UIView, UITextViewDelegate {
|
|||
let chatRoom = ChatRoom.getSwiftObject(cObject: PhoneMainView.instance().currentRoom)
|
||||
if ((messageText.text.isEmpty && !fileContext) || isLoading) {
|
||||
sendButton.isEnabled = false
|
||||
if #available(iOS 17.0, *) {
|
||||
emojisButton.isHidden = true
|
||||
} else {
|
||||
emojisButton.isHidden = false
|
||||
}
|
||||
NotificationCenter.default.post(name: Notification.Name("LinphoneResetTextViewSize"), object: self)
|
||||
lastNumLines = 0
|
||||
} else {
|
||||
|
|
@ -118,17 +114,6 @@ class MessageView: UIView, UITextViewDelegate {
|
|||
onlyEmojis = false
|
||||
}
|
||||
}
|
||||
if onlyEmojis {
|
||||
if #available(iOS 17.0, *) {
|
||||
emojisButton.isHidden = true
|
||||
} else {
|
||||
emojisButton.isHidden = false
|
||||
}
|
||||
} else {
|
||||
emojisButton.isHidden = true
|
||||
}
|
||||
} else {
|
||||
emojisButton.isHidden = true
|
||||
}
|
||||
if !isComposing {
|
||||
chatRoom.compose()
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
var replyContentCollection : [Content] = []
|
||||
|
||||
var imagesGridCollectionView : [UIImage?] = []
|
||||
var imagesGridCollectionViewNil = 0
|
||||
var downloadContentCollection: [DownloadMessageCell?] = []
|
||||
var uploadContentCollection: [UploadMessageCell?] = []
|
||||
|
||||
|
|
@ -792,7 +791,6 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
replyCollectionView = []
|
||||
replyContentCollection = []
|
||||
imagesGridCollectionView = []
|
||||
imagesGridCollectionViewNil = 0
|
||||
downloadContentCollection = []
|
||||
uploadContentCollection = []
|
||||
imageViewBubble = UIImageView(image: UIImage(named: "chat_error"))
|
||||
|
|
@ -854,7 +852,6 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
chatMessage = event.chatMessage
|
||||
addMessageDelegate()
|
||||
imagesGridCollectionView.removeAll()
|
||||
imagesGridCollectionViewNil = 0
|
||||
imageUser.isHidden = true
|
||||
deleteItemCheckBox.isHidden = true
|
||||
|
||||
|
|
@ -1178,11 +1175,6 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
NSLayoutConstraint.deactivate(labelTopConstraints)
|
||||
}
|
||||
|
||||
if imagesGridCollectionView.count == 0 {
|
||||
//imagesGridCollectionView.append(nil)
|
||||
imagesGridCollectionViewNil += 1
|
||||
}
|
||||
|
||||
label.font = label.font.withSize(17)
|
||||
|
||||
if (content.utf8Text!.trimmingCharacters(in: .whitespacesAndNewlines).unicodeScalars.first?.properties.isEmojiPresentation == true){
|
||||
|
|
@ -1497,7 +1489,6 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
stackViewReactionsItem5.isHidden = false
|
||||
}
|
||||
default:
|
||||
print("newStackViewReactionsItemnewStackViewReactionsItem \(chatMessageReaction.body)")
|
||||
if newStackViewReactionsItem.isHidden == false {
|
||||
stackViewReactionsCounter.text = String(event.chatMessage!.reactions.count)
|
||||
stackViewReactionsCounter.isHidden = false
|
||||
|
|
@ -1859,28 +1850,29 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
return cell
|
||||
}else{
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cellImagesGridMessage", for: indexPath)
|
||||
let indexPathWithoutNil = indexPath.row + imagesGridCollectionViewNil
|
||||
let indexPathWithoutNil = indexPath.row
|
||||
let indexPathWithoutNilWithRecording = indexPathWithoutNil + (messageWithRecording ? 1 : 0)
|
||||
if (imagesGridCollectionView.indices.contains(indexPathWithoutNil) == true && chatMessage?.contents.indices.contains(indexPathWithoutNilWithRecording) == true){
|
||||
if ((indexPathWithoutNil <= imagesGridCollectionView.count - 1) && (imagesGridCollectionView[indexPathWithoutNil] != nil) && (chatMessage?.contents[indexPathWithoutNilWithRecording].isFile == true || chatMessage?.contents[indexPathWithoutNilWithRecording].isFileTransfer == true)) {
|
||||
|
||||
if (chatMessage != nil && imagesGridCollectionView.count > indexPathWithoutNil && chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer}).count > indexPathWithoutNilWithRecording){
|
||||
if ((indexPathWithoutNil <= imagesGridCollectionView.count - 1) && (imagesGridCollectionView[indexPathWithoutNil] != nil) && (chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].isFile == true || chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].isFileTransfer == true)) {
|
||||
let viewCell: UIView = UIView(frame: cell.contentView.frame)
|
||||
cell.addSubview(viewCell)
|
||||
if (chatMessage?.isOutgoing == false && (chatMessage?.contents[indexPathWithoutNilWithRecording].filePath == "" || chatMessage?.contents[indexPathWithoutNilWithRecording].isFileTransfer == true)) {
|
||||
if (chatMessage!.isOutgoing == false && (chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].filePath == "" || chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].isFileTransfer == true)) {
|
||||
let downloadView = DownloadMessageCell()
|
||||
downloadContentCollection.append(downloadView)
|
||||
downloadView.content = chatMessage?.contents[indexPathWithoutNilWithRecording]
|
||||
downloadView.content = chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording]
|
||||
downloadView.size(w: 138, h: 138).done()
|
||||
viewCell.addSubview(downloadView)
|
||||
|
||||
downloadView.downloadNameLabel.text = chatMessage?.contents[indexPathWithoutNilWithRecording].name!.replacingOccurrences(of: ((chatMessage?.contents[indexPathWithoutNilWithRecording].name!.dropFirst(6).dropLast(8))!), with: "...")
|
||||
downloadView.setFileType(fileName: (chatMessage?.contents[indexPathWithoutNilWithRecording].name)!)
|
||||
downloadView.downloadNameLabel.text = chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].name!.replacingOccurrences(of: ((chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].name!.dropFirst(6).dropLast(8))), with: "...")
|
||||
downloadView.setFileType(fileName: (chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].name)!)
|
||||
|
||||
let underlineAttribute = [NSAttributedString.Key.underlineStyle: NSUnderlineStyle.thick.rawValue]
|
||||
let underlineAttributedString = NSAttributedString(string: "\(VoipTexts.bubble_chat_download_file) (\(String(format: "%.1f", Float(((chatMessage?.contents[indexPathWithoutNilWithRecording].fileSize)!)) / 1000000)) Mo)", attributes: underlineAttribute)
|
||||
let underlineAttributedString = NSAttributedString(string: "\(VoipTexts.bubble_chat_download_file) (\(String(format: "%.1f", Float(((chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].fileSize))) / 1000000)) Mo)", attributes: underlineAttribute)
|
||||
downloadView.downloadButtonLabel.attributedText = underlineAttributedString
|
||||
downloadView.downloadButtonLabel.onClick {
|
||||
self.chatMessage?.contents[indexPathWithoutNilWithRecording].filePath = LinphoneManager.imagesDirectory() + (((self.chatMessage?.contents[indexPathWithoutNilWithRecording].name)!))
|
||||
let _ = self.chatMessage!.downloadContent(content: (self.chatMessage?.contents[indexPathWithoutNilWithRecording])!)
|
||||
self.chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].filePath = LinphoneManager.imagesDirectory() + (((self.chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].name)!))
|
||||
let _ = self.chatMessage!.downloadContent(content: (self.chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording]))
|
||||
}
|
||||
downloadView.downloadButtonLabel.isUserInteractionEnabled = true
|
||||
|
||||
|
|
@ -1893,7 +1885,7 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
let myImageView = UIImageView()
|
||||
|
||||
|
||||
myImageView.image = getImageFrom(chatMessage?.contents[indexPathWithoutNilWithRecording], forReplyBubble: false)
|
||||
myImageView.image = getImageFrom(chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording], forReplyBubble: false)
|
||||
|
||||
myImageView.size(w: (viewCell.frame.width), h: (viewCell.frame.height)).done()
|
||||
viewCell.addSubview(myImageView)
|
||||
|
|
@ -1901,13 +1893,13 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
myImageView.contentMode = .scaleAspectFill
|
||||
myImageView.clipsToBounds = true
|
||||
|
||||
if (chatMessage?.isOutgoing == true && (chatMessage?.contents[indexPathWithoutNilWithRecording].filePath == "" || chatMessage?.isFileTransferInProgress == true)){
|
||||
if (chatMessage!.isOutgoing == true && (chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].filePath == "" || chatMessage!.isFileTransferInProgress == true)){
|
||||
let uploadView = UploadMessageCell()
|
||||
uploadContentCollection.append(uploadView)
|
||||
uploadView.content = chatMessage?.contents[indexPathWithoutNilWithRecording]
|
||||
uploadView.content = chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording]
|
||||
uploadView.size(w: 138, h: 138).done()
|
||||
|
||||
if(chatMessage?.contents[indexPathWithoutNilWithRecording].type == "video"){
|
||||
if(chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].type == "video"){
|
||||
var imagePlay = UIImage()
|
||||
if #available(iOS 13.0, *) {
|
||||
imagePlay = (UIImage(named: "vr_play")!.withTintColor(.white))
|
||||
|
|
@ -1926,10 +1918,10 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
}
|
||||
if(imagesGridCollectionView[indexPathWithoutNil] != nil){
|
||||
var extensionFile = ""
|
||||
if chatMessage?.contents[indexPathWithoutNilWithRecording].filePath != nil {
|
||||
extensionFile = chatMessage?.contents[indexPathWithoutNilWithRecording].filePath!.lowercased().components(separatedBy: ".").last ?? ""
|
||||
if chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].filePath != nil {
|
||||
extensionFile = chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].filePath!.lowercased().components(separatedBy: ".").last ?? ""
|
||||
}
|
||||
if(chatMessage?.contents[indexPathWithoutNilWithRecording].type == "video" || (["mkv", "avi", "mov", "mp4"].contains(extensionFile))){
|
||||
if(chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].type == "video" || (["mkv", "avi", "mov", "mp4"].contains(extensionFile))){
|
||||
var imagePlay = UIImage()
|
||||
if #available(iOS 13.0, *) {
|
||||
imagePlay = (UIImage(named: "vr_play")!.withTintColor(.white))
|
||||
|
|
@ -1941,7 +1933,7 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
myImagePlayView.size(w: viewCell.frame.width/4, h: viewCell.frame.height/4).done()
|
||||
myImagePlayView.alignHorizontalCenterWith(viewCell).alignVerticalCenterWith(viewCell).done()
|
||||
}
|
||||
if chatMessage?.contents[indexPathWithoutNilWithRecording].filePath != nil && chatMessage?.contents[indexPathWithoutNilWithRecording].filePath != "" {
|
||||
if chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].filePath != nil && chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexPathWithoutNilWithRecording].filePath != "" {
|
||||
viewCell.onClick {
|
||||
ChatConversationTableViewModel.sharedModel.onGridClick(indexMessage: self.selfIndexMessage, index: indexPathWithoutNil)
|
||||
}
|
||||
|
|
@ -2017,7 +2009,7 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
}
|
||||
}
|
||||
|
||||
return SwiftUtil.textToImage(drawText: text!, inImage: image!, forReplyBubble: forReplyBubbble)
|
||||
return SwiftUtil.textToImage(drawText: text ?? "", inImage: (image ?? UIImage(named: "file_default"))!, forReplyBubble: forReplyBubbble)
|
||||
}
|
||||
|
||||
func setEvent(event: EventLog) -> String {
|
||||
|
|
@ -2110,8 +2102,8 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
if !message.isOutgoing {
|
||||
if (indexTransferProgress == -1) {
|
||||
for indexItem in 0...(imagesGridCollectionView.count) - 1 {
|
||||
if chatMessage?.contents[indexItem].name == content.name {
|
||||
indexTransferProgress = indexItem - imagesGridCollectionViewNil - (messageWithRecording ? 1 : 0)
|
||||
if chatMessage != nil && chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexItem].name == content.name {
|
||||
indexTransferProgress = indexItem - (messageWithRecording ? 1 : 0)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
@ -2191,8 +2183,8 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
|
|||
if((imagesGridCollectionView.count) > 0){
|
||||
if (indexUploadTransferProgress == -1) {
|
||||
for indexItem in 0...(imagesGridCollectionView.count) - 1 {
|
||||
if chatMessage?.contents[indexItem].filePath == content.filePath {
|
||||
indexUploadTransferProgress = indexItem - imagesGridCollectionViewNil - (messageWithRecording ? 1 : 0)
|
||||
if chatMessage != nil && chatMessage!.contents.filter({$0.isFile || $0.isFileTransfer})[indexItem].filePath == content.filePath {
|
||||
indexUploadTransferProgress = indexItem - (messageWithRecording ? 1 : 0)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue