From: helge Date: Fri, 15 Jul 2005 11:59:54 +0000 (+0000) Subject: work on iCalendar mail viewer X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6b8088daa5dda804085933cc79d6a17742bbe4f;p=scalable-opengroupware.org work on iCalendar mail viewer git-svn-id: http://svn.opengroupware.org/SOGo/trunk@776 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/MailPartViewers/ChangeLog b/SOGo/UI/MailPartViewers/ChangeLog index 852facbf..01a7f0b6 100644 --- a/SOGo/UI/MailPartViewers/ChangeLog +++ b/SOGo/UI/MailPartViewers/ChangeLog @@ -1,3 +1,9 @@ +2005-07-15 Helge Hess + + * UIxMailPartICalViewer.m: added method to retrieve the authorative + event (DB before mail), added a method to return an organizer display + name (with appropriate fallbacks) (v0.9.10) + 2005-07-15 Helge Hess * UIxMailPartICalViewer.m: rewrote not to use SOGoAppointment and to diff --git a/SOGo/UI/MailPartViewers/UIxMailPartICalViewer.m b/SOGo/UI/MailPartViewers/UIxMailPartICalViewer.m index 0cc49e0b..81d842d8 100644 --- a/SOGo/UI/MailPartViewers/UIxMailPartICalViewer.m +++ b/SOGo/UI/MailPartViewers/UIxMailPartICalViewer.m @@ -218,6 +218,13 @@ return [[[self context] activeUser] email]; } +- (iCalEvent *)authorativeEvent { + /* DB is considered master, when in DB, ignore mail organizer */ + return [self isEventStoredInCalendar] + ? [self storedEvent] + : [self inEvent]; +} + - (BOOL)isLoggedInUserTheOrganizer { NSString *loginEMail; @@ -226,12 +233,7 @@ return NO; } - if ([self isEventStoredInCalendar]) { - /* DB is considered master, when in DB, ignore mail organizer */ - return [[self storedEvent] isOrganizer:loginEMail]; - } - - return [[self inEvent] isOrganizer:loginEMail]; + return [[self authorativeEvent] isOrganizer:loginEMail]; } - (BOOL)isLoggedInUserAnAttendee { @@ -241,13 +243,29 @@ [self warnWithFormat:@"Could not determine email of logged in user?"]; return NO; } + + return [[self authorativeEvent] isParticipant:loginEMail]; +} + +/* derived fields */ + +- (NSString *)organizerDisplayName { + iCalPerson *organizer; + NSString *cn; - if ([self isEventStoredInCalendar]) { - /* DB is considered master, when in DB, ignore mail organizer */ - return [[self storedEvent] isParticipant:loginEMail]; + if ((organizer = [[self authorativeEvent] organizer]) != nil) { + cn = [organizer valueForKey:@"cnForDisplay"]; + if ([cn isNotNull] && [cn length] > 0) + return cn; + + cn = [organizer valueForKey:@"rfc822Email"]; + if ([cn isNotNull] && [cn length] > 0) + return cn; + + return @"[error: unable to derive organizer name]"; } - - return [[self inEvent] isParticipant:loginEMail]; + + return @"[todo: no organizer set, use 'from']"; } @end /* UIxMailPartICalViewer */ diff --git a/SOGo/UI/MailPartViewers/Version b/SOGo/UI/MailPartViewers/Version index 390fe45f..68132b8f 100644 --- a/SOGo/UI/MailPartViewers/Version +++ b/SOGo/UI/MailPartViewers/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=9 +SUBMINOR_VERSION:=10 # v0.9.0 requires libNGiCal v4.5.53 # v0.9.1 requires libNGMime v4.5.213 diff --git a/SOGo/UI/Templates/ChangeLog b/SOGo/UI/Templates/ChangeLog index d59c5a59..e4df4d1d 100644 --- a/SOGo/UI/Templates/ChangeLog +++ b/SOGo/UI/Templates/ChangeLog @@ -1,3 +1,8 @@ +2005-07-15 Helge Hess + + * MailPartViewers/UIxMailPartICalViewer.wox: prepared support for iMIP + 'method' requests + 2005-07-14 Marcus Mueller * UIxCalScheduleOverview.wox: removed functionality for v0.8 on diff --git a/SOGo/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox b/SOGo/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox index 7edac79e..f11e0dff 100644 --- a/SOGo/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox +++ b/SOGo/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox @@ -11,10 +11,67 @@
: - + + + + () + + + () + + + + + + +

+ Organizer + invites you to participate in a meeting. +

+ +
+ + +

+ Organizer + is proposing a meeting to the attendees. You receive this + mail as a notification, you are not scheduled as a participant. +

+
+
+ - Method:
+ + +

+ iMIP 'DELETE' requests are not yet supported by SOGo. +

+
+ + + + +

+ + Your invitation or the whole event was canceled. +

+
+ + + + +

+ iMIP 'ADD' requests are not yet supported by SOGo. +

+
+ + + + + + TODO: Storage: @@ -30,10 +87,7 @@
- TODO: Organizer: - You are the organizer! - - You are not the organizer! - - - (you are an attendee) - - - (you are NOT an attendee: - ) - -
@@ -79,7 +123,7 @@
: + >