Reorganized everything into new structure
[webos-internals:adamrmcd-modifications.git] / phone / phone-match-state-to-area-code.patch
1 Adds the State name to all incoming calls.
2 Index: /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
3 ===================================================================
4 --- .orig/usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
5 +++ /usr/palm/applications/com.palm.app.phone/app/controllers/announcer-assistant.js
6 @@ -309,6 +309,8 @@ var AnnouncerAssistant = Class.create({
7                 call.displayName = this.getDisplayNameFromContact(contact);
8                 if (!(call.displayName)) {
9                         call.displayName = FormatPhoneNumber(number);
10 +                       var message = Messages.contactWithLabel;
11 +                       call.displayName = new Template(message).evaluate({"contact":call.displayName, "label":RegionLookup.regionFromPhoneNumber(number)});
12                 } else if (contact.labelFormatted) {
13                         var message = Messages.contactWithLabel;
14                         call.displayName = new Template(message).evaluate({"contact":call.displayName, "label":contact.labelFormatted});        
15 Index: /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
16 ===================================================================
17 --- .orig/usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
18 +++ /usr/palm/applications/com.palm.app.phone/app/controllers/calllog-assistant.js
19 @@ -429,7 +429,7 @@ var CalllogAssistant = Class.create({
20                 //Mojo.Timing.resume("format#label");
21                 // format phone number label
22                 if (item.label == -1) {
23 -                       item.label = '';
24 +                       item.label = RegionLookup.regionFromPhoneNumber(item.number);
25                 } else {
26                         var newLabel = Messages.phoneLabel[item.label];
27                         if(newLabel) {
28 Index: /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
29 ===================================================================
30 --- .orig/usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
31 +++ /usr/palm/applications/com.palm.app.phone/app/controllers/incomingcall-assistant.js
32 @@ -159,7 +159,7 @@ var IncomingcallAssistant = Class.create
33                 } else if (contact.cnapName && contact.cnapName !== "unknown") {
34                         name = contact.cnapName;
35                 } else {
36 -                       name = Messages.unknownCaller;
37 +                       name = RegionLookup.regionFromPhoneNumber(number);
38                 }
39  
40                 this.fromContacts = fromContacts;
41 Index: /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
42 ===================================================================
43 --- .orig/usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
44 +++ /usr/palm/applications/com.palm.app.phone/app/controllers/missedcall-assistant.js
45 @@ -61,7 +61,7 @@ var MissedcallAssistant = Class.create({
46                 this.pictureLoc = this.formatPicture();
47         
48                 // ensure empty label is displayed as empty
49 -               this.displayLabel = (this.contact.labelFormatted ? this.contact.labelFormatted  : "");
50 +               this.displayLabel = (this.contact.labelFormatted ? this.contact.labelFormatted  : RegionLookup.regionFromPhoneNumber(number));
51                 var  tempDateString = Mojo.Format.formatDate(new Date(parseInt(timeStamp)), {time:'short'});
52                 this.message = message.interpolate({timeStamp: tempDateString});
53                 QDLogger.log( "MissedcallAssistant::updateFields", "end");
54 Index: /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
55 ===================================================================
56 --- .orig/usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
57 +++ /usr/palm/applications/com.palm.app.phone/app/models/FormattedCall.js
58 @@ -50,7 +50,7 @@ var FormattedCall =  Class.create({
59                 this.id = callMsg[lineNumber].id;
60                 
61                 // ensure empty label is displayed as empty
62 -               this.displayLabel = (callMsg[lineNumber].contact.labelFormatted ? callMsg[lineNumber].contact.labelFormatted : "");
63 +               this.displayLabel = (callMsg[lineNumber].contact.labelFormatted ? callMsg[lineNumber].contact.labelFormatted : RegionLookup.regionFromPhoneNumber(callMsg[lineNumber].number));
64                 this.numberCaption = ((callMsg[lineNumber].contact.name !== undefined || callMsg[lineNumber].contact.id !== undefined) ? this.number : " ");
65                 
66      },