attachments info in conversations and messages

0 views
Skip to first unread message

Bryan Clark

unread,
Aug 3, 2010, 4:55:59 PM8/3/10
to raindr...@googlegroups.com
Hey -

I made some changes to the conversation object, conversation controller, and message controller. 

In the conversation object I added a "has_attachment" column which helps the UI know if there is a message with any kind of attachment in the conversation (even one that isn't being currently display).

This field I wasn't completely sure about.  In the UI we're trying to make sure that we only make the user aware of attachments that matter.  Some things like pgp-signature and html message bodies are attachments that don't matter.  I was thinking of using a list of attachments and saving the mimetypes so I could decide later (in the UI) if those attachments matter.  However I feel like when we did this previously we used a "visible" attribute and maybe that's something I should be keying off instead.  Thoughts?

With the conversation and message controller I added an "attachments" list to the message objects with some sparse details about the type of attachment.  I didn't want to drop the entire attachment object into the message as it could be large.  All the UI really needs to know is the type of attachment and the ID to use for grabbing the full attachment information.

So attachments objects (when coming from the conversation or message object) look like this:
{ id: 12, type: "link", subtype: "mozilla.org" }
I'm assuming that all attachments give a mimetype structure of type and subtype and this allows the UI to prepare the right amount of space for the coming type.  e.g. link/youtube.com is going to need space for a video player.

Because of the change to the DB columns I assume you'll have to nuke your existing database.  Let me know if there are any issues.

Also this is not very efficient so if there's a better or faster structure for achieving a similar goal feel free to fix it.
http://hg.mozilla.org/users/mhammond_skippinet.com.au/raindrop-reboot/rev/9ff17377868a

Cheers,
~ Bryan
Reply all
Reply to author
Forward
0 new messages