Loading threads and displaying them

291 views
Skip to first unread message

Mitar

unread,
Nov 26, 2016, 8:04:33 PM11/26/16
to inbo...@googlegroups.com
Hi!

I want to create an extension which would show me all first posts of
threads expanded one after the other. So that I can skim quickly over
all initial e-mails (of every thread) in my inbox with scrolling, but
not just subjects. And then I can go deeper into replies if I want.

I think I need a custom route for this, but I am not sure how can I
then load first message of every thread and render that inside a
custom route?


Mitar

--
http://mitar.tnode.com/
https://twitter.com/mitar_m

Omar Ismail

unread,
Nov 28, 2016, 9:16:10 PM11/28/16
to Mitar, InboxSDK
It's possible to do this entirely on the client, but that's beyond the scope of the SDK, and probably best served by using some of your own server code.

Specifically you're right in using a custom route view, obviously can use the SDK to do that. To get the list of threads, you can make the same request that Gmail makes, but that's outside the scope of SDK right now. Gmail API seems better for that, same with getting the first message for each of those threads.
Does that help?

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/CAKLmikOzVF9Yyo3bhzgR5wEK1m%2Bi%2BtV9oum-m2zWcyCt8jM5_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Mitar

unread,
Nov 29, 2016, 4:06:23 PM11/29/16
to Omar Ismail, InboxSDK
Hi!

Thanks for the reply. It helps, I just wanted to make sure that I am not missing something.

So I wanted to create a self-contained extension so that I do not have to provide also a server for users of the extension. But it seems that one option is to reverse-engineer calls Gmail itself is doing, or I use Gmail API, but I cannot really use it client-side because then I would have to embed secret into the extension.

So it seems I can just request user of the extension to approve Gmail API and then use that from the server to load messages from them. This also allows me to do some post-processing. It also seems that using server is the only way to get notified of changes to Gmail. So there are multiple reasons to use server-side.

But if I make requests to my server, how can I know which user is using Gmail in a secure way? I just do OAuth authentication every time extension is loaded on a Gmail and in the future it would already be approved so user will not see that?

Also, is it possible to then reuse Gmail code to render this messages? So if I get messages over Gmail API, and then if I want to render them with the Gmail look and feel (and security, like HTML e-mail sanitization), it seems that I would have to recreate all this from scratch? It is possible to say to Gmail "render message with this ID into this div"?


Mitar
Reply all
Reply to author
Forward
0 new messages