diff --git a/js/background.js b/js/background.js index 7a4f3ba6..d20e5d5e 100644 --- a/js/background.js +++ b/js/background.js @@ -161,6 +161,10 @@ errors : [] }); + if (message.get('sent_at') > conversation.get('timestamp')) { + conversation.set({ timestamp: message.get('sent_at'), lastMessage: message.get('body') }); + } + conversation.save().then(function() { message.save().then(function() { extension.trigger('message', message); // notify frontend listeners diff --git a/js/models/conversations.js b/js/models/conversations.js index 6f2f910c..bc5890af 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -56,7 +56,9 @@ this.save({ unreadCount : 0, - active_at : now + active_at : now, + timestamp : now, + lastMessage : body }); var sendFunc; diff --git a/stylesheets/manifest.css b/stylesheets/manifest.css index d558edfc..2289f6df 100644 --- a/stylesheets/manifest.css +++ b/stylesheets/manifest.css @@ -162,7 +162,11 @@ body { letter-spacing: 0.15px; -webkit-text-stroke: 0.2px; margin: 0; - font-size: 12px; } + font-size: 12px; + width: 150px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .gutter .contact .contact-details .last-timestamp { position: absolute; top: 14px; diff --git a/stylesheets/view/_gutter.scss b/stylesheets/view/_gutter.scss index 3d131cc1..9dba9a71 100644 --- a/stylesheets/view/_gutter.scss +++ b/stylesheets/view/_gutter.scss @@ -99,6 +99,10 @@ -webkit-text-stroke: 0.2px; margin:0; font-size: 12px; + width: 150px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } .last-timestamp { position:absolute;