Hello,

Lightning uses the last email address for appointment sending. In SOGo
this is the system email address or the last user email address, if
"SOGoHideSystemEMail" is set to "YES".
If a user has multiple email addresses, the used email address differs
between Smartphones and Lightning.

With this patch a new domain parameter called "SOGoSendOnlyFirstEMail"
will be added to ensure, that only the first email address will be sent
over CalDAV.

Hardy
-- 
users@sogo.nu
https://inverse.ca/sogo/lists
diff -Nurb sogo-2.2.17a.20150402/SoObjects/Appointments/o sogo-2.2.17a.20150402.mod/SoObjects/Appointments/o
diff -Nurb sogo-2.2.17a.20150402/SoObjects/Appointments/SOGoUserFolder+Appointments.m sogo-2.2.17a.20150402.mod/SoObjects/Appointments/SOGoUserFolder+Appointments.m
--- sogo-2.2.17a.20150402/SoObjects/Appointments/SOGoUserFolder+Appointments.m	2015-04-02 06:38:28.000000000 +0200
+++ sogo-2.2.17a.20150402.mod/SoObjects/Appointments/SOGoUserFolder+Appointments.m	2015-04-02 14:32:15.035934166 +0200
@@ -81,6 +81,15 @@
   if (!emails)
     emails = [[ownerUser allEmails] objectEnumerator];
 
+
+  if ([[ownerUser domainDefaults] sendOnlyFirstEMail])
+    {
+      tag = [NSArray arrayWithObjects: @"href", XMLNS_WEBDAV, @"D",
+                     [NSString stringWithFormat: @"mailto:%@", [emails objectAtIndex: 0]],
+                     nil];
+      [addresses addObject: tag];
+    }
+  else
   while ((currentEmail = [emails nextObject]))
     {
       if (![doneEmails objectForKey: currentEmail])
diff -Nurb sogo-2.2.17a.20150402/SoObjects/SOGo/SOGoDomainDefaults.h sogo-2.2.17a.20150402.mod/SoObjects/SOGo/SOGoDomainDefaults.h
--- sogo-2.2.17a.20150402/SoObjects/SOGo/SOGoDomainDefaults.h	2015-04-02 06:38:29.000000000 +0200
+++ sogo-2.2.17a.20150402.mod/SoObjects/SOGo/SOGoDomainDefaults.h	2015-04-02 14:07:11.179833004 +0200
@@ -78,6 +78,7 @@
 - (NSArray *) additionalJSFiles;
 
 - (BOOL) hideSystemEMail;
+- (BOOL) sendOnlyFirstEMail;
 
 - (int) searchMinimumWordLength;
 - (BOOL) notifyOnPersonalModifications;
diff -Nurb sogo-2.2.17a.20150402/SoObjects/SOGo/SOGoDomainDefaults.m sogo-2.2.17a.20150402.mod/SoObjects/SOGo/SOGoDomainDefaults.m
--- sogo-2.2.17a.20150402/SoObjects/SOGo/SOGoDomainDefaults.m	2015-04-02 06:38:29.000000000 +0200
+++ sogo-2.2.17a.20150402.mod/SoObjects/SOGo/SOGoDomainDefaults.m	2015-04-02 14:06:59.164060175 +0200
@@ -348,6 +348,11 @@
   return [self boolForKey: @"SOGoHideSystemEMail"];
 }
 
+- (BOOL) sendOnlyFirstEMail
+{
+  return [self boolForKey: @"SOGoSendOnlyFirstEMail"];
+}
+
 - (int) searchMinimumWordLength
 {
   return [self integerForKey: @"SOGoSearchMinimumWordLength"];

Reply via email to