Menu

Diff of /trunk/GoogleContactsSync/ContactSync.cs [r1565] .. [r1566]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/GoogleContactsSync/ContactSync.cs
+++ b/trunk/GoogleContactsSync/ContactSync.cs
@@ -23,6 +23,10 @@
         internal const string CAR = "car";             //Not existing anymore on Google side as standard
         internal const string PHONE_MAIN = "main";
         internal const string PHONE_MOBILE = "mobile";
+        internal const string PHONE_CALLBACK = "callback";
+        internal const string PHONE_RADIO = "radio";
+        internal const string PHONE_TTY = "tty";
+        internal const string PHONE_COMPANY = "company";
         internal const string FAX_WORK = "workFax";
         internal const string FAX_OTHER = "otherFax";
         internal const string FAX_WEITER = "Weitere Faxnummer";
@@ -382,6 +386,10 @@
             var IsOtherCount = 0;
             var IsCarCount = 0;
             var IsAssistantCount = 0;
+            var IsCallbackCount = 0;
+            var IsRadioCount = 0;
+            var IsTtyCount = 0;
+            var IsCompanyCount = 0;
 
             if (slave.PhoneNumbers == null)
                 slave.PhoneNumbers = new List<PhoneNumber>();
@@ -431,6 +439,18 @@
                         case ASSISTANT:
                             IsAssistantCount++;
                             break;
+                        case PHONE_CALLBACK:
+                            IsCallbackCount++;
+                            break;
+                        case PHONE_RADIO:
+                            IsRadioCount++;
+                            break;
+                        case PHONE_TTY:
+                            IsTtyCount++;
+                            break;
+                        case PHONE_COMPANY:
+                            IsCompanyCount++;
+                            break;
                         default:
                             Log.Debug($"Google contact \"{master.ToLogString()}\" has custom phone number labeled \"{phone.Type}\", this phone number is not synchronized with Outlook. Please update contact at Google and change label to standard one (home, work, other, ...).");
                             break;
@@ -480,6 +500,22 @@
             if (IsAssistantCount > 1)
             {
                 Log.Debug($"Google contact \"{slave.ToLogString()}\" has {IsAssistantCount} assistant phone numbers, Outlook can have only 1 assistant phone number. You will lose information about additional assistant phone numbers.");
+            }
+            if (IsCallbackCount > 1)
+            {
+                Log.Debug($"Google contact \"{slave.ToLogString()}\" has {IsCallbackCount} callback phone numbers, Outlook can have only 1 callback phone number. You will lose information about additional callback phone numbers.");
+            }
+            if (IsRadioCount > 1)
+            {
+                Log.Debug($"Google contact \"{slave.ToLogString()}\" has {IsRadioCount} radio phone numbers, Outlook can have only 1 radio phone number. You will lose information about additional radio phone numbers.");
+            }
+            if (IsTtyCount > 1)
+            {
+                Log.Debug($"Google contact \"{slave.ToLogString()}\" has {IsTtyCount} assistant TTY numbers, Outlook can have only 1 TTY phone number. You will lose information about additional TTY phone numbers.");
+            }
+            if (IsCompanyCount > 1)
+            {
+                Log.Debug($"Google contact \"{slave.ToLogString()}\" has {IsCompanyCount} company phone numbers, Outlook can have only 1 company phone number. You will lose information about additional company phone numbers.");
             }
 
             //clear only phone numbers synchronized with Outlook, this will prevent losing Google phones with custom labels
@@ -498,7 +534,11 @@
                     slave.PhoneNumbers[i].Type.Trim().Equals(ANDERE, StringComparison.InvariantCultureIgnoreCase) ||
                     slave.PhoneNumbers[i].Type.Trim().Equals(PHONE_PAGER, StringComparison.InvariantCultureIgnoreCase) ||
                     slave.PhoneNumbers[i].Type.Trim().Equals(CAR, StringComparison.InvariantCultureIgnoreCase) ||
