diff --git a/ChangeLog b/ChangeLog index 70dc6c225..02f9bc084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-12-13 Wolfgang Sourdeau + * OpenChange/NSData+MAPIStore.m (-asShortBinaryInMemCtx:): new + corrolary method to +dataWithShortBinary:. + * OpenChange/MAPIStoreFileSystemBaseContext.[hm]: new base MAPIStoreContext class that handles requests for objects based on the SOGoMAPIFSFolder and SOGoMAPIFSMessage classes. @@ -82,8 +85,8 @@ * UI/WebServerResources/MailerUI.js (deleteSelectedMessagesCallback): must set the value of - lastClickedRow and lastClickedRowId when selecting the next row. - + lastClickedRow and lastClickedRowId when selecting the next row. + * UI/WebServerResources/HTMLElement.js (refreshSelectionByIds): log invalid references to element IDs. diff --git a/OpenChange/NSData+MAPIStore.h b/OpenChange/NSData+MAPIStore.h index 04101297c..8d6ef2899 100644 --- a/OpenChange/NSData+MAPIStore.h +++ b/OpenChange/NSData+MAPIStore.h @@ -1,4 +1,4 @@ -/* NSData+MAPIStore.h - this file is part of $PROJECT_NAME_HERE$ +/* NSData+MAPIStore.h - this file is part of SOGo * * Copyright (C) 2010 Inverse inc. * @@ -28,10 +28,11 @@ @interface NSData (MAPIStoreDataTypes) + (id) dataWithBinary: (const struct Binary_r *) binData; -+ (id) dataWithShortBinary: (const struct SBinary_short *) binData; - - (struct Binary_r *) asBinaryInMemCtx: (void *) memCtx; ++ (id) dataWithShortBinary: (const struct SBinary_short *) binData; +- (struct SBinary_short *) asShortBinaryInMemCtx: (void *) memCtx; + @end #endif /* NSDATA_MAPISTORE_H */ diff --git a/OpenChange/NSData+MAPIStore.m b/OpenChange/NSData+MAPIStore.m index fd18def5a..c9b41bbb5 100644 --- a/OpenChange/NSData+MAPIStore.m +++ b/OpenChange/NSData+MAPIStore.m @@ -1,4 +1,4 @@ -/* NSData+MAPIStore.m - this file is part of $PROJECT_NAME_HERE$ +/* NSData+MAPIStore.m - this file is part of SOGo * * Copyright (C) 2010 Inverse inc. * @@ -34,11 +34,6 @@ return [NSData dataWithBytes: binData->lpb length: binData->cb]; } -+ (id) dataWithShortBinary: (const struct SBinary_short *) binData -{ - return [NSData dataWithBytes: binData->lpb length: binData->cb]; -} - - (struct Binary_r *) asBinaryInMemCtx: (void *) memCtx { struct Binary_r *binary; @@ -53,4 +48,23 @@ return binary; } ++ (id) dataWithShortBinary: (const struct SBinary_short *) binData +{ + return [NSData dataWithBytes: binData->lpb length: binData->cb]; +} + +- (struct SBinary_short *) asShortBinaryInMemCtx: (void *) memCtx +{ + struct SBinary_short *binary; + uint8_t *lpb; + + binary = talloc_zero (memCtx, struct SBinary_short); + binary->cb = [self length]; + lpb = talloc_array (binary, uint8_t, binary->cb); + [self getBytes: lpb]; + binary->lpb = lpb; + + return binary; +} + @end