mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-31 11:17:17 +00:00
merge of '1cc45a54646b7c2b2f5f308de913308b94603cc6'
and '4fc05589d27078390d22daa4cafe9389c886c583' Monotone-Parent: 1cc45a54646b7c2b2f5f308de913308b94603cc6 Monotone-Parent: 4fc05589d27078390d22daa4cafe9389c886c583 Monotone-Revision: e13446efcded2d880cbb5bb48b3bde3b54faf46e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-12-01T22:30:52 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,54 @@
|
||||
2011-12-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreCalendarMessage.m (-appointmentWrapper):
|
||||
pass the owner user as parameter to the appointment wrapper
|
||||
contructor rather than the active user.
|
||||
(-save): make use of the owner user coordinates instead of the
|
||||
ones of the active user. Handle the "sent-by" parameter for the
|
||||
organizer element.
|
||||
|
||||
* OpenChange/MAPIStoreFolder.m
|
||||
(-openMessage:withMID:forWriting:inMemCtx:): takes a new
|
||||
"forWriting:" parameter and make use of subscriberCanModifyMessage
|
||||
and subscriberCanReadMessage to return a proper error code, if
|
||||
needed.
|
||||
|
||||
* OpenChange/MAPIStoreSOGo.m (sogo_folder_open_message): added the
|
||||
"write_access" parameter.
|
||||
|
||||
* OpenChange/MAPIStoreTasksMessage.m:
|
||||
invoke component:secure: with the secure parameter set to "YES" in
|
||||
all accessors that requires the iCalTask object.
|
||||
|
||||
* OpenChange/MAPIStoreCalendarMessage.m (-appointmentWrapper):
|
||||
invoke component:secure: with the secure parameter set to "YES".
|
||||
|
||||
* OpenChange/MAPIStoreTasksMessageTable.m
|
||||
(-evaluatePropertyRestriction:intoQualifier:): return
|
||||
MAPIRestrictionStateAlwaysTrue for PR_SENSITIVITY since privacy
|
||||
filtering is performed internally.
|
||||
|
||||
* OpenChange/MAPIStoreGCSMessageTable.m (-componentQualifier):
|
||||
removed useless accessor, left over by a previous commit.
|
||||
|
||||
* OpenChange/MAPIStoreGCSFolder.m (-aclQualifier): new accessor
|
||||
providing an additional qualifier when listing elements of a
|
||||
table, based on the current user rights.
|
||||
(-messageKeysMatchingQualifier:andSortOrderings:): make use of the
|
||||
new -aclQualifier method when the active user is not the owner of
|
||||
the sogo object. Slightly simplified code by storing all
|
||||
qualifiers in an array passed as parameter to the EOAndQualifier
|
||||
constructor.
|
||||
|
||||
* OpenChange/MAPIStoreMessage.m (-subscriberCanReadMessage)
|
||||
(-subscriberCanModifyMessage): new getters for ACL operations at
|
||||
the message level.
|
||||
|
||||
* OpenChange/MAPIStoreFolder.m (-subscriberCanCreateMessages)
|
||||
(-subscriberCanModifyMessages, -subscriberCanReadMessages)
|
||||
(-subscriberCanDeleteMessages, -subscriberCanCreateSubFolders):
|
||||
new getters for ACL operations at the folder level.
|
||||
|
||||
2011-11-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoFolder.m
|
||||
|
||||
@@ -157,4 +157,43 @@
|
||||
return rights;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessages
|
||||
{
|
||||
static NSArray *viewerRoles = nil;
|
||||
|
||||
if (!viewerRoles)
|
||||
viewerRoles = [[NSArray alloc] initWithObjects:
|
||||
SOGoCalendarRole_PublicViewer,
|
||||
SOGoCalendarRole_PublicDAndTViewer,
|
||||
SOGoCalendarRole_PrivateViewer,
|
||||
SOGoCalendarRole_PrivateDAndTViewer,
|
||||
SOGoCalendarRole_ConfidentialViewer,
|
||||
SOGoCalendarRole_ConfidentialDAndTViewer,
|
||||
nil];
|
||||
|
||||
return ([[self activeUserRoles] firstObjectCommonWithArray: viewerRoles]
|
||||
!= nil);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessages
|
||||
{
|
||||
static NSArray *modifierRoles = nil;
|
||||
|
||||
if (!modifierRoles)
|
||||
modifierRoles = [[NSArray alloc] initWithObjects:
|
||||
SOGoCalendarRole_PublicModifier,
|
||||
SOGoCalendarRole_PrivateModifier,
|
||||
SOGoCalendarRole_ConfidentialModifier,
|
||||
nil];
|
||||
|
||||
return ([[self activeUserRoles] firstObjectCommonWithArray: modifierRoles]
|
||||
!= nil);
|
||||
}
|
||||
|
||||
- (EOQualifier *) aclQualifier
|
||||
{
|
||||
return [EOQualifier qualifierWithQualifierFormat:
|
||||
[(SOGoAppointmentFolder *) sogoObject aclSQLListingFilter]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#import <NGCards/iCalPerson.h>
|
||||
#import <NGCards/iCalTimeZone.h>
|
||||
#import <NGCards/iCalTrigger.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
#import <Appointments/SOGoAppointmentObject.h>
|
||||
@@ -108,11 +109,11 @@
|
||||
|
||||
if (!appointmentWrapper)
|
||||
{
|
||||
event = [sogoObject component: NO secure: NO];
|
||||
event = [sogoObject component: NO secure: YES];
|
||||
context = [self context];
|
||||
ASSIGN (appointmentWrapper,
|
||||
[MAPIStoreAppointmentWrapper wrapperWithICalEvent: event
|
||||
andUser: [context activeUser]
|
||||
andUser: [context ownerUser]
|
||||
andSenderEmail: nil
|
||||
inTimeZone: [self ownerTimeZone]
|
||||
withConnectionInfo: [context connectionInfo]]);
|
||||
@@ -620,6 +621,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return ([[self activeUserRoles]
|
||||
containsObject: SOGoCalendarRole_ComponentViewer]
|
||||
|| [self subscriberCanModifyMessage]);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles = [self activeUserRoles];
|
||||
|
||||
if (isNew)
|
||||
rc = [roles containsObject: SOGoRole_ObjectCreator];
|
||||
else
|
||||
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|
||||
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) save
|
||||
{
|
||||
iCalCalendar *vCalendar;
|
||||
@@ -631,7 +653,7 @@
|
||||
iCalEvent *newEvent;
|
||||
iCalPerson *userPerson;
|
||||
NSUInteger responseStatus = 0;
|
||||
SOGoUser *activeUser;
|
||||
SOGoUser *activeUser, *ownerUser;
|
||||
id value;
|
||||
|
||||
if (isNew)
|
||||
@@ -662,8 +684,8 @@
|
||||
vCalendar = [iCalCalendar parseSingleFromSource: content];
|
||||
newEvent = [[vCalendar events] objectAtIndex: 0];
|
||||
|
||||
activeUser = [[self context] activeUser];
|
||||
userPerson = [newEvent userAsAttendee: activeUser];
|
||||
ownerUser = [[self context] ownerUser];
|
||||
userPerson = [newEvent userAsAttendee: ownerUser];
|
||||
[newEvent setTimeStampAsDate: now];
|
||||
|
||||
if (userPerson)
|
||||
@@ -701,7 +723,7 @@
|
||||
{
|
||||
// iCalPerson *participant;
|
||||
|
||||
// participant = [newEvent userAsAttendee: activeUser];
|
||||
// participant = [newEvent userAsAttendee: ownerUser];
|
||||
// [participant setParticipationStatus: newPartStat];
|
||||
// [sogoObject saveComponent: newEvent];
|
||||
|
||||
@@ -849,7 +871,7 @@
|
||||
{
|
||||
NSArray *recipients;
|
||||
NSDictionary *dict;
|
||||
NSString *orgEmail, *attEmail;
|
||||
NSString *orgEmail, *sentBy, *attEmail;
|
||||
iCalPerson *person;
|
||||
iCalPersonPartStat newPartStat;
|
||||
NSNumber *flags, *trackStatus;
|
||||
@@ -858,11 +880,20 @@
|
||||
/* We must set the organizer preliminarily here because, unlike what
|
||||
the doc states, Outlook does not always pass the real organizer
|
||||
in the recipients list. */
|
||||
dict = [activeUser primaryIdentity];
|
||||
dict = [ownerUser primaryIdentity];
|
||||
person = [iCalPerson new];
|
||||
[person setCn: [dict objectForKey: @"fullName"]];
|
||||
orgEmail = [dict objectForKey: @"email"];
|
||||
[person setEmail: orgEmail];
|
||||
|
||||
activeUser = [[self context] activeUser];
|
||||
if (![activeUser isEqual: ownerUser])
|
||||
{
|
||||
dict = [activeUser primaryIdentity];
|
||||
sentBy = [NSString stringWithFormat: @"mailto:%@",
|
||||
[dict objectForKey: @"email"]];
|
||||
[person setSentBy: sentBy];
|
||||
}
|
||||
[newEvent setOrganizer: person];
|
||||
[person release];
|
||||
|
||||
|
||||
@@ -142,4 +142,14 @@
|
||||
return rights;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessages
|
||||
{
|
||||
return [[self activeUserRoles] containsObject: SOGoRole_ObjectEditor];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessages
|
||||
{
|
||||
return [[self activeUserRoles] containsObject: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#import <NGCards/NSString+NGCards.h>
|
||||
#import <Contacts/SOGoContactGCSEntry.h>
|
||||
#import <Mailer/NSString+Mail.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "MAPIStoreContactsAttachment.h"
|
||||
#import "MAPIStoreContactsFolder.h"
|
||||
@@ -847,6 +848,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return [[self activeUserRoles] containsObject: SOGoRole_ObjectViewer];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
NSArray *roles;
|
||||
|
||||
roles = [self activeUserRoles];
|
||||
|
||||
return ((isNew
|
||||
&& [roles containsObject: SOGoRole_ObjectCreator])
|
||||
|| (!isNew && [roles containsObject: SOGoRole_ObjectEditor]));
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -111,9 +111,9 @@
|
||||
withMID: (uint64_t) mid
|
||||
isAssociated: (BOOL) isAssociated;
|
||||
|
||||
|
||||
- (int) openMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
forWriting: (BOOL) readWrite
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (int) deleteMessageWithMID: (uint64_t) mid
|
||||
andFlags: (uint8_t) flags;
|
||||
@@ -161,6 +161,12 @@
|
||||
- (NSArray *) rolesForExchangeRights: (uint32_t) rights;
|
||||
- (uint32_t) exchangeRightsForRoles: (NSArray *) roles;
|
||||
|
||||
- (BOOL) subscriberCanCreateMessages;
|
||||
- (BOOL) subscriberCanModifyMessages;
|
||||
- (BOOL) subscriberCanReadMessages;
|
||||
- (BOOL) subscriberCanDeleteMessages;
|
||||
- (BOOL) subscriberCanCreateSubFolders;
|
||||
|
||||
/* subclass helpers */
|
||||
- (void) postNotificationsForMoveCopyMessagesWithMIDs: (uint64_t *) srcMids
|
||||
andMessageURLs: (NSArray *) oldMessageURLs
|
||||
|
||||
@@ -403,6 +403,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||
|
||||
- (int) openMessage: (MAPIStoreMessage **) messagePtr
|
||||
withMID: (uint64_t) mid
|
||||
forWriting: (BOOL) readWrite
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
{
|
||||
NSString *messageURL;
|
||||
@@ -417,8 +418,15 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||
message = [self lookupMessageByURL: messageURL];
|
||||
if (message)
|
||||
{
|
||||
*messagePtr = message;
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
if ([[context activeUser] isEqual: [context ownerUser]]
|
||||
|| (readWrite && [message subscriberCanModifyMessage])
|
||||
|| (!readWrite && [message subscriberCanReadMessage]))
|
||||
{
|
||||
*messagePtr = message;
|
||||
rc = MAPISTORE_SUCCESS;
|
||||
}
|
||||
else
|
||||
rc = MAPISTORE_ERR_DENIED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,6 +588,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||
memCtx = talloc_zero (NULL, TALLOC_CTX);
|
||||
rc = [sourceFolder openMessage: &sourceMsg
|
||||
withMID: srcMid
|
||||
forWriting: NO
|
||||
inMemCtx: memCtx];
|
||||
if (rc != MAPISTORE_SUCCESS)
|
||||
goto end;
|
||||
@@ -1519,4 +1528,29 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanCreateMessages
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessages
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessages
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanDeleteMessages
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanCreateSubFolders
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#import "MAPIStoreFolder.h"
|
||||
|
||||
@class NSArray;
|
||||
@class NSCalendarDate;
|
||||
@class NSData;
|
||||
@class NSMutableDictionary;
|
||||
@@ -34,6 +35,7 @@
|
||||
@interface MAPIStoreGCSFolder : MAPIStoreFolder
|
||||
{
|
||||
SOGoMAPIFSMessage *versionsMessage;
|
||||
NSArray *activeUserRoles;
|
||||
}
|
||||
|
||||
/* synchronisation */
|
||||
@@ -46,7 +48,10 @@
|
||||
- (void) setChangeKey: (NSData *) changeKey
|
||||
forMessageWithKey: (NSString *) messageKey;
|
||||
|
||||
- (NSArray *) activeUserRoles;
|
||||
|
||||
/* subclasses */
|
||||
- (EOQualifier *) aclQualifier;
|
||||
- (EOQualifier *) componentQualifier;
|
||||
|
||||
@end
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#import <GDLContentStore/GCSFolder.h>
|
||||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/SOGoGCSFolder.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
@@ -53,6 +55,7 @@
|
||||
ASSIGN (versionsMessage,
|
||||
[SOGoMAPIFSMessage objectWithName: @"versions.plist"
|
||||
inContainer: propsFolder]);
|
||||
activeUserRoles = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -66,6 +69,7 @@
|
||||
ASSIGN (versionsMessage,
|
||||
[SOGoMAPIFSMessage objectWithName: @"versions.plist"
|
||||
inContainer: propsFolder]);
|
||||
activeUserRoles = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -74,6 +78,7 @@
|
||||
- (void) dealloc
|
||||
{
|
||||
[versionsMessage release];
|
||||
[activeUserRoles release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -82,7 +87,8 @@
|
||||
{
|
||||
static NSArray *fields = nil;
|
||||
NSArray *records;
|
||||
EOQualifier *componentQualifier, *fetchQualifier;
|
||||
NSMutableArray *qualifierArray;
|
||||
EOQualifier *fetchQualifier, *aclQualifier;
|
||||
GCSFolder *ocsFolder;
|
||||
EOFetchSpecification *fs;
|
||||
NSArray *keys;
|
||||
@@ -91,24 +97,27 @@
|
||||
fields = [[NSArray alloc]
|
||||
initWithObjects: @"c_name", @"c_version", nil];
|
||||
|
||||
componentQualifier = [self componentQualifier];
|
||||
if (qualifier)
|
||||
qualifierArray = [NSMutableArray new];
|
||||
if (![[context activeUser] isEqual: [context ownerUser]])
|
||||
{
|
||||
fetchQualifier = [[EOAndQualifier alloc]
|
||||
initWithQualifiers:
|
||||
componentQualifier,
|
||||
qualifier,
|
||||
nil];
|
||||
[fetchQualifier autorelease];
|
||||
aclQualifier = [self aclQualifier];
|
||||
if (aclQualifier)
|
||||
[qualifierArray addObject: aclQualifier];
|
||||
}
|
||||
else
|
||||
fetchQualifier = componentQualifier;
|
||||
[qualifierArray addObject: [self componentQualifier]];
|
||||
if (qualifier)
|
||||
[qualifierArray addObject: qualifier];
|
||||
|
||||
fetchQualifier = [[EOAndQualifier alloc]
|
||||
initWithQualifierArray: qualifierArray];
|
||||
|
||||
ocsFolder = [sogoObject ocsFolder];
|
||||
fs = [EOFetchSpecification
|
||||
fetchSpecificationWithEntityName: [ocsFolder folderName]
|
||||
qualifier: fetchQualifier
|
||||
sortOrderings: sortOrderings];
|
||||
[fetchQualifier release];
|
||||
[qualifierArray release];
|
||||
records = [ocsFolder fetchFields: fields fetchSpecification: fs];
|
||||
keys = [records objectsForKey: @"c_name"
|
||||
notFoundMarker: nil];
|
||||
@@ -516,8 +525,38 @@
|
||||
return deletedKeys;
|
||||
}
|
||||
|
||||
- (NSArray *) activeUserRoles
|
||||
{
|
||||
SOGoUser *activeUser;
|
||||
|
||||
if (!activeUserRoles)
|
||||
{
|
||||
activeUser = [[self context] activeUser];
|
||||
activeUserRoles = [activeUser rolesForObject: sogoObject
|
||||
inContext: [context woContext]];
|
||||
[activeUserRoles retain];
|
||||
}
|
||||
|
||||
return activeUserRoles;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanCreateMessages
|
||||
{
|
||||
return [[self activeUserRoles] containsObject: SOGoRole_ObjectCreator];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanDeleteMessages
|
||||
{
|
||||
return [[self activeUserRoles] containsObject: SOGoRole_ObjectEraser];
|
||||
}
|
||||
|
||||
/* subclasses */
|
||||
|
||||
- (EOQualifier *) aclQualifier
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (EOQualifier *) componentQualifier
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
@interface MAPIStoreGCSMessageTable : MAPIStoreMessageTable
|
||||
|
||||
- (EOQualifier *) componentQualifier;
|
||||
- (NSString *) sortIdentifierForProperty: (enum MAPITAGS) property;
|
||||
|
||||
@end
|
||||
|
||||
@@ -152,13 +152,6 @@
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (EOQualifier *) componentQualifier
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
/* sorting */
|
||||
|
||||
- (EOSortOrdering *) _sortOrderingFromSortOrder: (struct SSortOrder *) sortOrder
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
NSArray *attachmentKeys;
|
||||
NSMutableDictionary *attachmentParts;
|
||||
NSMutableArray *activeTables;
|
||||
NSArray *activeUserRoles;
|
||||
}
|
||||
|
||||
- (void) getMessageData: (struct mapistore_message **) dataPtr
|
||||
@@ -70,6 +71,8 @@
|
||||
inMemCtx: (TALLOC_CTX *) memCtx;
|
||||
- (NSArray *) activeContainerMessageTables;
|
||||
|
||||
- (NSArray *) activeUserRoles;
|
||||
|
||||
/* subclasses */
|
||||
- (void) save;
|
||||
|
||||
@@ -77,6 +80,9 @@
|
||||
- (MAPIStoreAttachment *) createAttachment;
|
||||
- (MAPIStoreAttachmentTable *) attachmentTable;
|
||||
|
||||
- (BOOL) subscriberCanReadMessage;
|
||||
- (BOOL) subscriberCanModifyMessage;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* MAPISTOREMESSAGE_H */
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#import <Foundation/NSURL.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <SOGo/SOGoObject.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
#import "MAPIStoreActiveTables.h"
|
||||
@@ -137,6 +138,7 @@ rtf2html (NSData *compressedRTF)
|
||||
{
|
||||
attachmentParts = [NSMutableDictionary new];
|
||||
activeTables = [NSMutableArray new];
|
||||
activeUserRoles = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -144,6 +146,7 @@ rtf2html (NSData *compressedRTF)
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[activeUserRoles release];
|
||||
[attachmentKeys release];
|
||||
[attachmentParts release];
|
||||
[activeTables release];
|
||||
@@ -799,4 +802,31 @@ rtf2html (NSData *compressedRTF)
|
||||
[activeTables removeObject: activeTable];
|
||||
}
|
||||
|
||||
- (NSArray *) activeUserRoles
|
||||
{
|
||||
MAPIStoreContext *context;
|
||||
|
||||
if (!activeUserRoles)
|
||||
{
|
||||
context = [self context];
|
||||
|
||||
activeUserRoles = [[context activeUser]
|
||||
rolesForObject: sogoObject
|
||||
inContext: [context woContext]];
|
||||
[activeUserRoles retain];
|
||||
}
|
||||
|
||||
return activeUserRoles;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -359,7 +359,7 @@ sogo_folder_get_child_count(void *folder_object, uint8_t table_type, uint32_t *c
|
||||
static int
|
||||
sogo_folder_open_message(void *folder_object,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
uint64_t mid,
|
||||
uint64_t mid, bool write_access,
|
||||
void **message_object)
|
||||
{
|
||||
struct MAPIStoreTallocWrapper *wrapper;
|
||||
@@ -375,7 +375,10 @@ sogo_folder_open_message(void *folder_object,
|
||||
wrapper = folder_object;
|
||||
folder = wrapper->MAPIStoreSOGoObject;
|
||||
pool = [NSAutoreleasePool new];
|
||||
rc = [folder openMessage: &message withMID: mid inMemCtx: mem_ctx];
|
||||
rc = [folder openMessage: &message
|
||||
withMID: mid
|
||||
forWriting: write_access
|
||||
inMemCtx: mem_ctx];
|
||||
if (rc == MAPISTORE_SUCCESS)
|
||||
*message_object = [message tallocWrapper: mem_ctx];
|
||||
[pool release];
|
||||
|
||||
@@ -157,4 +157,10 @@
|
||||
return rights;
|
||||
}
|
||||
|
||||
- (EOQualifier *) aclQualifier
|
||||
{
|
||||
return [EOQualifier qualifierWithQualifierFormat:
|
||||
[(SOGoAppointmentFolder *) sogoObject aclSQLListingFilter]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -31,10 +31,13 @@
|
||||
#import <NGCards/iCalTimeZone.h>
|
||||
#import <NGCards/iCalToDo.h>
|
||||
#import <NGCards/iCalPerson.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <Appointments/iCalEntityObject+SOGo.h>
|
||||
#import <Appointments/SOGoTaskObject.h>
|
||||
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStoreTasksFolder.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "NSDate+MAPIStore.h"
|
||||
@@ -89,7 +92,7 @@
|
||||
{
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
*data = [[task summary] asUnicodeInMemCtx: memCtx];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
@@ -101,7 +104,7 @@
|
||||
uint32_t v;
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
if ([[task priority] isEqualToString: @"9"])
|
||||
v = 0x0;
|
||||
else if ([[task priority] isEqualToString: @"1"])
|
||||
@@ -119,7 +122,7 @@
|
||||
{
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
*data = MAPIBoolValue (memCtx,
|
||||
[[task status] isEqualToString: @"COMPLETED"]);
|
||||
|
||||
@@ -132,7 +135,7 @@
|
||||
double doubleValue;
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
|
||||
doubleValue = ((double) [[task percentComplete] intValue] / 100);
|
||||
*data = MAPIDoubleValue (memCtx, doubleValue);
|
||||
@@ -147,7 +150,7 @@
|
||||
NSCalendarDate *dateValue;
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
|
||||
dateValue = [task completed];
|
||||
if (dateValue)
|
||||
@@ -209,7 +212,7 @@
|
||||
NSCalendarDate *dateValue;
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
dateValue = [task due];
|
||||
if (dateValue)
|
||||
*data = [dateValue asFileTimeInMemCtx: memCtx];
|
||||
@@ -226,7 +229,7 @@
|
||||
NSCalendarDate *dateValue;
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
dateValue = [task startDate];
|
||||
if (dateValue)
|
||||
*data = [dateValue asFileTimeInMemCtx: memCtx];
|
||||
@@ -262,7 +265,7 @@
|
||||
uint32_t longValue;
|
||||
iCalToDo *task;
|
||||
|
||||
task = [sogoObject component: NO secure: NO];
|
||||
task = [sogoObject component: NO secure: YES];
|
||||
status = [task status];
|
||||
if (![status length]
|
||||
|| [status isEqualToString: @"NEEDS-ACTION"])
|
||||
@@ -296,6 +299,27 @@
|
||||
return [self getLongZero: data inMemCtx: memCtx];
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanReadMessage
|
||||
{
|
||||
return ([[self activeUserRoles]
|
||||
containsObject: SOGoCalendarRole_ComponentViewer]
|
||||
|| [self subscriberCanModifyMessage]);
|
||||
}
|
||||
|
||||
- (BOOL) subscriberCanModifyMessage
|
||||
{
|
||||
BOOL rc;
|
||||
NSArray *roles = [self activeUserRoles];
|
||||
|
||||
if (isNew)
|
||||
rc = [roles containsObject: SOGoRole_ObjectCreator];
|
||||
else
|
||||
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|
||||
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) save
|
||||
{
|
||||
iCalCalendar *vCalendar;
|
||||
|
||||
@@ -84,6 +84,9 @@ static Class MAPIStoreTasksMessageK = Nil;
|
||||
else
|
||||
rc = MAPIRestrictionStateAlwaysFalse;
|
||||
break;
|
||||
case PR_SENSITIVITY:
|
||||
rc = MAPIRestrictionStateAlwaysTrue;
|
||||
break;
|
||||
case PR_RULE_PROVIDER_UNICODE: // TODO: what's this?
|
||||
rc = MAPIRestrictionStateAlwaysTrue;
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
diff -durpN unrtf-0.21.2.old/outputs/html.conf unrtf-0.21.2/outputs/html.conf
|
||||
--- unrtf-0.21.2.old/outputs/html.conf 2010-08-15 08:44:09.000000000 -0400
|
||||
+++ unrtf-0.21.2/outputs/html.conf 2011-11-09 15:48:29.982798286 -0500
|
||||
+++ unrtf-0.21.2/outputs/html.conf 2011-11-09 15:53:21.802783775 -0500
|
||||
@@ -5,7 +5,7 @@ comment_end
|
||||
-->
|
||||
|
||||
@@ -12,7 +12,7 @@ diff -durpN unrtf-0.21.2.old/outputs/html.conf unrtf-0.21.2/outputs/html.conf
|
||||
|
||||
diff -durpN unrtf-0.21.2.old/src/attr.c unrtf-0.21.2/src/attr.c
|
||||
--- unrtf-0.21.2.old/src/attr.c 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/attr.c 2011-11-09 15:48:29.990798214 -0500
|
||||
+++ unrtf-0.21.2/src/attr.c 2011-12-01 10:14:45.282855488 -0500
|
||||
@@ -1,23 +1,23 @@
|
||||
/*=============================================================================
|
||||
- GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
@@ -1176,7 +1176,7 @@ diff -durpN unrtf-0.21.2.old/src/attr.c unrtf-0.21.2/src/attr.c
|
||||
+ {
|
||||
+ col = (Collection *)my_malloc(sizeof(Collection));
|
||||
+ col->nr = nr;
|
||||
+ col->text = text;
|
||||
+ col->text = strdup(text);
|
||||
+ col->next = NULL;
|
||||
+ }
|
||||
+ else
|
||||
@@ -1188,7 +1188,7 @@ diff -durpN unrtf-0.21.2.old/src/attr.c unrtf-0.21.2/src/attr.c
|
||||
+ /* Here is a memory leak but not heavy. Do we need to care about this?
|
||||
+ my_free(a->alias.text);
|
||||
+ */
|
||||
+ c->text = text;
|
||||
+ c->text = strdup(text);
|
||||
|
||||
- return col;
|
||||
- }
|
||||
@@ -1207,7 +1207,7 @@ diff -durpN unrtf-0.21.2.old/src/attr.c unrtf-0.21.2/src/attr.c
|
||||
- }
|
||||
+ c->next = (Collection *)my_malloc(sizeof(Collection));
|
||||
+ c->next->nr = nr;
|
||||
+ c->next->text = text;
|
||||
+ c->next->text = strdup(text);
|
||||
+ c->next->next = NULL;
|
||||
+ }
|
||||
|
||||
@@ -1239,7 +1239,7 @@ diff -durpN unrtf-0.21.2.old/src/attr.c unrtf-0.21.2/src/attr.c
|
||||
}
|
||||
|
||||
/*========================================================================
|
||||
@@ -855,13 +831,13 @@ get_from_collection(Collection *c, int n
|
||||
@@ -855,13 +831,15 @@ get_from_collection(Collection *c, int n
|
||||
void
|
||||
free_collection(Collection *c)
|
||||
{
|
||||
@@ -1255,14 +1255,17 @@ diff -durpN unrtf-0.21.2.old/src/attr.c unrtf-0.21.2/src/attr.c
|
||||
+ while (c != NULL)
|
||||
+ {
|
||||
+ c2 = c->next;
|
||||
+ if (c->text) {
|
||||
+ my_free((void *)c->text);
|
||||
+ }
|
||||
+ my_free((void *)c);
|
||||
+ c = c2;
|
||||
+ }
|
||||
}
|
||||
|
||||
-
|
||||
diff -durpN unrtf-0.21.2.old/src/attr.h unrtf-0.21.2/src/attr.h
|
||||
--- unrtf-0.21.2.old/src/attr.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/attr.h 2011-11-09 15:48:29.990798214 -0500
|
||||
+++ unrtf-0.21.2/src/attr.h 2011-11-09 15:53:21.806783776 -0500
|
||||
@@ -1,23 +1,23 @@
|
||||
/*=============================================================================
|
||||
- GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
@@ -1412,7 +1415,7 @@ diff -durpN unrtf-0.21.2.old/src/attr.h unrtf-0.21.2/src/attr.h
|
||||
+#endif /* ATTR_H */
|
||||
diff -durpN unrtf-0.21.2.old/src/convert.c unrtf-0.21.2/src/convert.c
|
||||
--- unrtf-0.21.2.old/src/convert.c 2011-06-07 08:00:23.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/convert.c 2011-11-09 15:52:04.710787385 -0500
|
||||
+++ unrtf-0.21.2/src/convert.c 2011-12-01 10:32:16.958862025 -0500
|
||||
@@ -1,24 +1,24 @@
|
||||
|
||||
/*===========================================================================
|
||||
@@ -6856,7 +6859,7 @@ diff -durpN unrtf-0.21.2.old/src/convert.c unrtf-0.21.2/src/convert.c
|
||||
}
|
||||
|
||||
|
||||
@@ -3652,37 +3664,225 @@ word_print_core (Word *w)
|
||||
@@ -3652,37 +3664,227 @@ word_print_core (Word *w)
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
@@ -7045,6 +7048,8 @@ diff -durpN unrtf-0.21.2.old/src/convert.c unrtf-0.21.2/src/convert.c
|
||||
+ }
|
||||
+
|
||||
+ hash_free(&cc);
|
||||
+ if (cc.input_str)
|
||||
+ my_free(cc.input_str);
|
||||
+ word_free(word);
|
||||
+ fonttable_free(oc.conversion);
|
||||
+ if (my_iconv_is_valid(oc.conversion->desc))
|
||||
@@ -7106,7 +7111,7 @@ diff -durpN unrtf-0.21.2.old/src/convert.c unrtf-0.21.2/src/convert.c
|
||||
}
|
||||
diff -durpN unrtf-0.21.2.old/src/convert.h unrtf-0.21.2/src/convert.h
|
||||
--- unrtf-0.21.2.old/src/convert.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/convert.h 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/convert.h 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -36,18 +36,135 @@
|
||||
|
||||
#ifndef _CONVERT
|
||||
@@ -7250,7 +7255,7 @@ diff -durpN unrtf-0.21.2.old/src/convert.h unrtf-0.21.2/src/convert.h
|
||||
|
||||
diff -durpN unrtf-0.21.2.old/src/defs.h unrtf-0.21.2/src/defs.h
|
||||
--- unrtf-0.21.2.old/src/defs.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/defs.h 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/defs.h 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -64,9 +64,6 @@
|
||||
#define SKIP_ONE_WORD 2
|
||||
#endif
|
||||
@@ -7270,7 +7275,7 @@ diff -durpN unrtf-0.21.2.old/src/defs.h unrtf-0.21.2/src/defs.h
|
||||
+#define DEFAULT_OUTPUT "html"
|
||||
diff -durpN unrtf-0.21.2.old/src/error.c unrtf-0.21.2/src/error.c
|
||||
--- unrtf-0.21.2.old/src/error.c 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/error.c 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/error.c 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -51,27 +51,11 @@
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
@@ -7315,7 +7320,7 @@ diff -durpN unrtf-0.21.2.old/src/error.c unrtf-0.21.2/src/error.c
|
||||
#endif
|
||||
diff -durpN unrtf-0.21.2.old/src/error.h unrtf-0.21.2/src/error.h
|
||||
--- unrtf-0.21.2.old/src/error.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/error.h 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/error.h 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -37,9 +37,10 @@
|
||||
|
||||
#define CHECK_MALLOC_SUCCESS(XX) { if ((XX)==NULL) { fprintf (stderr, "internal error: cannot allocate memory in %s at %d\n", __FILE__, __LINE__); exit (1); }}
|
||||
@@ -7330,7 +7335,7 @@ diff -durpN unrtf-0.21.2.old/src/error.h unrtf-0.21.2/src/error.h
|
||||
|
||||
diff -durpN unrtf-0.21.2.old/src/hash.c unrtf-0.21.2/src/hash.c
|
||||
--- unrtf-0.21.2.old/src/hash.c 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/hash.c 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/hash.c 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -53,24 +53,16 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
@@ -7535,7 +7540,7 @@ diff -durpN unrtf-0.21.2.old/src/hash.c unrtf-0.21.2/src/hash.c
|
||||
+}
|
||||
diff -durpN unrtf-0.21.2.old/src/hash.h unrtf-0.21.2/src/hash.h
|
||||
--- unrtf-0.21.2.old/src/hash.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/hash.h 2011-11-09 15:51:52.846788680 -0500
|
||||
+++ unrtf-0.21.2/src/hash.h 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -32,11 +32,15 @@
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
@@ -7559,7 +7564,7 @@ diff -durpN unrtf-0.21.2.old/src/hash.h unrtf-0.21.2/src/hash.h
|
||||
+#endif /* HASH_H */
|
||||
diff -durpN unrtf-0.21.2.old/src/main.c unrtf-0.21.2/src/main.c
|
||||
--- unrtf-0.21.2.old/src/main.c 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/main.c 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/main.c 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -1,23 +1,23 @@
|
||||
/*=============================================================================
|
||||
- GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
@@ -7981,7 +7986,7 @@ diff -durpN unrtf-0.21.2.old/src/main.c unrtf-0.21.2/src/main.c
|
||||
-
|
||||
diff -durpN unrtf-0.21.2.old/src/main.h unrtf-0.21.2/src/main.h
|
||||
--- unrtf-0.21.2.old/src/main.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/main.h 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/main.h 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -35,21 +35,8 @@
|
||||
* 17 Jan 10, daved@physiol.usyd.edu.au: change CONFIG_DIR to drop outputs/
|
||||
*--------------------------------------------------------------------*/
|
||||
@@ -8007,7 +8012,7 @@ diff -durpN unrtf-0.21.2.old/src/main.h unrtf-0.21.2/src/main.h
|
||||
+#define USAGE "unrtf [--version] [--verbose] [--help] [--nopict|-n] [--noremap] [--html] [--text] [--vt] [--latex] [--rtf] [-P config_search_path] [-t <file_with_tags>)] <filename>"
|
||||
diff -durpN unrtf-0.21.2.old/src/Makefile.am unrtf-0.21.2/src/Makefile.am
|
||||
--- unrtf-0.21.2.old/src/Makefile.am 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/Makefile.am 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/Makefile.am 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -13,7 +13,6 @@ unrtf_SOURCES = attr.c attr.h \
|
||||
malloc.c malloc.h \
|
||||
output.c output.h \
|
||||
@@ -8018,7 +8023,7 @@ diff -durpN unrtf-0.21.2.old/src/Makefile.am unrtf-0.21.2/src/Makefile.am
|
||||
util.c util.h \
|
||||
diff -durpN unrtf-0.21.2.old/src/malloc.c unrtf-0.21.2/src/malloc.c
|
||||
--- unrtf-0.21.2.old/src/malloc.c 2010-07-09 01:13:05.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/malloc.c 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/malloc.c 2011-12-01 10:36:18.514864760 -0500
|
||||
@@ -135,19 +135,19 @@ total_malloced (void) {
|
||||
*=======================================================================*/
|
||||
|
||||
@@ -8058,7 +8063,7 @@ diff -durpN unrtf-0.21.2.old/src/malloc.c unrtf-0.21.2/src/malloc.c
|
||||
}
|
||||
diff -durpN unrtf-0.21.2.old/src/malloc.h unrtf-0.21.2/src/malloc.h
|
||||
--- unrtf-0.21.2.old/src/malloc.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/malloc.h 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/malloc.h 2011-11-09 15:53:21.810783765 -0500
|
||||
@@ -32,9 +32,10 @@
|
||||
* 09 Nov 08, arkadiusz.firus@gmail.com: added my_realloc
|
||||
*--------------------------------------------------------------------*/
|
||||
@@ -8074,7 +8079,7 @@ diff -durpN unrtf-0.21.2.old/src/malloc.h unrtf-0.21.2/src/malloc.h
|
||||
+extern char * my_strdup (struct ConversionContext *, char*);
|
||||
diff -durpN unrtf-0.21.2.old/src/my_iconv.c unrtf-0.21.2/src/my_iconv.c
|
||||
--- unrtf-0.21.2.old/src/my_iconv.c 2010-08-16 00:12:43.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/my_iconv.c 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/my_iconv.c 2011-11-09 15:53:21.814783744 -0500
|
||||
@@ -12,154 +12,133 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -8316,7 +8321,7 @@ diff -durpN unrtf-0.21.2.old/src/my_iconv.c unrtf-0.21.2/src/my_iconv.c
|
||||
|
||||
diff -durpN unrtf-0.21.2.old/src/my_iconv.h unrtf-0.21.2/src/my_iconv.h
|
||||
--- unrtf-0.21.2.old/src/my_iconv.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/my_iconv.h 2011-11-09 15:48:29.998798267 -0500
|
||||
+++ unrtf-0.21.2/src/my_iconv.h 2011-11-09 15:53:21.814783744 -0500
|
||||
@@ -5,6 +5,9 @@
|
||||
* Purpose: my_conv definitions
|
||||
*--------------------------------------------------------------------*/
|
||||
@@ -8346,7 +8351,7 @@ diff -durpN unrtf-0.21.2.old/src/my_iconv.h unrtf-0.21.2/src/my_iconv.h
|
||||
+#endif /* _MY_ICONV */
|
||||
diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
--- unrtf-0.21.2.old/src/output.c 2011-06-07 08:04:38.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/output.c 2011-11-09 15:50:35.126792073 -0500
|
||||
+++ unrtf-0.21.2/src/output.c 2011-12-01 10:30:41.598861702 -0500
|
||||
@@ -1,23 +1,23 @@
|
||||
/*=============================================================================
|
||||
- GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
@@ -8449,7 +8454,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
|
||||
/*========================================================================
|
||||
* Name: op_translate_char
|
||||
@@ -119,102 +122,110 @@ op_free (OutputPersonality *op)
|
||||
@@ -119,102 +122,113 @@ op_free (OutputPersonality *op)
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
@@ -8463,7 +8468,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
- size_t inbytes = (ch / 256) + 1, outbytes = inbytes * 4, i;
|
||||
+ char *result=NULL;
|
||||
+ static char output_buffer[2]={ 0, 0 };
|
||||
+ char *inbuf, *outbuf, *originbuf, *origoutbuf;
|
||||
+ char *inbuf, *outbuf, *originbuf, *origoutbuf, *alias;
|
||||
+ size_t inbytes = (ch / 256) + 1, outbytes = inbytes * 4, i;
|
||||
+ my_iconv_t cd;
|
||||
|
||||
@@ -8615,7 +8620,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
+ /* End of conversion*/
|
||||
|
||||
- result = get_alias(op, ch);
|
||||
+ result = get_alias(op, ch);
|
||||
+ alias = get_alias(op, ch);
|
||||
|
||||
- if (result == NULL)
|
||||
- if (ch > 127 && op->unisymbol_print)
|
||||
@@ -8623,23 +8628,26 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
- else
|
||||
- result = outbuf;
|
||||
- }
|
||||
+ if (result == NULL)
|
||||
+ if (alias == NULL)
|
||||
+ {
|
||||
+ if (ch > 127 && op->unisymbol_print)
|
||||
+ result = assemble_string(op->unisymbol_print, ch);
|
||||
+ else
|
||||
+ result = outbuf;
|
||||
+ result = strdup(outbuf);
|
||||
+ }
|
||||
+ else
|
||||
+ result = strdup(alias);
|
||||
|
||||
- return result;
|
||||
+ free (originbuf);
|
||||
+ free (origoutbuf);
|
||||
+ }
|
||||
+
|
||||
+ return result;
|
||||
}
|
||||
|
||||
#if 0 /* daved - 0.21.2 */
|
||||
@@ -227,123 +238,122 @@ op_translate_char (OutputPersonality *op
|
||||
@@ -227,123 +241,122 @@ op_translate_char (OutputPersonality *op
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
@@ -8851,7 +8859,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -357,113 +367,115 @@ op_translate_str (OutputPersonality *op,
|
||||
@@ -357,113 +370,115 @@ op_translate_str (OutputPersonality *op,
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
@@ -9050,7 +9058,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
}
|
||||
#endif
|
||||
/*========================================================================
|
||||
@@ -475,123 +487,113 @@ op_translate_doublet (OutputPersonality
|
||||
@@ -475,123 +490,113 @@ op_translate_doublet (OutputPersonality
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
@@ -9277,7 +9285,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
}
|
||||
|
||||
|
||||
@@ -604,123 +606,113 @@ op_begin_std_fontsize (OutputPersonality
|
||||
@@ -604,123 +609,113 @@ op_begin_std_fontsize (OutputPersonality
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
@@ -9504,7 +9512,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
}
|
||||
|
||||
#if 1 /* AK3 - AF */
|
||||
@@ -734,7 +726,7 @@ op_end_std_fontsize (OutputPersonality *
|
||||
@@ -734,7 +729,7 @@ op_end_std_fontsize (OutputPersonality *
|
||||
void
|
||||
add_alias(OutputPersonality *op, int nr, char *text)
|
||||
{
|
||||
@@ -9513,7 +9521,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
}
|
||||
|
||||
/*========================================================================
|
||||
@@ -745,9 +737,8 @@ add_alias(OutputPersonality *op, int nr,
|
||||
@@ -745,9 +740,8 @@ add_alias(OutputPersonality *op, int nr,
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
@@ -9527,7 +9535,7 @@ diff -durpN unrtf-0.21.2.old/src/output.c unrtf-0.21.2/src/output.c
|
||||
-
|
||||
diff -durpN unrtf-0.21.2.old/src/output.h unrtf-0.21.2/src/output.h
|
||||
--- unrtf-0.21.2.old/src/output.h 2010-08-11 21:09:02.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/output.h 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/output.h 2011-11-09 15:53:21.814783744 -0500
|
||||
@@ -44,227 +44,228 @@
|
||||
typedef Collection Aliases;
|
||||
|
||||
@@ -9915,7 +9923,7 @@ diff -durpN unrtf-0.21.2.old/src/output.h unrtf-0.21.2/src/output.h
|
||||
-
|
||||
diff -durpN unrtf-0.21.2.old/src/parse.c unrtf-0.21.2/src/parse.c
|
||||
--- unrtf-0.21.2.old/src/parse.c 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/parse.c 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/parse.c 2011-12-01 10:27:41.486860883 -0500
|
||||
@@ -1,23 +1,23 @@
|
||||
/*=============================================================================
|
||||
- GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
@@ -10170,7 +10178,7 @@ diff -durpN unrtf-0.21.2.old/src/parse.c unrtf-0.21.2/src/parse.c
|
||||
}
|
||||
|
||||
|
||||
@@ -222,183 +179,181 @@ expand_word_buffer ()
|
||||
@@ -222,183 +179,184 @@ expand_word_buffer ()
|
||||
*=======================================================================*/
|
||||
|
||||
static int
|
||||
@@ -10202,6 +10210,9 @@ diff -durpN unrtf-0.21.2.old/src/parse.c unrtf-0.21.2/src/parse.c
|
||||
- error_handler("Cannot allocate word storage");
|
||||
+ /* Get some storage for a word.
|
||||
+ */
|
||||
+ if (cc->input_str) {
|
||||
+ my_free(cc->input_str);
|
||||
+ }
|
||||
+ cc->input_str = my_malloc (cc->current_max_length);
|
||||
+ if (!cc->input_str)
|
||||
+ error_handler(cc, "Cannot allocate word storage");
|
||||
@@ -10509,7 +10520,7 @@ diff -durpN unrtf-0.21.2.old/src/parse.c unrtf-0.21.2/src/parse.c
|
||||
}
|
||||
|
||||
|
||||
@@ -412,44 +367,42 @@ read_word (FILE *f)
|
||||
@@ -412,44 +370,42 @@ read_word (FILE *f)
|
||||
*=======================================================================*/
|
||||
|
||||
Word *
|
||||
@@ -10586,7 +10597,7 @@ diff -durpN unrtf-0.21.2.old/src/parse.c unrtf-0.21.2/src/parse.c
|
||||
}
|
||||
diff -durpN unrtf-0.21.2.old/src/parse.h unrtf-0.21.2/src/parse.h
|
||||
--- unrtf-0.21.2.old/src/parse.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/parse.h 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/parse.h 2011-11-09 15:53:21.814783744 -0500
|
||||
@@ -38,8 +38,6 @@
|
||||
#include "word.h"
|
||||
#endif
|
||||
@@ -10679,7 +10690,7 @@ diff -durpN unrtf-0.21.2.old/src/path.h unrtf-0.21.2/src/path.h
|
||||
-void show_dirs();
|
||||
diff -durpN unrtf-0.21.2.old/src/unrtf.h unrtf-0.21.2/src/unrtf.h
|
||||
--- unrtf-0.21.2.old/src/unrtf.h 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ unrtf-0.21.2/src/unrtf.h 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/unrtf.h 2011-11-09 15:53:21.814783744 -0500
|
||||
@@ -0,0 +1,55 @@
|
||||
+/*===========================================================================
|
||||
+ GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
@@ -10738,7 +10749,7 @@ diff -durpN unrtf-0.21.2.old/src/unrtf.h unrtf-0.21.2/src/unrtf.h
|
||||
+#endif /* UNRTF_H */
|
||||
diff -durpN unrtf-0.21.2.old/src/user.c unrtf-0.21.2/src/user.c
|
||||
--- unrtf-0.21.2.old/src/user.c 2011-06-07 08:08:17.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/user.c 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/user.c 2011-12-01 09:59:46.215667415 -0500
|
||||
@@ -7,7 +7,7 @@
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
@@ -11168,7 +11179,7 @@ diff -durpN unrtf-0.21.2.old/src/user.c unrtf-0.21.2/src/user.c
|
||||
|
||||
diff -durpN unrtf-0.21.2.old/src/user.h unrtf-0.21.2/src/user.h
|
||||
--- unrtf-0.21.2.old/src/user.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/user.h 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/user.h 2011-11-09 15:53:21.814783744 -0500
|
||||
@@ -151,9 +151,10 @@
|
||||
|
||||
#ifndef _USER
|
||||
@@ -11184,7 +11195,7 @@ diff -durpN unrtf-0.21.2.old/src/user.h unrtf-0.21.2/src/user.h
|
||||
#endif
|
||||
diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
--- unrtf-0.21.2.old/src/word.c 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/word.c 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/word.c 2011-12-01 10:15:34.590855632 -0500
|
||||
@@ -1,23 +1,23 @@
|
||||
/*=============================================================================
|
||||
- GNU UnRTF, a command-line program to convert RTF documents to other formats.
|
||||
@@ -11243,7 +11254,7 @@ diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
/*========================================================================
|
||||
* Name: word_string
|
||||
* Purpose: Obtains the string of a Word object. This involves accessing
|
||||
@@ -90,12 +87,12 @@ static int indent_level=0;
|
||||
@@ -90,12 +87,14 @@ static int indent_level=0;
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
@@ -11256,13 +11267,15 @@ diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
+word_string (const struct ConversionContext *cc, Word *w) {
|
||||
+ char *str;
|
||||
+ CHECK_PARAM_NOT_NULL(w);
|
||||
+
|
||||
+ if (w->hash_index) str = hash_get_string (cc, w->hash_index);
|
||||
+ else str = NULL;
|
||||
+
|
||||
+ return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,24 +105,22 @@ word_string (Word *w) {
|
||||
@@ -108,24 +107,22 @@ word_string (Word *w) {
|
||||
*=======================================================================*/
|
||||
|
||||
Word *
|
||||
@@ -11297,7 +11310,7 @@ diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
/*========================================================================
|
||||
* Name: word_free
|
||||
* Purpose: Deallocates a Word object. This is only called at the end of
|
||||
@@ -135,20 +130,20 @@ word_new (char *str) {
|
||||
@@ -135,20 +132,20 @@ word_new (char *str) {
|
||||
*=======================================================================*/
|
||||
|
||||
void word_free (Word *w) {
|
||||
@@ -11329,7 +11342,7 @@ diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
}
|
||||
|
||||
|
||||
@@ -165,14 +160,14 @@ void word_free (Word *w) {
|
||||
@@ -165,14 +162,14 @@ void word_free (Word *w) {
|
||||
static void
|
||||
print_indentation (int level)
|
||||
{
|
||||
@@ -11351,7 +11364,7 @@ diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
}
|
||||
|
||||
|
||||
@@ -186,33 +181,33 @@ print_indentation (int level)
|
||||
@@ -186,33 +183,33 @@ print_indentation (int level)
|
||||
*=======================================================================*/
|
||||
|
||||
void
|
||||
@@ -11407,7 +11420,7 @@ diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
}
|
||||
|
||||
#if 1 /* AK6 - AF */
|
||||
@@ -223,56 +218,56 @@ word_dump (Word *w)
|
||||
@@ -223,56 +220,56 @@ word_dump (Word *w)
|
||||
* Returns: Optimized word.
|
||||
*=======================================================================*/
|
||||
Word *
|
||||
@@ -11507,7 +11520,7 @@ diff -durpN unrtf-0.21.2.old/src/word.c unrtf-0.21.2/src/word.c
|
||||
|
||||
diff -durpN unrtf-0.21.2.old/src/word.h unrtf-0.21.2/src/word.h
|
||||
--- unrtf-0.21.2.old/src/word.h 2010-07-03 22:30:58.000000000 -0400
|
||||
+++ unrtf-0.21.2/src/word.h 2011-11-09 15:48:30.002798270 -0500
|
||||
+++ unrtf-0.21.2/src/word.h 2011-11-09 15:53:21.814783744 -0500
|
||||
@@ -41,14 +41,15 @@ typedef struct _w {
|
||||
struct _w * child;
|
||||
} Word;
|
||||
|
||||
@@ -140,6 +140,8 @@ typedef enum {
|
||||
|
||||
/* bulk fetches */
|
||||
|
||||
- (NSString *) aclSQLListingFilter;
|
||||
|
||||
- (NSString *) roleForComponentsWithAccessClass: (iCalAccessClass) accessClass
|
||||
forUser: (NSString *) uid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user