Finding the MessageView that I'm replying to

71 views
Skip to first unread message

Paul Hunkin

unread,
Feb 1, 2023, 3:39:14 AM2/1/23
to InboxSDK
Hi all! 

I'm using InboxSDK to build an extension that creates replies to messages. To do this, I need to extract the text from the message the user is replying to. This may or may not be the last message in a thread.

I'm currently using handleThreadView -> getMessageViewsAll() to get a MessageView[] that I iterate over to find the last message not from the user, then extract its text.

This works great if you're replying at the end of a thread, but doesn't handle the case where you're replying to a message half way down a thread. I've found the isInlineReplyForm() method, which lets me detect if I'm in this state, but I can't seem to spot a way to figure out which message is the one directly "above" my compose.

Ideally there'd be some kind of way to tell via the MessageView like isUserReplyTarget(), but other approaches also welcome :)

Any tips? 

Thanks!
- Paul
Reply all
Reply to author
Forward
0 new messages