ChatSecure / ChatSecure-iOS

ChatSecure is a free and open source encrypted chat client for iOS that supports OTR and OMEMO encryption over XMPP.
https://chatsecure.org
Other
3.13k stars 1.03k forks source link

Get message from messageID #1211

Open ShahrukhMalik opened 4 years ago

ShahrukhMalik commented 4 years ago

In OTRMessageViewController

 - (id <OTRMessageProtocol,JSQMessageData>)messageAtIndexPath:(NSIndexPath *)indexPath
 {
     // Multiple invocations with the same indexPath tend to come in groups, no need to hit the DB each time.
     // Even though the object is cached, the row ID calculation still takes time
     if (![indexPath isEqual:self.currentIndexPath]) {
         self.currentIndexPath = indexPath;
         self.currentMessage = [self.viewHandler object:indexPath];
     }
     return self.currentMessage;
 }

this method returns the message based on indexpath. How can I get the message from yapdatabase by passing messageID instead of indexpath?