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