Fixed patch file
[webos-internals:modifications.git] / advanced / advanced-system-prefs-msg-prefs-vzw.patch
1 --- .orig/usr/palm/applications/com.palm.app.messaging/app/models/MojoDbInterfaces.js
2 +++ /usr/palm/applications/com.palm.app.messaging/app/models/MojoDbInterfaces.js
3 @@ -958,29 +958,55 @@
4  //                     return isValid;
5  //             },
6                 
7 -               setCustomMessage: function(customMessage) {
8 +               setCustomMessage: function(customMessage, objectId) {
9                         Mojo.Log.info("Setting customMessage to %s", customMessage);
10 -                       var mergeObject = {
11 -                               props: {
12 -                                       customMessage: customMessage
13 -                               },
14 -                               query: {
15 -                                       from: MessagingDB.IMLoginState.id
16 -                               }
17 -                       };
18 +                       if(objectId) {
19 +                               var mergeObject = {
20 +                                       props: {
21 +                                               customMessage: customMessage
22 +                                       },
23 +                                       query: {
24 +                                               from: MessagingDB.IMLoginState.id,
25 +                                               where: [{ prop: "_id", op: "=", val: objectId }]
26 +                                       }
27 +                               };
28 +                       }
29 +                       else {
30 +                               var mergeObject = {
31 +                                       props: {
32 +                                               customMessage: customMessage
33 +                                       },
34 +                                       query: {
35 +                                               from: MessagingDB.IMLoginState.id
36 +                                       }
37 +                               };
38 +                       }
39                         return MojoDB.execute("merge", mergeObject);
40                 },
41  
42 -               setAvailability: function(availability) {
43 +               setAvailability: function(availability, objectId) {
44                         Mojo.Log.info("Setting availability to %s", availability);
45 -                       var mergeObject = {
46 -                               props: {
47 -                                       availability: availability
48 -                               },
49 -                               query: {
50 -                                       from: MessagingDB.IMLoginState.id
51 -                               }
52 -                       };
53 +                       if(objectId) {
54 +                               var mergeObject = {
55 +                                       props: {
56 +                                               availability: availability
57 +                                       },
58 +                                       query: {
59 +                                               from: MessagingDB.IMLoginState.id,
60 +                                               where: [{ prop: "_id", op: "=", val: objectId }]
61 +                                       }
62 +                               };
63 +                       }
64 +                       else {                  
65 +                               var mergeObject = {
66 +                                       props: {
67 +                                               availability: availability
68 +                                       },
69 +                                       query: {
70 +                                               from: MessagingDB.IMLoginState.id
71 +                                       }
72 +                               };
73 +                       }
74                         return MojoDB.execute("merge", mergeObject);
75                 },
76  
77 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/app-assistant.js
78 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/app-assistant.js
79 @@ -52,6 +52,8 @@
80                 }
81  
82                 var stageController = this.controller.getStageController(MainStageName);
83 +
84 +               this.appController.notificationAssistant.removePlayNotificationSoundTasks();
85                 
86                 if (launchParams.clearBanner) {
87                         PalmSystem.clearBannerMessages();
88 @@ -99,10 +101,20 @@
89                  */     
90                 } else if (launchParams.target !== undefined) {
91                         this.handleTargetParam(launchParams.target, stageController);
92 +               } else if (launchParams.playNotificationSound) {
93 +                       // Delay playing to go around WebOS bug (sound not playing).
94 +
95 +                       setTimeout(this.playNotificationSound.bind(this, launchParams.serviceName), 1000);
96                 } else {
97                         this.launchMessaging(stageController);
98                 }               
99         },
100 +
101 +       playNotificationSound: function(serviceName) {
102 +               this.appController.notificationAssistant.playNotificationSound(serviceName);
103 +                       
104 +               this.appController.notificationAssistant.schedulePlayNotificationSoundTasks(serviceName);
105 +       },
106         
107         launchChatWithId: function(stageController, chatThreadId) {
108                 if (stageController) {                  
109 --- .orig/usr/palm/applications/com.palm.app.messaging/app/views/listview/buddyList-row.html
110 +++ /usr/palm/applications/com.palm.app.messaging/app/views/listview/buddyList-row.html
111 @@ -7,7 +7,7 @@
112        <div class="unread-count-container">
113          <div class="unread-count-wrapper">#{unreadCount}</div>
114        </div>
115 -      <div class="truncating-text custom-message">#{-customMessage}</div>
116 +      <div class="custom-message">#{-customMessage}</div>
117      </div>
118    </div>
119  </div>
120 \ No newline at end of file
121 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
122 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
123 @@ -270,6 +270,16 @@
124                 this.newMessageFieldLoseFocus = function(event) {
125                         if (this.messageTextElement !== undefined) {
126                                 this.messageTextElement.focus();
127 +                               
128 +                               var msg = this.Messaging.messagingPrefs.getMessageGreeting() + " " + 
129 +                                       this.Messaging.messagingPrefs.getMessageSignature();
130 +
131 +                               if((msg.length > 1) && (this.messageTextWidgetModel.value == msg))
132 +                               {
133 +                                       var curPos = this.Messaging.messagingPrefs.getMessageGreeting().length;
134 +                                       this.setTextFieldValue(msg);
135 +                                       this.controller.get("messageTextWidget").mojo.setCursorPosition(curPos, curPos);
136 +                               }
137                         }
138                 }.bind(this);
139                 
140 @@ -394,7 +404,9 @@
141                                 labelCallback: this.chatListDividerFunction.bind(this),
142                                 template: 'chatview/separator'
143                         },
144 -                       swipeDelete: true,
145 +                       swipeDelete: {
146 +                               autoConfirm: !this.Messaging.messagingPrefs.getUseDeleteConfirmation()
147 +                       },
148                         uniquenessProperty: '_id',
149                         initialScrollingDirection: 'up',
150                         revisionProperty: '_rev',
151 @@ -762,7 +774,7 @@
152                 if (this.isScreenOn && chatThreadId === this.chatThreadId) {
153                         Mojo.Log.info("[CV] ****** chatview considerForNotification --- screen is on!");
154                         if (data.notificationType === this.Messaging.notificationTypes.newMessage) {
155 -                               data = {playSoundOnly:true};
156 +                               data.playSoundOnly = true;
157                         } else if (data.notificationType === this.Messaging.notificationTypes.sendFailure) {
158                                 data = {}; // wipe out the notification because we are in the chat
159                         }
160 @@ -1370,6 +1382,8 @@
161                         return;
162                 }
163                 
164 +               this.messageTextElement.focus();
165 +
166                 if (tapTarget && tapTarget.id.startsWith(ChatviewAssistant.quickDialIdPrefix)) {
167                         try {
168                                 // The phone number is the substring after the quick dial prefix.
169 @@ -1445,6 +1459,30 @@
170                                 this.resetTextBox(false);
171                         }
172                 }
173 +               
174 +               var msg = this.Messaging.messagingPrefs.getMessageGreeting() + " " + 
175 +                       this.Messaging.messagingPrefs.getMessageSignature();
176 +
177 +           // Hide the attach button if there is an IM contact
178 +           if(selectedTransport.serviceName != "sms") {  
179 +                       if((msg.length > 1) && 
180 +                               (this.messageTextWidgetModel.value != undefined) &&
181 +                               (this.messageTextWidgetModel.value == msg))
182 +                       {
183 +                               this.setTextFieldValue("");
184 +                       }
185 +           } else {                  
186 +                       if((msg.length > 1) && 
187 +                               ((this.messageTextWidgetModel.value == undefined) || 
188 +                               (this.messageTextWidgetModel.value == "") ||
189 +                               (this.messageTextWidgetModel.value == msg)))
190 +                       {
191 +                               var curPos = this.Messaging.messagingPrefs.getMessageGreeting().length;
192 +                               this.setTextFieldValue(msg);
193 +                               this.controller.get("messageTextWidget").mojo.setCursorPosition(curPos, curPos);
194 +                       }
195 +               }
196 +
197                 this.setCharacterCounterMaxLength();
198         },
199  
200 @@ -2437,6 +2475,9 @@
201                 Mojo.Log.info("value " + value);
202                 
203                 if (value === 'forward-cmd') {
204 +                       if(this.Messaging.messagingPrefs.getPrependForward())
205 +                               text = "Fwd: " + text;
206 +               
207                         var composeParams = {
208                                 messageText: text,
209                                 focusWindow: true,
210 @@ -3104,8 +3145,26 @@
211         
212         _getMessageFromDraft: function() {
213                 MessagingDB.Messages.getMessageFromDraft(this.chatThreadId, function(result) {
214 -                       // Fill in text fields
215 -                       this.setTextFieldValue(result.messageText);
216 +                       if(this.Messaging.messagingPrefs.getUseAutomaticMsgDrafts()) {
217 +                               // Fill in text fields
218 +                               this.setTextFieldValue(result.messageText);
219 +                       }
220 +
221 +                       if(this.Messaging.messagingPrefs.getUseClipboardMsgDrafts())
222 +                               this.controller.stageController.setClipboard(result.messageText);
223 +
224 +                       if((result.serviceName == undefined) || (result.serviceName == "sms")) {
225 +                               var msg = this.Messaging.messagingPrefs.getMessageGreeting() + " " + 
226 +                                       this.Messaging.messagingPrefs.getMessageSignature();
227 +
228 +                               if((msg.length > 1) && ((this.messageTextElement.value == undefined) ||
229 +                                       (this.messageTextElement.value == "") || (this.messageTextElement.value == msg)))
230 +                               {
231 +                                       var curPos = this.Messaging.messagingPrefs.getMessageGreeting().length;
232 +                                       this.setTextFieldValue(msg);
233 +                                       this.controller.get("messageTextWidget").mojo.setCursorPosition(curPos, curPos);
234 +                               }
235 +                       }
236                 }.bind(this));
237         },
238  
239 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
240 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
241 @@ -132,10 +132,6 @@
242         },
243  
244         setup: function() {
245 -               if (!this.launchedWithParams){
246 -                       this.restoreFromDraft();
247 -               }
248 -
249                 this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
250  
251                 this.searchList = {
252 @@ -230,6 +226,10 @@
253                 if (this.passedAttachment) {
254                         this.attachFile(this.passedAttachment, this.passedAttachmentIconPath, this.deleteAttachmentWhenDone, this.passedAttachmentType, this.passedTranscodeParams);
255                 }
256 +
257 +               if (!this.launchedWithParams){
258 +                       this.restoreFromDraft();
259 +               }
260         },
261  
262         pushReminder: function(recipient){
263 @@ -784,10 +784,30 @@
264                                 }
265                         }
266                 }
267 +
268 +               var msg = this.Messaging.messagingPrefs.getMessageGreeting() + " " + 
269 +                       this.Messaging.messagingPrefs.getMessageSignature();
270 +
271             // Hide the attach button if there is an IM contact
272 -           if(hasIM === true) {         
273 +           if(hasIM === true) {  
274 +                       if((msg.length > 1) && 
275 +                               (this.messageTextWidgetModel.value != undefined) &&
276 +                               (this.messageTextWidgetModel.value == msg))
277 +                       {
278 +                               this.setTextFieldValue("");
279 +                       }
280 +                  
281               this.hideAttachButton();
282             } else {                  
283 +                       if((msg.length > 1) && 
284 +                               ((this.messageTextWidgetModel.value == undefined) || 
285 +                               (this.messageTextWidgetModel.value == "")))
286 +                       {
287 +                               var curPos = this.Messaging.messagingPrefs.getMessageGreeting().length;
288 +                               this.setTextFieldValue(msg);
289 +                               this.controller.get("messageTextWidget").mojo.setCursorPosition(curPos, curPos);
290 +                       }
291 +
292               this.showAttachButton();
293             }
294                 this.setCharacterCounterMaxLength();
295 @@ -921,13 +941,29 @@
296                 if (this.launchedAsForward === undefined && 
297                         (this.messageText === undefined || this.messageText.length === 0) &&
298                         this.prePopulatedRecipients.length === 0) {
299 +                               var msg = this.Messaging.messagingPrefs.getMessageGreeting() + " " + 
300 +                                       this.Messaging.messagingPrefs.getMessageSignature();
301 +
302 +                               if((msg.length > 1) && 
303 +                                       ((this.messageTextWidgetModel.value == undefined) || 
304 +                                       (this.messageTextWidgetModel.value == "")))
305 +                               {
306 +                                       var curPos = this.Messaging.messagingPrefs.getMessageGreeting().length;
307 +                                       this.setTextFieldValue(msg);
308 +                                       this.controller.get("messageTextWidget").mojo.setCursorPosition(curPos, curPos);
309 +                               }
310                                 
311                                 MessagingDB.Messages.getMessageFromDraft("_compose",function(result) {
312 -                                       this.controller.get('searchList').mojo.updateRecipients(result.to);
313 -                                       this.setTextFieldValue(result.messageText);
314 -                                       if (result.attachment !== undefined) {
315 -                                               this.attachFile(result.attachment);
316 +                                       if(this.Messaging.messagingPrefs.getUseAutomaticMsgDrafts()) {
317 +                                               this.controller.get('searchList').mojo.updateRecipients(result.to);
318 +                                               this.setTextFieldValue(result.messageText);
319 +                                               if (result.attachment !== undefined) {
320 +                                                       this.attachFile(result.attachment);
321 +                                               }                                       
322                                         }                                       
323 +
324 +                                       if(this.Messaging.messagingPrefs.getUseClipboardMsgDrafts())
325 +                                               this.controller.stageController.setClipboard(result.messageText);
326                                 }.bind(this));
327                 }
328         },
329 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/dashboardMessage-assistant.js
330 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/dashboardMessage-assistant.js
331 @@ -2,7 +2,7 @@
332  /*jslint white: false, onevar: false, nomen:false, plusplus: false*/
333  /* Copyright 2009 Palm, Inc.  All rights reserved. */
334  
335 -function DashboardMessageAssistant(dashboardData) {
336 +function DashboardMessageAssistant(dashboardData, blinkNotify) {
337         this.dashboardData = dashboardData; // hold onto a reference to the dashboardData
338         if(this.dashboardData.newest && this.dashboardData[this.dashboardData.newest].list && this.dashboardData[this.dashboardData.newest].list.length>0){
339                 this.isInvite = (this.dashboardData[this.dashboardData.newest].list[0].imType === "invite"? true:false);
340 @@ -11,10 +11,11 @@
341         this.Messaging = this.appController.Messaging;
342         this.tapHandler = this.tapHandler.bindAsEventListener(this);
343         this.oldPresenceClass = "";
344 +       this.blinkNotify = blinkNotify;
345  }
346  
347  DashboardMessageAssistant.prototype.setup = function() {
348 -       this.update(true);
349 +       this.update(this.blinkNotify);
350         this.messageInfoElement = this.controller.get('message_info');
351         this.messageInfoElement.addEventListener(Mojo.Event.tap, this.tapHandler);
352  };
353 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
354 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
355 @@ -32,6 +32,8 @@
356                 this.historyListReset = false;
357                 this.delayUpdateCount = 0;
358                 this.delayExecuteCount = 0;
359 +               this.accountsData = {};
360 +               this.availabilityData = {};
361         
362                 this.COMMAND_MENU = {
363                         loadComposeView: {command:'cmdLoadComposeView',target: this.loadComposeView.bind(this)},
364 @@ -67,7 +69,7 @@
365                         {label: $L('Available'), command:this.Messaging.Availability.getAvailabilityAsConstText(this.Messaging.Availability.AVAILABLE), secondaryIcon:'status-available'},
366                         {label: $L('Busy'),      command:this.Messaging.Availability.getAvailabilityAsConstText(this.Messaging.Availability.BUSY),      secondaryIcon:'status-away'},
367                         // libpurple doesn't support invisible status for gtalk so commenting this out for now.
368 -                       //{label: $L('Invisible'), command:this.Messaging.Availability.getAvailabilityAsConstText(this.Messaging.Availability.INVISIBLE),  secondaryIcon:'status-invisible'},
369 +                       {label: $L('Invisible'), command:this.Messaging.Availability.getAvailabilityAsConstText(this.Messaging.Availability.INVISIBLE),  secondaryIcon:'status-invisible'},
370                         {label: $L('Sign off'),  command:this.Messaging.Availability.getAvailabilityAsConstText(this.Messaging.Availability.OFFLINE),   secondaryIcon:'status-offline'}
371                 ];
372                 
373 @@ -91,6 +93,29 @@
374         
375                 //To update the addBuddy menu item
376                 this.handleIMAccountsChange = function(results) {
377 +                       this.accountsData = {};
378 +                                       
379 +                       if(results && results.length > 1) {
380 +                               for(var i = 0; i < results.length; i++) {                                               
381 +                                       if(results[i].alias) {
382 +                                               var cp = results[i].capabilityProviders;
383 +
384 +                                               for (j = 0; j < cp.length; j++) {
385 +                                                       if (cp[j].capability === 'MESSAGING') {
386 +                                                               if (cp[j].capabilitySubtype === 'IM') {
387 +                                                                       if(!this.accountsData[results[i].alias])
388 +                                                                               this.accountsData[results[i].alias] = [];
389 +       
390 +                                                                       this.accountsData[results[i].alias].push({
391 +                                                                               accountId: results[i]._id, 
392 +                                                                               username: results[i].username});
393 +                                                               }
394 +                                                       }
395 +                                               }
396 +                                       }
397 +                               }
398 +                       }
399 +
400                         //Assume we only have SMS and IM for Messaging, only have one SMS
401                         if (results && results.length > 1) {
402                                 this.toEnableAddBuddyMenuItem = true;
403 @@ -136,6 +161,8 @@
404                 }.bind(this);
405                 
406                 this.updateAvailability = function(results) {
407 +                       this.availabilityData = {};
408 +                                       
409                         //Mojo.Log.info("this.updateAvailability: %j",results);
410                         Mojo.Log.info("Number of IM transports: "+results.length);
411                         if( results && results.length > 0 ) {
412 @@ -156,6 +183,13 @@
413                                 var isPending = false;
414                                 for (var i = 0; i < results.length && !isPending; i++) {
415                                         var account = results[i];
416 +                                       
417 +                                       this.availabilityData[account.accountId] = {
418 +                                               objectId: account._id,
419 +                                               availability: account.availability,
420 +                                               customMessage: account.customMessage
421 +                                       };
422 +                                       
423                                         Mojo.Log.info("username=%s, availability=%d, state=%s", account.username, account.availability, account.state);
424                                         // If an account is not offline, then we can clear out any notifications
425                                         // that may have been queued from losing wifi connectivity when the screen turned off
426 @@ -216,7 +250,11 @@
427                 this.handleHistoryListDelete = this.handleHistoryListDelete.bindAsEventListener(this);
428                 this.handleBuddyListTap = this.handleBuddyListTap.bindAsEventListener(this);
429                 this.handleAvailabilityPickerTap = this.handleAvailabilityPickerTap.bindAsEventListener(this);
430 -               this.customMessageUpdate = this.customMessageUpdate.bind(this);
431 +               this.handleAvailabilityPickerHold = this.handleAvailabilityPickerHold.bindAsEventListener(this);
432 +               this.customMessageSelect = this.customMessageSelect.bindAsEventListener(this);
433 +               this.customMessageCancel = this.customMessageCancel.bindAsEventListener(this);
434 +               this.customMessageUpdateTap = this.customMessageUpdate.bindAsEventListener(this, true);
435 +               this.customMessageUpdateHold = this.customMessageUpdate.bindAsEventListener(this, false);
436                 this.handleScreenStateChange = this.handleScreenStateChange.bind(this);
437                 this.handleFocus = this.handleFocus.bind(this);
438                 this.handleLoseFocus = this.handleLoseFocus.bind(this);
439 @@ -418,7 +456,9 @@
440                                 }.bind(this),
441                                 template: 'listview/historyList-divider'
442                         },
443 -                       swipeDelete: true,
444 +                       swipeDelete: {
445 +                               autoConfirm: !this.Messaging.messagingPrefs.getUseDeleteConfirmation()
446 +                       },
447                         uniquenessProperty: '_id',
448                         revisionProperty: '_rev',
449                         delay: 500
450 @@ -650,6 +690,54 @@
451         },
452         
453         handleAvailabilityPickerTap: function(event) {
454 +               var accountsList = [];
455 +               var accountNames = {};
456 +
457 +               for(var alias in this.accountsData) {
458 +                       accountsList.push({label: alias});
459 +                       
460 +                       var listLength = accountsList.length;
461 +                       
462 +                       for(var i = 0; i < this.accountsData[alias].length; i++) {
463 +                               if(this.availabilityData[this.accountsData[alias][i].accountId]) {
464 +                                       var availability = this.availabilityData[this.accountsData[alias][i].accountId].availability;
465 +                       
466 +                                       if(availability == this.Messaging.Availability.AVAILABLE)
467 +                                               var icon = 'status-available';
468 +                                       else if(availability == this.Messaging.Availability.BUSY)
469 +                                               var icon = 'status-away';
470 +                                       else if(availability == this.Messaging.Availability.INVISIBLE)
471 +                                               var icon = 'status-invisible';
472 +                                       else
473 +                                               var icon = 'status-offline';
474 +                       
475 +                                       accountNames[this.accountsData[alias][i].accountId] = alias + " - " + this.accountsData[alias][i].username;
476 +                       
477 +                                       accountsList.push({
478 +                                               label: this.accountsData[alias][i].username, 
479 +                                               command: this.accountsData[alias][i].accountId, 
480 +                                               secondaryIcon: icon});
481 +                               }
482 +                       }
483 +                       
484 +                       if(listLength == accountsList.length)
485 +                               accountsList.splice(listLength - 1, 1);
486 +               }
487 +               
488 +               if(accountsList.length <= 2)
489 +                       this.handleAvailabilityPickerHold(event);
490 +               else {
491 +                       this.controller.popupSubmenu({
492 +                               onChoose: this.handleAccountSelection.bind(this, event.target, accountNames),
493 +                               placeNear: event.target,
494 +                               items: accountsList
495 +                       });
496 +               }
497 +       },
498 +
499 +       handleAvailabilityPickerHold: function(event) {
500 +               event.stop();
501 +               
502                 this.controller.popupSubmenu({
503                         onChoose: this.handleAvailabilitySelection.bind(this),
504                         toggleCmd: this.Messaging.Availability.getAvailabilityAsConstText(this.currentAvailability),
505 @@ -667,10 +755,12 @@
506                         this.customMessageTextWidgetModel.value = "";
507                         this.customMessageTextWidgetModel.disabled = true;
508                 } else {
509 +                       this.customMessageTextWidgetModel.value = "";
510                         this.customMessageTextWidgetModel.disabled = false;
511 -                       if (this.customMessage) {
512 +/*                     if (this.customMessage) {
513                                 this.customMessageTextWidgetModel.value = this.customMessage;
514                         }
515 +*/
516                 }
517                 
518                 if (update) {
519 @@ -701,10 +791,13 @@
520                 // the checkmark image to commit changes
521                 this.customMessageField = this.controller.get('customMessageTextWidget').querySelector('[name=customMessageTextElement]');
522                 //this.customMessage = this.customMessageField.value;
523 -               this.customMessageField.observe('blur', this.customMessageUpdate);
524 +               this.customMessageField.observe('focus', this.customMessageSelect);
525 +               this.customMessageField.observe('blur', this.customMessageCancel);
526                 this.customMessageField.observe('keyup', this.handleCustomMessageFieldKeyUp);
527 -               this.commitCustomMessageElement.observe(Mojo.Event.tap, this.customMessageUpdate);
528 +               this.commitCustomMessageElement.observe(Mojo.Event.tap, this.customMessageUpdateTap);
529 +               this.commitCustomMessageElement.observe(Mojo.Event.hold, this.customMessageUpdateHold);
530                 this.availabilityPickerElement.observe(Mojo.Event.tap, this.handleAvailabilityPickerTap);
531 +               this.availabilityPickerElement.observe(Mojo.Event.hold, this.handleAvailabilityPickerHold);
532  
533                 this.controller.document.addEventListener(Mojo.Event.stageActivate, this.handleFocus, false);
534                 this.controller.document.addEventListener(Mojo.Event.stageDeactivate, this.handleLoseFocus, false);
535 @@ -1752,10 +1845,13 @@
536                 this.historyIndexedList.stopObserving(Mojo.Event.listTap, this.handleHistoryListTap);
537                 this.historyIndexedList.stopObserving(Mojo.Event.listDelete, this.handleHistoryListDelete);
538                 this.buddyIndexedList.stopObserving(Mojo.Event.listTap, this.handleBuddyListTap);
539 -               this.customMessageField.stopObserving('blur', this.customMessageUpdate);
540 +               this.customMessageField.stopObserving('focus', this.customMessageSelect);
541 +               this.customMessageField.stopObserving('blur', this.customMessageCancel);
542                 this.customMessageField.stopObserving('keyup', this.handleCustomMessageFieldKeyUp);
543 -               this.commitCustomMessageElement.stopObserving(Mojo.Event.tap, this.customMessageUpdate);
544 +               this.commitCustomMessageElement.stopObserving(Mojo.Event.tap, this.customMessageUpdateTap);
545 +               this.commitCustomMessageElement.stopObserving(Mojo.Event.hold, this.customMessageUpdateHold);
546                 this.availabilityPickerElement.stopObserving(Mojo.Event.tap, this.handleAvailabilityPickerTap);
547 +               this.availabilityPickerElement.stopObserving(Mojo.Event.hold, this.handleAvailabilityPickerHold);
548                 this.Messaging.DisplayState.stopObserving(this.handleScreenStateChange);
549                 this.controller.document.removeEventListener(Mojo.Event.stageActivate, this.handleFocus, false);
550                 this.controller.document.removeEventListener(Mojo.Event.stageDeactivate, this.handleLoseFocus, false);
551 @@ -1763,6 +1859,50 @@
552                 this.Messaging.listviewSceneAssistant = null; // null out the reference to the listview so that it can get garbage collected
553         },
554  
555 +       handleAccountSelection: function(target, accountNames, accountId) {
556 +               if(accountId) {
557 +                       var availabilityList = [{label: accountNames[accountId]}];
558 +                       
559 +                       availabilityList = availabilityList.concat(this.availabilities);
560 +               
561 +                       var currentAvailability = this.Messaging.Availability.getAvailabilityAsConstText(this.Messaging.Availability.OFFLINE);
562 +
563 +                       if(this.availabilityData[accountId]) {
564 +                               var availability = this.availabilityData[accountId].availability;
565 +                               
566 +                               currentAvailability = this.Messaging.Availability.getAvailabilityAsConstText(availability);
567 +                       }
568 +       
569 +                       this.controller.popupSubmenu({
570 +                               onChoose: this.handleAccountAvailabilitySelection.bind(this, accountId),
571 +                               toggleCmd: currentAvailability,
572 +                               placeNear: target,
573 +                               items: availabilityList
574 +                       });
575 +               }
576 +       },
577 +       
578 +       handleAccountAvailabilitySelection: function(accountId, availabilityString) {
579 +               if((availabilityString) && (this.availabilityData[accountId])) {
580 +                       var availabilityInteger = this.Messaging.Availability.getAvailabilityAsInteger(availabilityString);
581 +
582 +                       MessagingDB.IMLoginState.setAvailability(availabilityInteger, this.availabilityData[accountId].objectId);
583 +
584 +                       if(availabilityInteger < 4) {
585 +                               for(var i = 0; i < this.appController.Messaging.IMAccounts.data.length; i++) {
586 +                                        var capability = this.appController.Messaging.IMAccounts.data[i].capabilityProviders;
587 +
588 +                                        for (var j = 0; j< capability.length; j++) {
589 +                                               if(capability[j].capability === "MESSAGING" && capability[j].wanOnly === true){
590 +                                                       this.checkWANConnection(capability[j]);
591 +                                                       break;
592 +                                               }
593 +                                       }
594 +                               }
595 +                       }
596 +               }
597 +       },
598 +       
599         handleAvailabilitySelection: function(availabilityString) {
600                 var availabilityInteger;
601                 
602 @@ -1879,15 +2019,133 @@
603                         this.appController.notificationAssistant.clearMessageDashboard();
604                 }
605         },
606 -       
607 -       customMessageUpdate: function(e) {
608 +
609 +       customMessageUpdate: function(e, select, accountId) {
610 +               e.stop();
611 +               
612 +               if(select) {
613 +                       var count = 0;
614 +                       var accountsList = [];
615 +
616 +                       for(var alias in this.accountsData) {
617 +                               accountsList.push({label: alias});
618 +
619 +                               var listLength = accountsList.length;
620 +
621 +                               for(var i = 0; i < this.accountsData[alias].length; i++) {
622 +                                       if(this.availabilityData[this.accountsData[alias][i].accountId]) {
623 +                                               count++;
624 +                                       
625 +                                               var availability = this.availabilityData[this.accountsData[alias][i].accountId].availability;
626 +                                       
627 +                                               if((availability != this.Messaging.Availability.OFFLINE) && 
628 +                                                       (availability != this.Messaging.Availability.PENDING))
629 +                                               {
630 +                                                       accountsList.push({
631 +                                                               label: this.accountsData[alias][i].username, 
632 +                                                               command: this.accountsData[alias][i].accountId});
633 +                                               }
634 +                                       }
635 +                               }
636 +                               
637 +                               if(listLength == accountsList.length)
638 +                                       accountsList.splice(listLength - 1, 1);
639 +                       }
640 +               
641 +                       if(count > 1) {
642 +                               this.controller.popupSubmenu({
643 +                                       onChoose: this.customMessageUpdate.bind(this, e, false),
644 +                                       placeNear: e.target,
645 +                                       items: accountsList
646 +                               });
647 +
648 +                               return;
649 +                       }
650 +               }
651 +
652 +               var objectId = null;
653 +
654 +               if((accountId) && (this.availabilityData[accountId]))
655 +                       objectId = this.availabilityData[accountId].objectId;
656 +
657                 var newMessage = this.customMessageField.value;
658                 // Set the new custom message if it has changed or if it has been cleared
659 -               if ((newMessage.length > 0 && newMessage !== this.customMessage) ||
660 -               (newMessage.length === 0 && this.customMessage.length > 0)) {
661 +//             if ((newMessage.length > 0 && newMessage !== this.customMessage) ||
662 +//             (newMessage.length === 0 && this.customMessage.length > 0)) {
663                         this.customMessage = newMessage;
664 -                       MessagingDB.IMLoginState.setCustomMessage(this.customMessage);
665 +                       MessagingDB.IMLoginState.setCustomMessage(this.customMessage, objectId);
666                         this.updateCustomMessageCommitIcon();
667 +//             }
668 +
669 +               this.controller.get('customMessageTextWidget').mojo.blur();
670 +       },
671 +       
672 +       customMessageSelect: function(event) {
673 +               var messagesList = [];
674 +               this.customMessage = null;                      
675 +
676 +               this.customMessageTextWidgetModel.value = "";
677 +               this.controller.modelChanged(this.customMessageTextWidgetModel);
678 +
679 +               messagesList.push({label: $L("New custom message..."), command: "empty"});
680 +
681 +               for(var alias in this.accountsData) {
682 +                       for(var i = 0; i < this.accountsData[alias].length; i++) {
683 +                               if(this.availabilityData[this.accountsData[alias][i].accountId]) {
684 +                                       if((this.availabilityData[this.accountsData[alias][i].accountId].customMessage) &&
685 +                                               (this.availabilityData[this.accountsData[alias][i].accountId].customMessage.length > 0))
686 +                                       {
687 +                                               messagesList.push({label: alias + " - " + this.accountsData[alias][i].username});
688 +
689 +                                               messagesList.push({
690 +                                                       label: this.availabilityData[this.accountsData[alias][i].accountId].customMessage, 
691 +                                                       command: this.accountsData[alias][i].accountId});
692 +                                       }
693 +                               }
694 +                       }
695 +               }
696 +       
697 +               if(messagesList.length > 2) {
698 +                       this.controller.popupSubmenu({
699 +                               onChoose: this.customMessageFill.bind(this),
700 +                               placeNear: event.target,
701 +                               items: messagesList
702 +                       });
703 +               }
704 +               else
705 +                       this.controller.get('commitCustomMessage').show();
706 +       },
707 +       
708 +       customMessageCancel: function(event) {
709 +               this.customMessage = '';
710 +       
711 +               this.customMessageTextWidgetModel.value = '';
712 +               this.controller.modelChanged(this.customMessageTextWidgetModel);
713 +
714 +               this.updateCustomMessageCommitIcon();
715 +       },
716 +       
717 +       customMessageFill: function(accountId) {
718 +               if(accountId) {
719 +                       if(accountId == "empty") {
720 +                               this.controller.get('commitCustomMessage').show();
721 +                       }
722 +                       else {
723 +                               if((this.availabilityData[accountId]) && 
724 +                                       (this.availabilityData[accountId].customMessage) &&
725 +                                       (this.availabilityData[accountId].customMessage.length > 0))
726 +                               {
727 +                                       var msg = this.availabilityData[accountId].customMessage;
728 +               
729 +                                       this.customMessageTextWidgetModel.value = msg;
730 +                                       this.controller.modelChanged(this.customMessageTextWidgetModel);
731 +
732 +                                       this.updateCustomMessageCommitIcon();
733 +                               }
734 +                       }
735 +               }
736 +               else {
737 +                       this.customMessageCancel();
738                 }
739         },
740         
741 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/notification-assistant.js
742 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/notification-assistant.js
743 @@ -9,6 +9,7 @@
744         // a reference to this is passed to the dashboard assistant
745         this.messageDashboardData = {};
746         this.inviteDashboardData = {};
747 +       this.notificationsData = {};
748         this.class0AlertData = {
749                 list: []
750         };
751 @@ -230,20 +231,72 @@
752   */
753  
754  NotificationAssistant.prototype.considerForNotification = function(notificationData){
755 -       if (!this.Messaging.messagingPrefs.getNotificationsEnabled()) {
756 +       if(!notificationData.message)
757 +               return;
758 +
759 +       if (!this.Messaging.messagingPrefs.getNotificationsEnabled(notificationData.message.serviceName)) {
760                 Mojo.Log.info("Notification Assistant - Consider for Notification - Notifications are disabled");       
761                 return;
762         }
763         
764         // check if we should only play a sound (when you are already in a chat & a new message comes in)
765 -       if(notificationData.playSoundOnly && this.Messaging.messagingPrefs.getNotificationSound()) {
766 +       if(notificationData.playSoundOnly && this.Messaging.messagingPrefs.getNotificationSound(notificationData.message.serviceName)) {
767                 var notifParams = {};
768 -               this.setNotificationSound(notifParams);
769 -               this.controller.playSoundNotification(notifParams.soundClass, notifParams.soundFile);
770 +
771 +               var future;
772 +               if (MessagingLib.Utils.isTextMessage(notificationData.message.serviceName)) {
773 +                       future = ContactsLib.Person.findByPhone(notificationData.message.from.addr);
774 +               }
775 +               else {
776 +                       future = ContactsLib.Person.findByIM(notificationData.message.from.addr, notificationData.message.serviceName);
777 +               }
778 +               
779 +               future.then(this, function(future){
780 +                       if (future.result) {
781 +                               if(MessagingLib.Utils.isTextMessage(notificationData.message.serviceName)) {
782 +                                       notificationData.soundClass = future.result.getMsgAlert().getAlert();
783 +                                       notificationData.ringtonePath = future.result.getMsgRingtone().getLocation();
784 +                               }
785 +                               else {
786 +                                       notificationData.soundClass = future.result.getIMsgAlert().getAlert();
787 +                                       notificationData.ringtonePath = future.result.getIMsgRingtone().getLocation();
788 +                               }
789 +                                                       
790 +                               this.setNotificationSound(notifParams, notificationData);
791 +                               this.controller.playSoundNotification(notifParams.soundClass, notifParams.soundFile);
792 +
793 +                               future.result = future.result;
794 +                       }
795 +                       else if(MessagingLib.Utils.isTextMessage(notificationData.message.serviceName)) {
796 +                               if(this.contactPrefs)
797 +                                       delete this.contactPrefs;
798 +       
799 +                               this.contactPrefs = new ContactsLib.AppPrefs(function(future) {
800 +                                       var prefs = this.contactPrefs.get(ContactsLib.AppPrefs.Pref.unknownContacts);
801 +
802 +                                       if((prefs) && (prefs.msgAlert)) {
803 +                                               notificationData.soundClass = prefs.msgAlert;
804 +                                               notificationData.ringtonePath = prefs.msgRingtonePath;
805 +                                       }
806 +                                       
807 +                                       this.setNotificationSound(notifParams, notificationData);
808 +                                       this.controller.playSoundNotification(notifParams.soundClass, notifParams.soundFile);
809 +                                                                               
810 +                                       future.result = future.result;
811 +                               }.bind(this, future));                  
812 +                       }
813 +                       else {
814 +                               this.setNotificationSound(notifParams, notificationData);
815 +                               this.controller.playSoundNotification(notifParams.soundClass, notifParams.soundFile);
816 +
817 +                               future.result = future.result;
818 +                       }
819 +               });
820 +               
821                 return; // don't display any visual notification
822         }       
823         //TODO: does sendFailure and connectionFailure need displayName?
824 -       if (Object.keys(notificationData).length > 0 && this.Messaging.messagingPrefs.getNotificationsEnabled()) {
825 +       if (Object.keys(notificationData).length > 0 && this.Messaging.messagingPrefs.getNotificationsEnabled(notificationData.message.serviceName)) {
826                 var notificationType = notificationData.notificationType;
827                 if (notificationType === this.Messaging.notificationTypes.newMessage) {
828                         this.preSendNewMessageNotificationAndUpdateDashboard(notificationData);
829 @@ -344,17 +397,51 @@
830                 
831                 future.then(this, function(future){
832                         if (future.result) {
833 +                               if(MessagingLib.Utils.isTextMessage(notificationData.message.serviceName)) {
834 +                                       notificationData.soundClass = future.result.getMsgAlert().getAlert();
835 +                                       notificationData.ringtonePath = future.result.getMsgRingtone().getLocation();
836 +                               }
837 +                               else {
838 +                                       notificationData.soundClass = future.result.getIMsgAlert().getAlert();
839 +                                       notificationData.ringtonePath = future.result.getIMsgRingtone().getLocation();
840 +                               }
841 +                                                       
842                                 notificationData.message.displayName = future.result.generateDisplayName(false);
843 +
844 +                               future.result = future.result;
845 +                               this.sendNewMessageNotificationAndUpdateDashboard(notificationData);
846 +                       }
847 +                       else if(MessagingLib.Utils.isTextMessage(notificationData.message.serviceName)) {
848 +                               if(this.contactPrefs)
849 +                                       delete this.contactPrefs;
850 +       
851 +                               this.contactPrefs = new ContactsLib.AppPrefs(function(future) {
852 +                                       var prefs = this.contactPrefs.get(ContactsLib.AppPrefs.Pref.unknownContacts);
853 +
854 +                                       if((prefs) && (prefs.msgAlert)) {
855 +                                               notificationData.soundClass = prefs.msgAlert;
856 +                                               notificationData.ringtonePath = prefs.msgRingtonePath;
857 +
858 +                                               this.sendNewMessageNotificationAndUpdateDashboard(notificationData, true);
859 +                                       }
860 +                                       else
861 +                                               this.sendNewMessageNotificationAndUpdateDashboard(notificationData);
862 +                                       
863 +                                       future.result = future.result;
864 +
865 +                               }.bind(this, future));                  
866 +                       }
867 +                       else {
868 +                               future.result = future.result;
869 +                               this.sendNewMessageNotificationAndUpdateDashboard(notificationData);
870                         }
871 -                       future.result = future.result;
872 -                       this.sendNewMessageNotificationAndUpdateDashboard(notificationData);
873                 });
874         }
875         else {
876                 this.sendNewMessageNotificationAndUpdateDashboard(notificationData);
877         }
878  };
879 -NotificationAssistant.prototype.sendNewMessageNotificationAndUpdateDashboard = function(notificationData){
880 +NotificationAssistant.prototype.sendNewMessageNotificationAndUpdateDashboard = function(notificationData, unknownContact){
881         var messageData = notificationData.message;
882         var chatThreadId;
883         if(messageData.conversations !== undefined && messageData.conversations.length > 0) {
884 @@ -411,7 +498,7 @@
885         var bannerParams = {
886                 messageText: notificationText
887         };
888 -       this.setNotificationSound(bannerParams);
889 +       this.setNotificationSound(bannerParams, notificationData);
890         var bannerLaunchParams =  {
891                 chatThreadId: chatThreadId,
892                 clearBanner: true               
893 @@ -480,11 +567,16 @@
894         var dashboard = this.controller.getStageController(dashboardStagename);
895         
896         if (dashboard) {
897 -               dashboard.delegateToSceneAssistant("update", true);
898 +               if(this.Messaging.messagingPrefs.getNotificationBlink(notificationData.message.serviceName))
899 +                       dashboard.delegateToSceneAssistant("update", true);
900 +               else
901 +                       dashboard.delegateToSceneAssistant("update", false);            
902         } else {
903 +               var blinkNotify = this.Messaging.messagingPrefs.getNotificationBlink(notificationData.message.serviceName);
904 +       
905                 // Create a dashboard
906                 var f = function(stageController){
907 -                       stageController.pushScene('dashboardMessage', dashboardData);
908 +                       stageController.pushScene('dashboardMessage', dashboardData, blinkNotify);
909                 }.bind(this);
910                 var params = {
911                         name: dashboardStagename,
912 @@ -509,6 +601,9 @@
913                         createDashboard(); // if the screen is off, create the dashboard right away
914                 }
915         }
916 +       
917 +       if(!unknownContact)
918 +               this.schedulePlayNotificationSoundTasks(notificationData.message.serviceName);
919  };
920  
921  // ISSUES: what are the error types?  What is the max number / types of dashboards that we could have?
922 @@ -542,7 +637,7 @@
923         var bannerParams = {
924                 messageText: notificationText.escapeHTML()
925         };
926 -       if (this.Messaging.messagingPrefs.getNotificationSound() !== "mute") {
927 +       if (this.Messaging.messagingPrefs.getNotificationSound(notificationData.message.serviceName) !== "mute") {
928                 bannerParams.soundClass = "alerts";     
929         }
930         var bannerLaunchParams =  {
931 @@ -747,6 +842,8 @@
932  };
933  
934  NotificationAssistant.prototype.clearNotificationsForChat = function(chatThreadId){    
935 +       this.removePlayNotificationSoundTasks();
936 +
937         var i;
938         var newestTimestamp = 0;
939         var newestChat;
940 @@ -841,6 +938,8 @@
941  };
942  
943  NotificationAssistant.prototype.resetNewMessages = function(){
944 +       this.removePlayNotificationSoundTasks();
945 +               
946         this.messageDashboardData = {};
947  };
948  
949 @@ -849,8 +948,12 @@
950  };
951  
952  NotificationAssistant.prototype.clearMessageDashboard = function(){
953 -       var dashboard = this.controller.getStageController(DashboardMessageStageName);
954 +       this.removePlayNotificationSoundTasks();
955 +
956         this.messageDashboardData = {};
957 +
958 +       var dashboard = this.controller.getStageController(DashboardMessageStageName);
959 +
960         if (dashboard) {
961                 dashboard.delegateToSceneAssistant("closeDashboard");
962         }
963 @@ -884,15 +987,26 @@
964         }
965  };
966  
967 -NotificationAssistant.prototype.setNotificationSound = function(bannerParams){
968 -       switch (this.Messaging.messagingPrefs.getNotificationSound()) {
969 +NotificationAssistant.prototype.setNotificationSound = function(bannerParams, notificationData){
970 +       var soundClass = this.Messaging.messagingPrefs.getNotificationSound(notificationData.message.serviceName);
971 +       var ringtonePath = this.Messaging.messagingPrefs.getRingtone(notificationData.message.serviceName).path;
972 +
973 +       if((notificationData.soundClass != undefined) && 
974 +               (notificationData.soundClass != "") &&
975 +               (notificationData.soundClass != "default"))
976 +       {
977 +               soundClass = notificationData.soundClass;
978 +               ringtonePath = notificationData.ringtonePath;           
979 +       }
980 +       
981 +       switch (soundClass) {
982                 case "alert": 
983                         bannerParams.soundClass = "notifications";
984                         bannerParams.soundFile = undefined;
985                         break;
986                 case "ringtone":
987                         bannerParams.soundClass = "notifications";
988 -                       bannerParams.soundFile = this.Messaging.messagingPrefs.getRingtone().path;
989 +                       bannerParams.soundFile = ringtonePath;
990                         break;
991                 case "vibrate":
992                         bannerParams.soundClass = "vibrate";
993 @@ -907,4 +1021,74 @@
994         Mojo.Log.info("setNotificationSound result=%j", bannerParams);
995  };
996  
997 +NotificationAssistant.prototype.schedulePlayNotificationSoundTasks = function(serviceName) {
998 +       var repeatDelay = 0;
999 +       var currentTime = new Date();
1000 +
1001 +       if(this.notificationsData[serviceName] == undefined)
1002 +               this.notificationsData[serviceName] = 0;
1003 +       
1004 +       for(var serviceName in this.notificationsData) {
1005 +               if(this.Messaging.messagingPrefs.getNotificationsEnabled(serviceName) == false) {
1006 +                       delete this.notificationsData[serviceName];
1007 +               }
1008 +               else if((this.Messaging.messagingPrefs.getNotificationSound(serviceName) != "mute") &&
1009 +                       (this.Messaging.messagingPrefs.getRepeatInterval(serviceName) != 0))
1010 +               {
1011 +                       if(this.notificationsData[serviceName]++ >= this.Messaging.messagingPrefs.getRepeatLimit(serviceName)) {
1012 +                               delete this.notificationsData[serviceName];
1013 +                       }
1014 +                       else {
1015 +                               var repeatInterval = this.Messaging.messagingPrefs.getRepeatInterval(serviceName);
1016 +               
1017 +                               var playSoundTime = new Date(currentTime.getTime() + (parseInt(repeatInterval) * 1000) + (repeatDelay++ * 10));
1018 +
1019 +                               var month = playSoundTime.getUTCMonth()+1;
1020 +                               if(month < 10) month = "0" + month;
1021 +                               var day = playSoundTime.getUTCDate();
1022 +                               if(day < 10) day = "0" + day;
1023 +                               var year = playSoundTime.getUTCFullYear();
1024 +
1025 +                               var hours = playSoundTime.getUTCHours();
1026 +                               if(hours < 10) hours = "0" + hours;
1027 +                               var minutes = playSoundTime.getUTCMinutes();
1028 +                               if(minutes < 10) minutes = "0" + minutes;
1029 +                               var seconds = playSoundTime.getUTCSeconds();
1030 +                               if(seconds < 10) seconds = "0" + seconds;
1031 +
1032 +                               var scheduledTimeStr = month + "/" + day + "/" + year + " " + hours + ":" + minutes + ":" + seconds;
1033 +               
1034 +                               this.updateTimeoutRequest = new Mojo.Service.Request('palm://com.palm.power/timeout/', {
1035 +                                       'method': "set", 'parameters': { 'key': 'messagingPlayNotificationSound-' + serviceName, 
1036 +                                       'wakeup': true, 'at': scheduledTimeStr, 'uri': "palm://com.palm.applicationManager/open", 
1037 +                                       'params': {'id': 'com.palm.app.messaging', 'params': {'serviceName': serviceName,
1038 +                                               'playNotificationSound': this.notificationsData[serviceName]}}} }); 
1039 +                       }
1040 +               }
1041 +       }
1042 +};
1043 +       
1044 +NotificationAssistant.prototype.removePlayNotificationSoundTasks = function() {
1045 +       for(var serviceName in this.notificationsData) {
1046 +               if(this.notificationsData[serviceName] > 0) {
1047 +                       this.removeTimeoutRequest = new Mojo.Service.Request("palm://com.palm.power/timeout/", {
1048 +                               'method': "clear", 'parameters': {"key": 'messagingPlayNotificationSound-' + serviceName} });
1049 +               }
1050 +       }
1051 +       
1052 +       this.notificationsData = {};
1053 +};
1054 +
1055 +NotificationAssistant.prototype.playNotificationSound = function(serviceName) {
1056 +       var notifyType = this.Messaging.messagingPrefs.getNotificationSound(serviceName);
1057 +
1058 +       var ringtonePath = this.Messaging.messagingPrefs.getRingtone(serviceName).path;
1059 +               
1060 +       if(notifyType == "ringtone")
1061 +               this.controller.playSoundNotification("notifications", ringtonePath);
1062 +       else if(notifyType == "alert")
1063 +               this.controller.playSoundNotification("notifications");
1064 +       else if(notifyType == "vibrate")
1065 +               this.controller.playSoundNotification("vibrate");       
1066 +};
1067  
1068 --- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
1069 +++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
1070 @@ -150,6 +150,10 @@
1071                 margin: 1px -4px 0px -4px;
1072  }
1073  
1074 +.buddy-list .palm-row {
1075 +               height: auto;
1076 +}
1077 +
1078  /* background: url(../images/simple-splitter.png) bottom left repeat-x;*/
1079  
1080  #groups-list .showGroup {
1081 @@ -1187,6 +1191,23 @@
1082  
1083  /* Preferences */
1084  
1085 +.palm-account-icon.left {
1086 +       float: left;
1087 +}
1088 +.palm-page-header .palm-account-icon {
1089 +       position: absolute;
1090 +       left: 0px;
1091 +       top: 0px;
1092 +       min-height: 52px;
1093 +       width: 56px;
1094 +}
1095 +.default-account-list.palm-account-icon {
1096 +       margin: 0px -5px 0px 10px;
1097 +}
1098 +.palm-account-icon {
1099 +    background: url(../images/serviceicon-sms.png) center center no-repeat;
1100 +}
1101 +
1102  .text-group .title {
1103                 line-height: auto !important;
1104                 padding: 0 !important;
1105 --- .orig/usr/palm/applications/com.palm.app.messaging/app/models/messaging-prefs.js
1106 +++ /usr/palm/applications/com.palm.app.messaging/app/models/messaging-prefs.js
1107 @@ -13,7 +13,7 @@
1108  
1109                 var future = MojoDB.find({
1110                         from: MessagingPrefsService.prefsDB
1111 -               });
1112 +               }, true);
1113  
1114                 future.then(this, function(future) {
1115                         if (future.result.results && future.result.results.length === 0) {
1116 @@ -87,7 +87,18 @@
1117                 }
1118         },
1119         
1120 -       getNotificationsEnabled: function() {
1121 +       getNotificationsEnabled: function(serviceName) {
1122 +               if((serviceName != undefined) && (serviceName != "sms")) {
1123 +                       if (this._prefs === undefined || this._prefs.accountNotifications === undefined ||
1124 +                               this._prefs.accountNotifications[serviceName] === undefined || 
1125 +                               this._prefs.accountNotifications[serviceName].enableNotification === undefined) 
1126 +                       {
1127 +                               return this._getDefaultPrefs().enableNotification;
1128 +                       } else {
1129 +                               return this._prefs.accountNotifications[serviceName].enableNotification;
1130 +                       }
1131 +               }
1132 +               
1133                 if (this._prefs === undefined || this._prefs.enableNotification === undefined) {
1134                         return this._getDefaultPrefs().enableNotification;
1135                 } else {
1136 @@ -95,11 +106,69 @@
1137                 }
1138         },
1139         
1140 -       setNotificationsEnabled: function(enabled) {
1141 -               this._dbMerge({enableNotification:enabled});
1142 +       setNotificationsEnabled: function(enabled, serviceName) {
1143 +               if((serviceName != undefined) && (serviceName != "sms")) {
1144 +                       if (this._prefs.accountNotifications === undefined)
1145 +                               this._prefs.accountNotifications = {};
1146 +
1147 +                       if (this._prefs.accountNotifications[serviceName] === undefined)
1148 +                               this._prefs.accountNotifications[serviceName] = {};
1149 +                       
1150 +                       this._prefs.accountNotifications[serviceName].enableNotification = enabled;
1151 +
1152 +                       this._dbMerge({accountNotifications:this._prefs.accountNotifications});
1153 +               }
1154 +               else
1155 +                       this._dbMerge({enableNotification:enabled});
1156 +       },
1157 +       
1158 +       getNotificationBlink: function(serviceName) {
1159 +               if((serviceName != undefined) && (serviceName != "sms")) {
1160 +                       if (this._prefs === undefined || this._prefs.accountNotifications === undefined ||
1161 +                               this._prefs.accountNotifications[serviceName] === undefined || 
1162 +                               this._prefs.accountNotifications[serviceName].blinkNotification === undefined) 
1163 +                       {
1164 +                               return this._getDefaultPrefs().blinkNotification;
1165 +                       } else {
1166 +                               return this._prefs.accountNotifications[serviceName].blinkNotification;
1167 +                       }
1168 +               }
1169 +               
1170 +               if (this._prefs === undefined || this._prefs.blinkNotification === undefined) {
1171 +                       return this._getDefaultPrefs().blinkNotification;
1172 +               } else {
1173 +                       return this._prefs.blinkNotification;
1174 +               }
1175         },
1176         
1177 -       getNotificationSound: function() {
1178 +       setNotificationBlink: function(blink, serviceName) {
1179 +               if((serviceName != undefined) && (serviceName != "sms")) {
1180 +                       if (this._prefs.accountNotifications === undefined)
1181 +                               this._prefs.accountNotifications = {};
1182 +
1183 +                       if (this._prefs.accountNotifications[serviceName] === undefined)
1184 +                               this._prefs.accountNotifications[serviceName] = {};
1185 +                       
1186 +                       this._prefs.accountNotifications[serviceName].blinkNotification = blink;
1187 +
1188 +                       this._dbMerge({accountNotifications:this._prefs.accountNotifications});
1189 +               }
1190 +               else
1191 +                       this._dbMerge({blinkNotification:blink});
1192 +       },
1193 +
1194 +       getNotificationSound: function(serviceName) {
1195 +               if((serviceName != undefined) && (serviceName != "sms")) {
1196 +                       if (this._prefs === undefined || this._prefs.accountNotifications === undefined ||
1197 +                               this._prefs.accountNotifications[serviceName] === undefined || 
1198 +                               this._prefs.accountNotifications[serviceName].notificationSound === undefined) 
1199 +                       {
1200 +                               return this._getDefaultPrefs().notificationSound;
1201 +                       } else {
1202 +                               return this._prefs.accountNotifications[serviceName].notificationSound;
1203 +                       }
1204 +               }
1205 +               
1206                 if (this._prefs === undefined || this._prefs.notificationSound === undefined) {
1207                         return this._getDefaultPrefs().notificationSound;
1208                 } else {
1209 @@ -107,11 +176,34 @@
1210                 }
1211         },
1212         
1213 -       setNotificationSound: function(sound) {
1214 -               this._dbMerge({notificationSound:sound});
1215 +       setNotificationSound: function(sound, serviceName) {
1216 +               if((serviceName != undefined) && (serviceName != "sms")) {
1217 +                       if (this._prefs.accountNotifications === undefined)
1218 +                               this._prefs.accountNotifications = {};
1219 +
1220 +                       if (this._prefs.accountNotifications[serviceName] === undefined)
1221 +                               this._prefs.accountNotifications[serviceName] = {};
1222 +                       
1223 +                       this._prefs.accountNotifications[serviceName].notificationSound = sound;
1224 +
1225 +                       this._dbMerge({accountNotifications:this._prefs.accountNotifications});
1226 +               }
1227 +               else
1228 +                       this._dbMerge({notificationSound:sound});
1229         },
1230         
1231 -       getRingtone: function() {
1232 +       getRingtone: function(serviceName) {
1233 +               if((serviceName != undefined) && (serviceName != "sms")) {
1234 +                       if (this._prefs === undefined || this._prefs.accountNotifications === undefined ||
1235 +                               this._prefs.accountNotifications[serviceName] === undefined || 
1236 +                               this._prefs.accountNotifications[serviceName].ringtone === undefined)  
1237 +                       {
1238 +                               return this._getDefaultPrefs().ringtone;
1239 +                       } else {
1240 +                               return this._prefs.accountNotifications[serviceName].ringtone;
1241 +                       }
1242 +               }
1243 +               
1244                 if (this._prefs === undefined || this._prefs.ringtone === undefined) {
1245                         return this._getDefaultPrefs().ringtone;
1246                 } else {
1247 @@ -119,11 +211,163 @@
1248                 }
1249         },
1250         
1251 -       setRingtone: function(ringtone) {
1252 +       setRingtone: function(ringtone, serviceName) {
1253                 if (ringtone === undefined) {
1254                         ringtone = {};
1255                 }
1256 -               this._dbMerge({ringtone:ringtone});
1257 +
1258 +               if((serviceName != undefined) && (serviceName != "sms")) {
1259 +                       if (this._prefs.accountNotifications === undefined)
1260 +                               this._prefs.accountNotifications = {};
1261 +
1262 +                       if (this._prefs.accountNotifications[serviceName] === undefined)
1263 +                               this._prefs.accountNotifications[serviceName] = {};
1264 +                       
1265 +                       this._prefs.accountNotifications[serviceName].ringtone = ringtone;
1266 +
1267 +                       this._dbMerge({accountNotifications:this._prefs.accountNotifications});
1268 +               }
1269 +               else
1270 +                       this._dbMerge({ringtone:ringtone});
1271 +       },
1272 +
1273 +       getRepeatInterval: function(serviceName) {
1274 +               if((serviceName != undefined) && (serviceName != "sms")) {
1275 +                       if (this._prefs === undefined || this._prefs.accountNotifications === undefined ||
1276 +                               this._prefs.accountNotifications[serviceName] === undefined || 
1277 +                               this._prefs.accountNotifications[serviceName].repeatInterval === undefined)
1278 +                       {
1279 +                               return this._getDefaultPrefs().repeatInterval;
1280 +                       } else {
1281 +                               return this._prefs.accountNotifications[serviceName].repeatInterval;
1282 +                       }
1283 +               }
1284 +               
1285 +               if (this._prefs === undefined || this._prefs.repeatInterval === undefined) {
1286 +                       return this._getDefaultPrefs().repeatInterval;
1287 +               } else {
1288 +                       return this._prefs.repeatInterval;
1289 +               }
1290 +       },
1291 +       
1292 +       setRepeatInterval: function(interval, serviceName) {
1293 +               if((serviceName != undefined) && (serviceName != "sms")) {
1294 +                       if (this._prefs.accountNotifications === undefined)
1295 +                               this._prefs.accountNotifications = {};
1296 +               
1297 +                       if (this._prefs.accountNotifications[serviceName] === undefined)
1298 +                               this._prefs.accountNotifications[serviceName] = {};
1299 +                       
1300 +                       this._prefs.accountNotifications[serviceName].repeatInterval = interval;
1301 +
1302 +                       this._dbMerge({accountNotifications:this._prefs.accountNotifications});
1303 +               }
1304 +               else
1305 +                       this._dbMerge({repeatInterval:interval});
1306 +       },
1307 +       
1308 +       getRepeatLimit: function(serviceName) {
1309 +               if((serviceName != undefined) && (serviceName != "sms")) {
1310 +                       if (this._prefs === undefined || this._prefs.accountNotifications === undefined ||
1311 +                               this._prefs.accountNotifications[serviceName] === undefined || 
1312 +                               this._prefs.accountNotifications[serviceName].repeatLimit === undefined)
1313 +                       {
1314 +                               return this._getDefaultPrefs().repeatLimit;
1315 +                       } else {
1316 +                               return this._prefs.accountNotifications[serviceName].repeatLimit;
1317 +                       }
1318 +               }
1319 +               
1320 +               if (this._prefs === undefined || this._prefs.repeatLimit === undefined) {
1321 +                       return this._getDefaultPrefs().repeatLimit;
1322 +               } else {
1323 +                       return this._prefs.repeatLimit;
1324 +               }
1325 +       },
1326 +       
1327 +       setRepeatLimit: function(limit, serviceName) {
1328 +               if((serviceName != undefined) && (serviceName != "sms")) {
1329 +                       if(this._prefs.accountNotifications[serviceName] === undefined)
1330 +                               this._prefs.accountNotifications[serviceName] = {};
1331 +                       
1332 +                       this._prefs.accountNotifications[serviceName].repeatLimit = limit;
1333 +
1334 +                       this._dbMerge({accountNotifications:this._prefs.accountNotifications});
1335 +               }
1336 +               else
1337 +                       this._dbMerge({repeatLimit:limit});
1338 +       },
1339 +       
1340 +       getPrependForward: function() {
1341 +               if (this._prefs === undefined || this._prefs.prependForward === undefined) {
1342 +                       return this._getDefaultPrefs().prependForward;
1343 +               } else {
1344 +                       return this._prefs.prependForward;
1345 +               }
1346 +       },
1347 +       
1348 +       setPrependForward: function(forward) {
1349 +               this._dbMerge({prependForward:forward});
1350 +       },
1351 +
1352 +       getMessageGreeting: function() {
1353 +               if (this._prefs === undefined || this._prefs.messageGreeting === undefined) {
1354 +                       return this._getDefaultPrefs().messageGreeting;
1355 +               } else {
1356 +                       return this._prefs.messageGreeting;
1357 +               }
1358 +       },
1359 +       
1360 +       setMessageGreeting: function(greeting) {
1361 +               this._dbMerge({messageGreeting:greeting});
1362 +       },
1363 +
1364 +       getMessageSignature: function() {
1365 +               if (this._prefs === undefined || this._prefs.messageSignature === undefined) {
1366 +                       return this._getDefaultPrefs().messageSignature;
1367 +               } else {
1368 +                       return this._prefs.messageSignature;
1369 +               }
1370 +       },
1371 +       
1372 +       setMessageSignature: function(signature) {
1373 +               this._dbMerge({messageSignature:signature});
1374 +       },
1375 +
1376 +       getUseAutomaticMsgDrafts: function() {
1377 +               if (this._prefs === undefined || this._prefs.useAutomaticMsgDrafts === undefined) {
1378 +                       return this._getDefaultPrefs().useAutomaticMsgDrafts;
1379 +               } else {
1380 +                       return this._prefs.useAutomaticMsgDrafts;
1381 +               }
1382 +       },
1383 +
1384 +       setUseAutomaticMsgDrafts: function(set) {
1385 +               this._dbMerge({useAutomaticMsgDrafts:set});
1386 +       },
1387 +
1388 +       getUseClipboardMsgDrafts: function() {
1389 +               if (this._prefs === undefined || this._prefs.useClipboardMsgDrafts === undefined) {
1390 +                       return this._getDefaultPrefs().useClipboardMsgDrafts;
1391 +               } else {
1392 +                       return this._prefs.useClipboardMsgDrafts;
1393 +               }
1394 +       },
1395 +       
1396 +       setUseClipboardMsgDrafts: function(set) {
1397 +               this._dbMerge({useClipboardMsgDrafts:set});
1398 +       },
1399 +
1400 +       getUseDeleteConfirmation: function() {
1401 +               if (this._prefs === undefined || this._prefs.useDeleteConfirmation === undefined) {
1402 +                       return this._getDefaultPrefs().useDeleteConfirmation;
1403 +               } else {
1404 +                       return this._prefs.useDeleteConfirmation;
1405 +               }
1406 +       },
1407 +
1408 +       setUseDeleteConfirmation: function(set) {
1409 +               this._dbMerge({useDeleteConfirmation:set});
1410         },
1411         
1412         getUseImmediateMmsRetrieval: function() {
1413 @@ -188,12 +432,22 @@
1414                 return {
1415                                 "_kind": MessagingPrefsService.prefsDB,
1416                                 "enableNotification": true,
1417 -                               "notificationSound":"alert",
1418 +                               "blinkNotification": true,
1419 +                               "notificationSound": "alert",
1420                                 "ringtone": {},
1421 +                               "repeatInterval": 0,
1422 +                               "repeatLimit": 3,
1423 +                               "prependForward": false,
1424 +                               "messageGreeting": "",
1425 +                               "messageSignature": "",
1426                                 "isHistoryViewSelected": true,
1427                                 "showOnlineBuddiesOnly": true,
1428                                 "useImmediateMmsRetrieval": true,
1429 -                               "firstUseMode":true
1430 +                               "firstUseMode": true,
1431 +                               "useAutomaticMsgDrafts": true,
1432 +                               "useClipboardMsgDrafts": false,
1433 +                               "useDeleteConfirmation": true,
1434 +                               "accountNotifications": {}
1435                 };
1436         },
1437  
1438 --- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/prefsAccountSummary-assistant.js
1439 +++ /usr/palm/applications/com.palm.app.messaging/app/controllers/prefsAccountSummary-assistant.js
1440 @@ -8,13 +8,15 @@
1441          this.Messaging = this.appController.Messaging;      
1442          this.params = params || {};
1443          this.requests = [];
1444 +        this.listSettingChanged = false;
1445                 
1446                 this.handleAddAccountTap = this.handleAddAccountTap.bindAsEventListener(this);
1447 -               this.notificationToggleChanged = this.notificationToggleChanged.bindAsEventListener(this);
1448 +/*             this.notificationToggleChanged = this.notificationToggleChanged.bindAsEventListener(this);
1449                 this.notificationSoundToggleChanged = this.notificationSoundToggleChanged.bindAsEventListener(this);
1450                 this.chooseNotificationRingtone = this.chooseNotificationRingtone.bindAsEventListener(this);
1451                 this.autoDownloadToggleChanged = this.autoDownloadToggleChanged.bindAsEventListener(this);
1452                 this.deliveryReceiptsToggleChanged = this.deliveryReceiptsToggleChanged.bindAsEventListener(this);
1453 +*/
1454      },
1455   
1456      setup: function(){
1457 @@ -33,24 +35,39 @@
1458                 
1459        this.controller.listen('addAccountButton',Mojo.Event.tap, this.handleAddAccountTap);   
1460     
1461 -      this.controller.listen('currentringtonerow',Mojo.Event.tap, this.chooseNotificationRingtone);
1462 +//      this.controller.listen('currentringtonerow',Mojo.Event.tap, this.chooseNotificationRingtone);
1463      },
1464         
1465         cleanup: function() {
1466                 this.controller.stopListening('addAccountButton',Mojo.Event.tap, this.handleAddAccountTap);
1467 -               if (this.saveSMSPrefs) {
1468 +/*             if (this.saveSMSPrefs) {
1469                         this.controller.stopListening('savePrefs', Mojo.Event.tap, this.saveSMSPrefs);
1470                 }
1471           this.controller.stopListening('deliveryReceiptsToggle',Mojo.Event.propertyChange,this.deliveryReceiptsToggleChanged);
1472        this.controller.stopListening('notificationToggle',Mojo.Event.propertyChange,this.notificationToggleChanged);
1473        this.controller.stopListening('notificationSoundSelector',Mojo.Event.propertyChange,this.notificationSoundToggleChanged);                
1474        this.controller.stopListening('autoDownloadToggle',Mojo.Event.propertyChange,this.autoDownloadToggleChanged);
1475 +*/
1476         },
1477  
1478 -       handleAccountsListTap: function(account, template){
1479 +       handleCommand: function(event){
1480 +               if((event.type == Mojo.Event.back) && (this.listSettingChanged)) {
1481 +             event.stopPropagation();
1482 +          event.preventDefault();
1483 +                       this.controller.stageController.swapScene('listview');
1484 +               }
1485 +       },
1486 +       
1487 +       handleAccountsListTap: function(account, template, target){
1488                 var capabilityProvider = this.getMessagingCapabilityProvider(account);
1489                 var accountSettingsUI;
1490                 
1491 +               if(target == "notifications") {
1492 +             this.controller.stageController.pushScene('prefsSetupNotifications', this.Messaging.messagingPrefs, capabilityProvider.serviceName, account.icon.loc_32x32);
1493 +               
1494 +                       return;
1495 +               }
1496 +               
1497                 if (capabilityProvider && capabilityProvider.settingsUI) {
1498                         accountSettingsUI = capabilityProvider.settingsUI;
1499                         
1500 @@ -76,7 +93,7 @@
1501                         
1502                 }
1503                 else if(capabilityProvider && capabilityProvider.serviceName === undefined && capabilityProvider.capabilitySubtype === "SMS"){
1504 -                       //Do nothing when SMS is taped.
1505 +                       this.controller.stageController.pushScene('prefsSetupSMSAccount', this.Messaging);
1506                 }
1507                 else {
1508                         this.controller.stageController.pushScene("accountlogin", {
1509 @@ -105,12 +122,52 @@
1510       **************************************************/
1511      
1512      preferencesSetup: function() {
1513 -      this.prefsAutoSignIn();
1514 +//      this.prefsAutoSignIn();
1515        //this.prefsSmsMmsSetup();
1516 -      this.prefsNotification();
1517 +//      this.prefsNotification();
1518 +      this.prefsDraftsSetup();
1519 +      this.prefsListSetup();
1520 +    },
1521 +    
1522 +    prefsDraftsSetup: function() {
1523 +       var messageDraftsAttributes = {
1524 +                       trueValue: true,
1525 +                       falseValue: false };
1526 +       
1527 +       this.modelMessageDraftsClipboard = {value: this.Messaging.messagingPrefs.getUseClipboardMsgDrafts()};
1528 +
1529 +               this.controller.setupWidget('prefs-clipboard-drafts-toggle', messageDraftsAttributes, this.modelMessageDraftsClipboard);
1530 +      this.controller.listen('prefs-clipboard-drafts-toggle',Mojo.Event.propertyChange, this.prefsDraftsSave.bind(this));      
1531 +
1532 +       this.modelMessageDraftsAutomatic = {value: this.Messaging.messagingPrefs.getUseAutomaticMsgDrafts()};
1533 +       
1534 +       this.controller.setupWidget('prefs-automatic-drafts-toggle', messageDraftsAttributes, this.modelMessageDraftsAutomatic);
1535 +      this.controller.listen('prefs-automatic-drafts-toggle',Mojo.Event.propertyChange, this.prefsDraftsSave.bind(this));      
1536 +    },
1537 +
1538 +    prefsDraftsSave: function() {
1539 +               this.Messaging.messagingPrefs.setUseClipboardMsgDrafts(this.modelMessageDraftsClipboard.value);
1540 +               this.Messaging.messagingPrefs.setUseAutomaticMsgDrafts(this.modelMessageDraftsAutomatic.value);
1541      },
1542 +                   
1543 +    prefsListSetup: function() {
1544 +       var messageDeleteConfirmAttributes = {
1545 +                       trueValue: true,
1546 +                       falseValue: false };
1547 +       
1548 +       this.modelMessageDeleteConfirm = {value: this.Messaging.messagingPrefs.getUseDeleteConfirmation()};
1549 +       
1550 +       this.controller.setupWidget('prefs-delete-confirmation-toggle', messageDeleteConfirmAttributes, this.modelMessageDeleteConfirm);
1551 +      this.controller.listen('prefs-delete-confirmation-toggle',Mojo.Event.propertyChange, this.prefsListSave.bind(this));      
1552 +    },
1553 +
1554 +    prefsListSave: function() {
1555 +               this.listSettingChanged = true;
1556      
1557 -    prefsAutoSignIn: function() {
1558 +               this.Messaging.messagingPrefs.setUseDeleteConfirmation(this.modelMessageDeleteConfirm.value);
1559 +        },
1560 +
1561 +//    prefsAutoSignIn: function() {
1562        /*
1563        var autoSignin = {
1564          modelProperty : 'auto-signin-toggle',
1565 @@ -126,13 +183,14 @@
1566  //        this.controller.get('AutoSignon').observe('mojo-property-change', 
1567  //                     this.autoSignonChange.bind(this));            
1568         */       
1569 -    },
1570 -    
1571 + //   },
1572 +/*    
1573      prefsSmsMmsSetup: function() {
1574 +*/
1575        /************************
1576        * Setup widgets
1577        ************************/
1578 -      var smscAttributes = {
1579 +/*      var smscAttributes = {
1580          inputName: "smscAddressText",
1581          hintText: '',
1582          modelProperty: 'original',
1583 @@ -187,11 +245,11 @@
1584          value: false
1585        };
1586        this.controller.setupWidget('useSettings', mmsSmsUseSettingsAttributes, this.mmsSmsUseSettingsModel);        
1587 -        
1588 +*/        
1589        /*********************************************
1590        * Methods for rendering existing pref values
1591        *********************************************/        
1592 -      this.renderEditSMSCAddress = function(response) {
1593 + /*     this.renderEditSMSCAddress = function(response) {
1594          this.smscModel.original = response.smscAddr;
1595          this.controller.modelChanged(this.smscModel,this);
1596          this.emailGatewayModel.original = response.emailGateway;
1597 @@ -367,7 +425,7 @@
1598  
1599                 this.controller.get('currentringtone').update(file.name);
1600         }
1601 -       
1602 +*/     
1603  //    editAccount: function(targetRow){
1604  //      // iterate through hidden inputs
1605  //      var inputHash = {};
1606 --- .orig/usr/palm/applications/com.palm.app.messaging/app/views/prefsAccountSummary/prefsAccountSummary-scene.html
1607 +++ /usr/palm/applications/com.palm.app.messaging/app/views/prefsAccountSummary/prefsAccountSummary-scene.html
1608 @@ -5,7 +5,7 @@
1609        <div id="prefHeaderText" class="title" x-mojo-loc=''>Preferences &amp; Accounts</div>
1610      </div>
1611    </div>
1612 -
1613 +<!--
1614         <div class="palm-group">
1615                 <div class="palm-group-title" x-mojo-loc=''>
1616                         New message
1617 @@ -20,8 +20,8 @@
1618                                 </div> 
1619                         </div>                
1620                         <div id="notificationSoundContainer">   
1621 -                               <!-- <div class="palm-row-divider"></div> -->
1622 -                               <div id="soundselectrow" class="palm-row" x-mojo-tap-highlight="momentary">
1623 +-->                            <!-- <div class="palm-row-divider"></div> -->
1624 +<!--                           <div id="soundselectrow" class="palm-row" x-mojo-tap-highlight="momentary">
1625                                         <div class="palm-row-wrapper">
1626                                                 <div id="notificationSoundSelector" x-mojo-element="ListSelector"></div>
1627                                         </div>
1628 @@ -53,5 +53,43 @@
1629                 </div>
1630         </div>
1631         <div id="accounts_list" x-mojo-element="AccountsList"></div>
1632 +-->
1633 +
1634 +       <div class="palm-group">
1635 +               <div class="palm-group-title" x-mojo-loc=''>Message Drafts</div>
1636 +               <div class="palm-list">
1637 +                       <div class="palm-row first">
1638 +                               <div class="palm-row-wrapper">
1639 +                                       <div x-mojo-element="ToggleButton" id="prefs-clipboard-drafts-toggle"></div>
1640 +                                       <div class="title" x-mojo-loc=''>Copy to Clipboard</div>
1641 +                               </div>
1642 +                       </div>  
1643 +                       <div class="palm-row last">
1644 +                               <div class="palm-row-wrapper">
1645 +                                       <div x-mojo-element="ToggleButton" id="prefs-automatic-drafts-toggle"></div>
1646 +                                       <div class="title" x-mojo-loc=''>Copy to Message</div>
1647 +                               </div>
1648 +                       </div>  
1649 +               </div>
1650 +       </div>
1651 +       
1652 +       <div x-mojo-loc="" class="palm-info-text">The above settings controls how aborted messages are handled.</div>
1653 +
1654 +       <div class="palm-group">
1655 +               <div class="palm-group-title" x-mojo-loc=''>Message List</div>
1656 +               <div class="palm-list">
1657 +                       <div class="palm-row first">
1658 +                               <div class="palm-row-wrapper">
1659 +                                       <div x-mojo-element="ToggleButton" id="prefs-delete-confirmation-toggle"></div>
1660 +                                       <div class="title" x-mojo-loc=''>Delete Confirmation</div>
1661 +                               </div>
1662 +                       </div>  
1663 +               </div>
1664 +       </div>
1665 +
1666 +       <div id="accounts_list" x-mojo-element="AccountsList" class="show-notifications"></div>
1667 +       
1668 +       <div x-mojo-loc="" class="palm-info-text">IM accounts from same provider share notification preferences.</div>
1669 +       
1670         <div id="addAccountButton" class="palm-button" x-mojo-loc=''>Add IM Account</div>
1671  </div>
1672 \ No newline at end of file
1673 --- .orig/usr/palm/applications/com.palm.app.messaging/sources.json
1674 +++ /usr/palm/applications/com.palm.app.messaging/sources.json
1675 @@ -51,6 +51,12 @@
1676      "source": "app\/controllers\/prefsAccountSummary-assistant.js"\r
1677    },\r
1678    {\r
1679 +    "source": "app\/controllers\/prefsSetupSMSAccount-assistant.js"\r
1680 +  },   \r
1681 +  {\r
1682 +    "source": "app\/controllers\/prefsSetupNotifications-assistant.js"\r
1683 +  },   \r
1684 +  {\r
1685      "source": "app\/controllers\/compose-assistant.js"\r
1686    },\r
1687    {\r