Skip to content

Commit

Permalink
adapt to api without get_original_chat_id()
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Jan 30, 2025
1 parent ba5ae11 commit b93a026
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
8 changes: 4 additions & 4 deletions deltachat-ios/Chat/ChatViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2233,10 +2233,10 @@ extension ChatViewController: BaseMessageCellDelegate {
guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return }
let savedMessage = dcContext.getMessage(id: messageIds[indexPath.row])

let originalChatId = savedMessage.originalChatId
if originalChatId != 0 {
let originalMessageId: Int? = savedMessage.originalMessageId == 0 ? nil : savedMessage.originalMessageId
appDelegate.appCoordinator.showChat(chatId: originalChatId, msgId: originalMessageId, animated: true, clearViewControllerStack: true)
let originalMessageId = savedMessage.originalMessageId
if originalMessageId != 0 {
let originalMessage = dcContext.getMessage(id: originalMessageId)
appDelegate.appCoordinator.showChat(chatId: originalMessage.chatId, msgId: originalMessageId, animated: true, clearViewControllerStack: true)
}
}

Expand Down
2 changes: 1 addition & 1 deletion deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public class BaseMessageCell: UITableViewCell {
avatarView.isHidden = true
}

gotoOriginalButton.isHidden = msg.originalChatId == 0
gotoOriginalButton.isHidden = msg.originalMessageId == 0

let downloadState = msg.downloadState
let hasHtml = msg.hasHtml
Expand Down
4 changes: 0 additions & 4 deletions deltachat-ios/DC/DcMsg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ public class DcMsg {
return Int(dc_msg_get_from_id(messagePointer))
}

public var originalChatId: Int {
return Int(dc_msg_get_original_chat_id(messagePointer))
}

public var originalMessageId: Int {
return Int(dc_msg_get_original_msg_id(messagePointer))
}
Expand Down

0 comments on commit b93a026

Please sign in to comment.