-                    slave.PhoneNumbers[i].Type.Trim().Equals(ASSISTANT, StringComparison.InvariantCultureIgnoreCase))
+                    slave.PhoneNumbers[i].Type.Trim().Equals(ASSISTANT, StringComparison.InvariantCultureIgnoreCase) ||
+                    slave.PhoneNumbers[i].Type.Trim().Equals(PHONE_CALLBACK, StringComparison.InvariantCultureIgnoreCase) ||
+                    slave.PhoneNumbers[i].Type.Trim().Equals(PHONE_RADIO, StringComparison.InvariantCultureIgnoreCase) ||
+                    slave.PhoneNumbers[i].Type.Trim().Equals(PHONE_TTY, StringComparison.InvariantCultureIgnoreCase) ||
+                    slave.PhoneNumbers[i].Type.Trim().Equals(PHONE_COMPANY, StringComparison.InvariantCultureIgnoreCase))
                     )
                 {
                     slave.PhoneNumbers.RemoveAt(i);
@@ -518,6 +558,10 @@
             SetPhoneNumber(slave.PhoneNumbers, master.PagerNumber, PHONE_PAGER);
             SetPhoneNumber(slave.PhoneNumbers, master.CarTelephoneNumber, CAR);
             SetPhoneNumber(slave.PhoneNumbers, master.AssistantTelephoneNumber, ASSISTANT);
+            SetPhoneNumber(slave.PhoneNumbers, master.CallbackTelephoneNumber, PHONE_CALLBACK);
+            SetPhoneNumber(slave.PhoneNumbers, master.RadioTelephoneNumber, PHONE_RADIO);
+            SetPhoneNumber(slave.PhoneNumbers, master.TTYTDDTelephoneNumber, PHONE_TTY);
+            SetPhoneNumber(slave.PhoneNumbers, master.CompanyMainTelephoneNumber, PHONE_COMPANY);
         }
 
         private static void SetPhoneNumber(PhoneNumber phone, Outlook.ContactItem destination)
@@ -579,6 +623,18 @@
                         break;
                     case ASSISTANT:
                         destination.AssistantTelephoneNumber = phone.Value;
+                        break;
+                    case PHONE_CALLBACK:
+                        destination.CallbackTelephoneNumber = phone.Value;
+                        break;
+                    case PHONE_RADIO:
+                        destination.RadioTelephoneNumber = phone.Value;
+                        break;
+                    case PHONE_TTY:
+                        destination.TTYTDDTelephoneNumber = phone.Value;
+                        break;
+                    case PHONE_COMPANY:
+                        destination.CompanyMainTelephoneNumber = phone.Value;
                         break;
                 }
             }
@@ -610,6 +666,10 @@
             var IsOtherCount = 0;
             var IsCarCount = 0;
             var IsAssistantCount = 0;
+            var IsCallbackCount = 0;
+            var IsRadioCount = 0;
+            var IsTtyCount = 0;
+            var IsCompanyCount = 0;
 
             var emptyCount = 0;
 
@@ -666,6 +726,18 @@
                     case ASSISTANT:
                         IsAssistantCount++;
                         break;
+                    case PHONE_CALLBACK:
+                        IsCallbackCount++;
+                        break;
+                    case PHONE_RADIO:
+                        IsRadioCount++;
+                        break;
+                    case PHONE_TTY:
+                        IsTtyCount++;
+                        break;
+                    case PHONE_COMPANY:
+                        IsCompanyCount++;
+                        break;
                     default:
                         Log.Warning($"Google contact \"{master.ToLogString()}\" has custom phone number labeled \"{phone.Type}\", this phone number is not synchronized with Outlook. Please update contact at Google and change label to standard one (home, work, other, ...).");
                         break;
@@ -720,6 +792,22 @@
             if (IsAssistantCount > 1)
             {
                 Log.Warning($"Google contact \"{master.ToLogString()}\" has {IsAssistantCount} assistant phone numbers, Outlook can have only 1 assistant phone number. Please update contact at Google, otherwise you will lose information about additional assistant phone numbers.");
+            }
+            if (IsCallbackCount > 1)
+            {
+                Log.Warning($"Google contact \"{master.ToLogString()}\" has {IsCallbackCount} callback phone numbers, Outlook can have only 1 callback phone number. Please update contact at Google, otherwise you will lose information about additional callback phone numbers.");
+            }
+            if (IsRadioCount > 1)
+            {
+                Log.Debug($"Google contact \"{master.ToLogString()}\" has {IsRadioCount} radio phone numbers, Outlook can have only 1 radio phone number. Please update contact at Google, otherwise you will lose information about additional radio phone numbers.");
+            }
+            if (IsTtyCount > 1)
+            {
+                Log.Debug($"Google contact \"{master.ToLogString()}\" has {IsTtyCount} assistant TTY numbers, Outlook can have only 1 TTY phone number. Please update contact at Google, otherwise you will lose information about additional TTY phone numbers.");
+            }
+            if (IsCompanyCount > 1)
+            {
+                Log.Debug($"Google contact \"{master.ToLogString()}\" has {IsCompanyCount} company phone numbers, Outlook can have only 1 company phone number. Please update contact at Google, otherwise you will lose information about additional company phone numbers.");
             }
 
             foreach (var phone in master.PhoneNumbers)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.