changeset 208:d507cc4374c7

store twitter message content as the subject of the message so it shows up in the list view
author Myk Melez <myk@mozilla.org>
date Sun, 27 Jul 2008 18:22:13 -0700
parents 63d17a2ecac7
children 44140f83ff8b
files extension/modules/twitter.js
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/extension/modules/twitter.js	Sun Jul 27 18:14:02 2008 -0700
+++ b/extension/modules/twitter.js	Sun Jul 27 18:22:13 2008 -0700
@@ -351,6 +351,12 @@
   },
 
   _addMessage: function(message) {
+    // We store the message text as both the subject and the content so that
+    // the content shows up in the Subject column of the list view.
+    // FIXME: make the list view automatically display some of the content
+    // if the subject is missing so we don't have to duplicate storage here.
+    let subject = message.text;
+
     // Get an existing identity or create a new one.  Creating an identity
     // automatically creates a person record with the provided name.
     let identity = SnowlIdentity.get(this.id, message.user.id) ||
@@ -365,12 +371,13 @@
 
     let timestamp = new Date(message.created_at);
 
-    let messageID = this.addSimpleMessage(this.id, message.id, null, authorID,
-                                          timestamp, null);
+    // Add the message.
+    let messageID = this.addSimpleMessage(this.id, message.id, subject, authorID, timestamp, null);
 
+    // Add the message's content.
     this.addPart(messageID, PART_TYPE_CONTENT, message.text, null, null, "text/plain");
 
-    // Add metadata.
+    // Add the message's metadata.
     for (let [name, value] in Iterator(message)) {
       // Ignore properties we have already handled specially.
       // XXX Should we add them anyway, which is redundant info but lets others