Commit 777d0d201740d3d2b26aa242642d81f1f60aa263

  • avatar
  • acydlord
  • Thu Oct 08 01:10:47 CEST 2009
changed patch name to match structure#   (use "git reset HEAD <file>..." to unstage)
  
1This patch adds clean timestamps to all messages and gets rid of the divider bar unless transport is changed.
2Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
3===================================================================
4--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
5+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
6@@ -1293,17 +1293,23 @@ var ChatviewAssistant = Class.create({
7 d.setTime(msg.deviceTimeStamp);
8 msg.niceDate = BucketDateFormatter.getDateBucket(d,true,true); // this used to use msg.timeStamp - changed 2008-11-05
9
10+ // timestamp hack - enables timestamps on all messages (clean-messenger);
11+ var ts = new Date();
12+ ts.setTime(msg.deviceTimeStamp);
13+ msg.timeStampText = Mojo.Format.formatDate(ts,'short');
14+
15 // divider hack - round to the nearest 5 minutes
16 // we have to do this because the list divider implementation does not allow a divider
17 // to have knowledge about other dividers
18 var deviceTimeStampMinutes = d.getMinutes();
19 d.setMinutes((deviceTimeStampMinutes - (deviceTimeStampMinutes % 5)));
20 d.setSeconds(0);
21- msg.dividerText = msg.transportClass + BucketDateFormatter.getDateBucket(d,true,true);
22+ msg.dividerText = msg.transportClass; // + BucketDateFormatter.getDateBucket(d,true,true);
23+ // comment in previous line kills ~5min timed divider (clean-messenger);
24
25 // if the INCOMING message was sent longer than 10 minutes before it arrived on device,
26 // add sent date to indicate that this delay happened
27- if(!ChatFlags.isOutgoing(msg.flags) && msg.deviceTimeStamp && msg.timeStamp && (msg.deviceTimeStamp-msg.timeStamp) > (1000*60*10)) {
28+ // (clean-messenger); if(!ChatFlags.isOutgoing(msg.flags) && msg.deviceTimeStamp && msg.timeStamp && (msg.deviceTimeStamp-msg.timeStamp) > (1000*60*10)) {
29 var d = new Date();
30 var today = d.getTime();
31 d.setTime(msg.timeStamp);
32@@ -1311,10 +1317,10 @@ var ChatviewAssistant = Class.create({
33
34 // Only show the message sent time if it is less than two days old
35 // from when it arrived on device
36- if(today-msg.timeStamp <= (1000*60*60*24*2)) {
37- msg.timeStampDeltaMsg = new Template($L("Message Sent: #{dateTime}")).evaluate({dateTime:Mojo.Format.formatDate(sentTimeStamp,'short')});
38- }
39- }
40+ // (clean-messenger); if(today-msg.timeStamp <= (1000*60*60*24*2)) {
41+ msg.timeStampDeltaMsg = new Template($L("#{dateTime}")).evaluate({dateTime:Mojo.Format.formatDate(sentTimeStamp,'short')});
42+ // (clean-messenger); }
43+ // (clean-messenger); }
44
45 if (msg.callbackNumber) {
46 msg.callbackNumber = PalmSystem.runTextIndexer(msg.callbackNumber);
47Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
48===================================================================
49--- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
50+++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
51@@ -681,6 +681,7 @@ img.avatar-overlay {
52 width: 40px;
53 height: 40px;
54 }
55+/* timestamp formatting (clean-messenger)*/
56
57 .message.status-success {
58 color: #000000;