]> err.no Git - scalable-opengroupware.org/commitdiff
added iMIP reply things
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 00:00:11 +0000 (00:00 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 00:00:11 +0000 (00:00 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@780 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/MailPartViewers/ChangeLog
SOGo/UI/MailPartViewers/UIxMailPartICalViewer.m
SOGo/UI/MailPartViewers/Version
SOGo/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox

index b3090541829fec81ca19e4221d7bd2ffb085f9c5..b8ce7026ac0576cf32ea68d1f779ce4675824c47 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-18  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailPartICalViewer.m: added code to support iMIP REPLY messages
+         (v0.9.12)
+
 2005-07-15  Helge Hess  <helge.hess@opengroupware.org>
 
        * v0.9.11
index c380e787f3fa595913e6af7511ce2a53cae2f435..f0484bbd1005fee6ee74438b48c2839fc0bbcc55 100644 (file)
@@ -48,7 +48,9 @@
 #include <SOGo/SOGoUser.h>
 #include <SOGo/SoObjects/Appointments/SOGoAppointmentFolder.h>
 #include <SOGo/SoObjects/Appointments/SOGoAppointmentObject.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailObject.h>
 #include <NGiCal/NGiCal.h>
+#include <NGImap4/NGImap4EnvelopeAddress.h>
 #include "common.h"
 
 @implementation UIxMailPartICalViewer
   return @"[todo: no organizer set, use 'from']";
 }
 
+/* replies */
+
+- (NGImap4EnvelopeAddress *)replySenderAddress {
+  /* 
+     The iMIP reply is the sender of the mail, the 'attendees' are NOT set to
+     the actual attendees. BUT the attendee field contains the reply-status!
+  */
+  id tmp;
+  
+  tmp = [[self clientObject] fromEnvelopeAddresses];
+  if ([tmp count] == 0) return nil;
+  return [tmp objectAtIndex:0];
+}
+
+- (NSString *)replySenderEMail {
+  return [[self replySenderAddress] email];
+}
+- (NSString *)replySenderBaseEMail {
+  return [[self replySenderAddress] baseEMail];
+}
+
+- (iCalPerson *)inReplyAttendee {
+  NSArray *attendees;
+  
+  attendees = [[self inEvent] attendees];
+  if ([attendees count] == 0)
+    return nil;
+  if ([attendees count] > 1)
+    [self warnWithFormat:@"More than one attendee in REPLY: %@", attendees];
+  
+  return [attendees objectAtIndex:0];
+}
+- (iCalPerson *)storedReplyAttendee {
+  iCalEvent  *e;
+  iCalPerson *p;
+  
+  if ((e = [self storedEvent]) == nil)
+    return nil;
+  if ((p = [e findParticipantWithEmail:[self replySenderBaseEMail]]))
+    return p;
+  if ((p = [e findParticipantWithEmail:[self replySenderEMail]]))
+    return p;
+  return nil;
+}
+- (BOOL)isReplySenderAnAttendee {
+  return [[self storedReplyAttendee] isNotNull];
+}
+
 /* action URLs */
 
 - (id)acceptLink {
index 68e2d82e684ff1bee54c1ff1297f48683ddbb5ec..cb1c59486e3b15c29115ea866d6f9d1c55818327 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=11
+SUBMINOR_VERSION:=12
 
 # v0.9.0 requires libNGiCal v4.5.53
 # v0.9.1 requires libNGMime v4.5.213
index 00494e4fc57b7e3a37af5a574fec9045255d23a3..3b550069d7c6ca5dda63d1d5d84e957b3f5ecf94 100644 (file)
       <!-- sent to organizer to update the status of the participant -->
       <p>
         iMIP 'REPLY' requests are not yet supported by SOGo.
+        <br />
+        From: <!-- TODO: support for 'root' objects? -->
+        <var:string value="replySenderEMail" />
+        <br />
+        Status Update:
+        <var:string value="inReplyAttendee.partStat" />,
+        <var:if condition="isReplySenderAnAttendee">
+          was:
+          <var:string value="storedReplyAttendee.partStat" />.
+        </var:if>
+        <var:if condition="isReplySenderAnAttendee" const:negate="1">
+          <b>the sender is not registered as an attendee!</b>
+        </var:if>
       </p>
     </var:if>
 
         <tr>
           <td><var:string label:value="Organizer"/>:</td>
           <td>
-            <a var:href="inEvent.organizer.email"
+            <a var:href="authorativeEvent.organizer.email"
                 ><var:string value="organizerDisplayName" /></a>
           </td>
         </tr>
         <tr>
           <td valign="top"><var:string label:value="Attendees"/>:</td>
           <td>
-            <var:foreach list="inEvent.participants" item="attendee">
+            <var:foreach list="authorativeEvent.participants" item="attendee">
               <a var:href="attendee.email"
                  ><var:string value="attendee.cnForDisplay" /></a>
               (<var:string value="attendee.partStat" />)
         <tr> <!-- description in iCal -->
           <td valign="top"><var:string label:value="Comment"/>:</td>
           <td>
-            <var:string value="inEvent.comment" const:insertBR="1" />
+            <var:string value="authorativeEvent.comment" const:insertBR="1" />
           </td>
         </tr>
       </table>