Fix crash when receive message with multiple media

Fix presence latestActivityTimestamp
This commit is contained in:
benoit.martins 2023-05-29 16:05:00 +02:00 committed by QuentinArguillere
parent 962ab4c267
commit 25813dc15f
3 changed files with 7 additions and 6 deletions

View file

@ -548,7 +548,7 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll
var hasPresence : Bool? = false
if friend?.address?.asStringUriOnly() != nil {
presenceModel = friend!.getPresenceModelForUriOrTel(uriOrTel: (friend?.address?.asStringUriOnly())!)
presenceModel = friend!.presenceModel
hasPresence = presenceModel != nil && presenceModel!.basicStatus == PresenceBasicStatus.Open
}
@ -559,7 +559,6 @@ class ChatConversationViewSwift: BackActionsNavigationView, PHPickerViewControll
let timeInterval = TimeInterval(presenceModel!.latestActivityTimestamp)
let myNSDate = Date(timeIntervalSince1970: timeInterval)
if timeInterval == -1 {
participantsGroupLabel.text = VoipTexts.chat_room_presence_away;
} else if Calendar.current.isDateInToday(myNSDate) {

View file

@ -950,6 +950,9 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
collectionViewImagesGrid.isHidden = false
NSLayoutConstraint.activate(imagesGridConstraints)
imageViewBubble.image = nil
NSLayoutConstraint.deactivate(imageConstraints)
imageViewBubble.isHidden = true
}
if (event.chatMessage?.isOutgoing == true && content.isFileTransfer && event.chatMessage?.isFileTransferInProgress == true) {
@ -1238,7 +1241,7 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
imageViewBubble.isHidden = true
}
} else {
if content.filePath == "" {
if content.filePath == "" && content.isFileTransfer == false {
imagesGridCollectionView.append(SwiftUtil.textToImage(drawText: "Error", inImage: UIImage(named: "file_default")!, forReplyBubble: true))
collectionViewImagesGrid.reloadData()
@ -1598,8 +1601,7 @@ class MultilineMessageCell: SwipeCollectionViewCell, UICollectionViewDataSource,
}else{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cellImagesGridMessage", for: indexPath)
let indexPathWithoutNil = indexPath.row + imagesGridCollectionViewNil
print("indexPathWithoutNilindexPathWithoutNil \(indexPathWithoutNil) \(chatMessage?.contents[indexPathWithoutNil])")
if ((indexPathWithoutNil <= (imagesGridCollectionView.count) - 1) && (imagesGridCollectionView[indexPathWithoutNil] != nil) && (chatMessage?.contents[indexPathWithoutNil].isFile == true || chatMessage?.contents[indexPathWithoutNil].isFileTransfer == true)) {
if ((indexPathWithoutNil <= imagesGridCollectionView.count - 1) && (imagesGridCollectionView[indexPathWithoutNil] != nil) && (chatMessage?.contents[indexPathWithoutNil].isFile == true || chatMessage?.contents[indexPathWithoutNil].isFileTransfer == true)) {
let viewCell: UIView = UIView(frame: cell.contentView.frame)
cell.addSubview(viewCell)
if (chatMessage?.isOutgoing == false && (chatMessage?.contents[indexPathWithoutNil].filePath == "" || chatMessage?.contents[indexPathWithoutNil].isFileTransfer == true)) {

View file

@ -5,7 +5,7 @@ source "https://github.com/CocoaPods/Specs.git"
def all_pods
if ENV['PODFILE_PATH'].nil?
pod 'linphone-sdk', '~>5.2.52-pre.2'
pod 'linphone-sdk', '~>5.2.65-pre.2'
else
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk
end