Compare commits

...
274 Commits
Author SHA1 Message Date
Ludovic Marcotte 827e9cfca6 Release preparation 2016-10-20 10:47:50 -04:00
Ludovic Marcotte 6d9c5e4542 (fix) make sure we unencode @ signs before storing them in the ACL table 2016-10-20 10:28:11 -04:00
Ludovic Marcotte cad99d476d (fix) We never send IMIP reply when the "initiator" is Outlook 2013/2016 over EAS 2016-10-19 15:18:44 -04:00
Ludovic Marcotte eaf0a19002 (fix) improve handling of email folders without a parent 2016-10-18 19:41:47 -04:00
Ludovic Marcotte a912fe0c5e Updated NEWS 2016-10-17 11:42:13 -04:00
Ludovic Marcotte 73cc81c71f (fix) only consider SMTP proxyAddresses for AD (fixes #3842) 2016-10-17 11:40:17 -04:00
Francis Lachapelle 5796992b56 (js,css) Resizable left column in attendees editor
Will not work in IE since it doesn't support the "resize" CSS property.

Fixes #1479, #3667
2016-10-06 12:27:59 -04:00
Francis Lachapelle be12528a0e Fix condition in UIxPreferences.m 2016-10-04 06:14:41 -04:00
Francis Lachapelle 0fc3791f37 Allow custom email to be one of the user's profile
Fixes #3551
2016-10-03 10:33:49 -04:00
Ludovic Marcotte 3badf13c22 Updated NEWS 2016-10-03 09:09:14 -04:00
Ludovic Marcotte 665367f8f8 (fix) fixed recurring events with timezones for EAS (fixes #3822) 2016-10-03 09:01:20 -04:00
Ludovic Marcotte 340c110442 Updated NEWS 2016-09-29 13:08:21 -04:00
Ludovic Marcotte 81d3d3bc5b (fix) make sure we don't sleep for too long when EAS processes need interruption 2016-09-29 13:07:29 -04:00
Ludovic Marcotte 686b32d78b Release preparation 2016-09-28 10:58:05 -04:00
Francis Lachapelle 6b322e6b75 Fix Serbian translation 2016-09-28 10:37:14 -04:00
Francis Lachapelle 29d004c4a4 Add Serbian translation and update translations 2016-09-28 10:02:25 -04:00
Francis Lachapelle 1a8b82d75d Update NEWS file 2016-09-28 09:34:22 -04:00
Francis Lachapelle ca87ac05a2 Update CKEditor to version 4.5.11 2016-09-28 09:25:09 -04:00
Ludovic Marcotte 0c33bc58b6 Removed old file 2016-09-28 08:56:00 -04:00
Ludovic Marcotte 6319007631 Updated NEWS 2016-09-27 19:51:39 -04:00
Ludovic Marcotte 156a83046b (fix) make sure new cards always have a UID (fixes #3819) 2016-09-27 19:51:16 -04:00
Ludovic Marcotte 84e170a601 (fix) correctly set percent-complete for tasks from the list view (fixes #3197) 2016-09-27 13:43:21 -04:00
Francis Lachapelle 5ada0024af Caching expiration of ACLs assigned to LDAP groups
Fixes #2867
2016-09-26 17:27:12 -04:00
Ludovic Marcotte 7daa6728a1 Updated NEWS 2016-09-26 15:25:07 -04:00
Ludovic Marcotte 1cbced4965 (fix) search in all domain sources for Apple Calendar and properly handle groups 2016-09-26 15:24:51 -04:00
Ludovic Marcotte 323bc50f10 Updated NEWS 2016-09-23 11:30:34 -04:00
Ludovic Marcotte 8c81d55061 (fix) handle 120 EAS status code when message submission fails (fixes #3774) 2016-09-23 11:30:10 -04:00
Ludovic Marcotte 36fb9c138e (fix) added global search for Android 6 2016-09-22 14:23:14 -04:00
Ludovic Marcotte 81aee49555 (fix) avoid generating invalid response if mail isn't found 2016-09-22 12:57:28 -04:00
Ludovic Marcotte ed4c2b3dca (fix) fixed EAS search for iOS devices 2016-09-22 12:55:04 -04:00
Ludovic Marcotte 677df619fd (fix) compiler fixes + first round of iOS fixes 2016-09-22 11:43:03 -04:00
Ludovic Marcotte 40cd481ec0 Updated NEWS 2016-09-21 09:22:26 -04:00
Ludovic Marcotte cfcc4922ac (feat) initial EAS support for server-side mailbox search operations 2016-09-21 09:21:31 -04:00
Ludovic Marcotte 1cf85475d7 Updates for the release 2016-09-14 09:27:29 -04:00
Ludovic Marcotte 83ce0f01b4 Updated NEWS 2016-09-14 09:20:45 -04:00
Ludovic Marcotte d1dcb820bd (fix) EAS yearly rrule generation + small EAS MoveItems fix 2016-09-14 09:20:15 -04:00
Ludovic Marcotte e098b3d050 Updated NEWS 2016-09-13 11:06:32 -04:00
Ludovic Marcotte 18f7bc7e69 (fix) handle binary just like 7 and 8bit 2016-09-13 11:02:26 -04:00
Ludovic Marcotte 1a1afb7b95 Updated NEWS 2016-08-29 16:13:33 -04:00
Ludovic Marcotte 44f7fdc50a (fix) make sure to escape email and all address fields 2016-08-29 15:02:22 -04:00
Francis Lachapelle 3de6e0fc5a Until date of repeat must end after first event 2016-08-29 14:36:04 -04:00
Ludovic Marcotte 928b18890c Updated NEWS 2016-08-19 14:13:21 -04:00
Ludovic Marcotte 828fed54a0 (fix) properly generate the BusyStatus for normal events 2016-08-19 14:12:29 -04:00
Ludovic Marcotte 1b88d17e01 (fix) allow multiple space-delimited addresses in the MailFieldNames column 2016-08-19 11:45:59 -04:00
Ludovic Marcotte 3d54bfb882 (doc) updated regarding previous commit 2016-08-18 15:42:04 -04:00
Ludovic Marcotte 96914b39fb Updated NEWS 2016-08-18 15:38:33 -04:00
Ludovic Marcotte ec11b8abb4 (fix) strip protocol value from proxyAddresses (fixes #3182) 2016-08-18 15:36:46 -04:00
Ludovic Marcotte 2fbe6e8429 Version bump to 2.3.14 2016-08-17 08:18:50 -04:00
Francis Lachapelle ac6b60c4c9 (js,css) Style cancelled events in Calendar module
Fixes #2800
2016-08-12 14:31:28 -04:00
Francis Lachapelle 76eeef2541 (i18n) Update translations 2016-08-12 11:14:30 -04:00
Francis Lachapelle 086b905215 Update CKEditor to version 4.5.10 2016-08-12 10:47:13 -04:00
Ludovic Marcotte 713e0d5ecb (fix) also purge repetitive events that have an old end date 2016-08-10 10:09:59 -04:00
Ludovic Marcotte 58732e316b (fix) minor improvement to SQL query 2016-08-10 09:48:24 -04:00
Ludovic Marcotte 9199d42e51 Minor improvement over previous commit 2016-08-09 16:22:41 -04:00
Ludovic Marcotte 8c217103f8 Updated NEWS 2016-08-09 16:20:59 -04:00
Ludovic Marcotte ab5fd9fef1 (fix) check if the SENT-BY has access to organizer's calendar before modifying attendees' calendar (fixes #3759) 2016-08-09 16:20:01 -04:00
Ludovic Marcotte 165d866cfc (fix) correctly calculate recurrence exceptions when not overlapping the recurrence id 2016-08-05 15:01:21 -04:00
Ludovic Marcotte 8ba6c6d9f5 (fix) updated tests for 403 -> 409 2016-08-05 09:07:24 -04:00
Ludovic Marcotte 960962f92f Fixed typo 2016-08-04 14:12:09 -04:00
Ludovic Marcotte cbb23bd536 Updated changelog 2016-08-04 14:11:35 -04:00
Ludovic Marcotte 196e36acb2 (fix) change 403 to 409 error codes so Lightning doesn't silently fails 2016-08-04 14:09:11 -04:00
Ludovic Marcotte 6c05576e53 Updated NEWS file 2016-08-04 12:51:30 -04:00
Ludovic Marcotte 9449b0df27 (fix) handle domain-less-login case with multi-domain on during backups 2016-08-04 11:28:57 -04:00
Ludovic Marcotte 9ecee32d08 (fix) delete mailbox from the Trash folder
Fixes #595, #1189, #641
2016-08-02 10:30:37 -04:00
Francis Lachapelle 199c9d9237 (js) Improve extraction of HTML signature 2016-07-27 14:01:22 -04:00
Francis Lachapelle d95b90281b Expunge drafts mailbox when a draft is sent 2016-07-27 12:02:00 -04:00
Ludovic Marcotte 8545f89b2f Correctly get the collection/key IDs (fixes #3775) 2016-07-25 06:20:33 -04:00
Ludovic Marcotte c827b62f7f Updated NEWS file 2016-07-21 14:13:47 -04:00
Ludovic Marcotte 16356aaf36 Added EAS folder merge support and fixed long GUID issue (fixes #3460)
Conflicts:

	ActiveSync/SOGoActiveSyncDispatcher+Sync.m
2016-07-21 14:09:50 -04:00
ethoms 4c4d3e4c25 Convert configure script shebang back to /bin/sh for cross-platform compatability (#215) 2016-07-12 14:47:54 -04:00
Francis Lachapelle f638113d53 Improve handling of mail delegates 2016-07-06 15:35:09 -04:00
Francis Lachapelle 09bda83bc8 Update ChangeLog 2016-07-06 07:23:37 -04:00
Francis Lachapelle 04bba82d2e Preparation for release 2.3.13 2016-07-06 07:20:55 -04:00
Ludovic Marcotte 0655e9d76e (fix) make sure to handle nil vs. NSNull values correctly 2016-07-05 22:25:48 -04:00
Francis Lachapelle 4b4846b0a3 (i18n) Update translations 2016-07-05 21:40:29 -04:00
Francis Lachapelle d73148a440 (css,js) Fix mail editor when dragging a button 2016-07-05 15:44:58 -04:00
Francis Lachapelle 23a5274881 (js) Update jQuery File Upload to version 9.12.5 2016-07-05 15:42:25 -04:00
Francis Lachapelle 1586180ebb (css) Fix minimalist skin of CKEditor
See
https://github.com/albatrossdigital/ckeditor-skin-minimalist/issues/2
2016-07-05 12:02:50 -04:00
Francis Lachapelle 43f669b6d9 (js) Remove call to undefined function 2016-07-04 13:55:33 -04:00
Ludovic Marcotte 12314c8bd0 (fix) handle start date in OOF 2016-06-29 11:00:41 -04:00
Ludovic Marcotte c44f90cff0 Fixed missing file 2016-06-27 14:40:44 -04:00
Ludovic Marcotte 3c35ecbd66 Updated NEWS 2016-06-27 14:20:32 -04:00
Ludovic Marcotte f41e30af3a (feat) new sogo-tool truncate-calendar feature 2016-06-27 14:19:23 -04:00
Ludovic Marcotte 99ca9d7046 Updated NEWS 2016-06-23 11:36:04 -04:00
Ludovic Marcotte ac69de19d0 (feat) Initial OOF support in EAS 2016-06-23 11:35:33 -04:00
Ludovic Marcotte 9eda80b5fd Updated NEWS 2016-06-23 11:30:24 -04:00
Ludovic Marcotte bdeb127bb5 (fix) handle inline attachments using EAS 2016-06-23 11:29:45 -04:00
Ludovic Marcotte e4ab4d4ff4 Updated NEWS 2016-06-23 11:21:47 -04:00
Ludovic Marcotte ea87ffd95b (fix) handle base64 encoded EAS protocol version 2016-06-23 11:21:13 -04:00
Ludovic Marcotte f223b745ad Updated NEWS 2016-06-23 11:08:43 -04:00
Ludovic Marcotte c0bfb42c12 (fix) check if EAS identity is ok and use it (fixes #3698) 2016-06-23 11:08:05 -04:00
Francis Lachapelle b09bdab3ca Fix attachment filename with no extension 2016-06-22 17:36:28 -04:00
Roel van Meer b4d51391ed Fix error when adding entry to LDAP address book [bug 3621] 2016-06-16 09:14:34 -04:00
Ludovic Marcotte 92aab1fd1f (fix) properly terminate dictionary inialization 2016-06-14 08:34:22 -04:00
Patrice Levesque c59b4e5189 Fix builds in directory names containing spaces
Prevent ./configure failure when run from a directory
such as "/home/bob/my own sogo directory/"
2016-06-13 14:54:27 -04:00
Ludovic Marcotte 95cf877b49 Updated NEWS 2016-06-13 14:20:26 -04:00
Ludovic Marcotte a14ba4855f (fix) when restoring user's preferences, regenerate Sieve scripts (fixes #3029) 2016-06-13 14:18:59 -04:00
Ludovic Marcotte 738a34822a Updated NEWS 2016-06-13 13:15:55 -04:00
Ludovic Marcotte eab6502d5a (feat) now possible to set a default Sieve filter (fixes #2949) 2016-06-13 13:14:55 -04:00
Ludovic Marcotte dab18608c7 Updated NEWS 2016-06-13 09:17:06 -04:00
Ludovic Marcotte 2b8dbff9ec (fix) avoid showing debug info when not needed (fixes #3726) 2016-06-13 09:16:08 -04:00
Zhang Huangbin 78b5548d20 Supports multiple web domains in Apache.
Using "%(HTTP_HOST)e" will make default Apache config file support multiple web domains, no change required by sys admin.
2016-06-13 08:20:14 -04:00
Francis Lachapelle 7434cc4cf5 Update ChangeLog 2016-06-10 09:52:11 -04:00
Francis Lachapelle ab72066ad6 Preparation for release 2.3.12 2016-06-10 09:50:41 -04:00
Francis Lachapelle 99a4bd3515 (i18n) Update translations 2016-06-10 09:48:35 -04:00
Ludovic Marcotte b2ee1294be Updated NEWS file 2016-06-10 08:40:43 -04:00
Francis Lachapelle 48628e293f (js) Fix display of invitation with category
Fixes #3590
2016-06-09 16:10:11 -04:00
Francis Lachapelle 618e20edb0 Update NEWS file 2016-06-09 15:36:14 -04:00
Francis Lachapelle 4ff1007052 Fix all-day events covering a timezone change
Fixes #3457
2016-06-09 15:34:34 -04:00
Ludovic Marcotte 49a60469c7 (fix) handle flattened timezone definitions (fixes #2690) 2016-06-09 15:01:35 -04:00
Patrice Levesque b51d866a09 Remove Makefile condition for test-uninitialized 2016-06-09 13:06:06 -04:00
Francis Lachapelle e703758b73 Update CKEditor to version 4.5.9 2016-06-09 12:39:54 -04:00
Francis Lachapelle 7422c25d5a Handle c_mail format of quick record of Contacts
In v3, we save all email addresses in the c_mail field of the quick
table. We now do the same in v2.

See @fd4b0942
2016-06-09 12:27:38 -04:00
Francis Lachapelle 636af7da5a Fix encoding of HTML attributes in Contacts module 2016-06-09 11:32:46 -04:00
Francis Lachapelle 827d1d72c8 (i18n) Fix localizable strings in Card viewer 2016-06-08 18:00:57 -04:00
Ludovic Marcotte 53a5561173 (fix) properly initialize values 2016-06-06 13:29:15 -04:00
Ludovic Marcotte 04e804e62f (fix) skip potentially bogus cards coming from LDAP 2016-06-06 13:08:29 -04:00
Patrice Levesque 5e210e6fea Do not force -frecord-gcc-switches flag
The -frecord-gcc-switches flag does not exist for
GCC <= 4.3; hence only use it when available.
2016-06-06 12:53:31 -04:00
Patrice Levesque 0721b92315 Add -O2 compilation by default and -g debug info
Also store GCC command-line switches in the binaries for easier
debugging.
2016-06-06 12:53:23 -04:00
Patrice Levesque dd2f6f8cb1 Fix sogo system user creation (extra)
Missing file in commit 9dcc25abc5
2016-06-06 10:36:14 -04:00
Wayne A. Ptaff 520286e500 Fix sogo system user creation 2016-06-06 10:36:02 -04:00
Francis Lachapelle 40bc512318 Fix recipients of reply message from Sent mailbox
Fixes #2625
2016-06-02 08:26:37 -04:00
Ludovic Marcotte 908e47a25a (fix) more PEEK changes 2016-06-01 09:39:19 -04:00
Francis Lachapelle d9d8ed37f9 Improve handling of attachments names with quotes
Partially resolves #2272
2016-06-01 09:18:22 -04:00
Ludovic Marcotte e5bebf87a8 Updated NEWS file 2016-06-01 09:09:26 -04:00
Ludovic Marcotte 804ebaf8b9 (fix) use PEEK when fetching attachments using ItemOperations 2016-06-01 09:09:03 -04:00
Francis Lachapelle c773717f05 Fix davacl test for secured content 2016-05-31 11:10:05 -04:00
Patrice Levesque 0111b9de92 Ensure 'sogo' UNIX group exists at installation
Previous logic only checked for user existence.
2016-05-30 11:42:39 -04:00
Ludovic Marcotte 717f45f640 (fix) improved previous commit for attributes stripping and UID generation (fixes #3695 and #3696)
Conflicts:

	SoObjects/Appointments/SOGoCalendarComponent.m
2016-05-27 10:55:23 -04:00
Ludovic Marcotte c9c08c14de Updated NEWS 2016-05-26 14:43:57 -04:00
Ludovic Marcotte e4ac2c7603 (fix) make sure to strip X- tags when securing content (#3695) 2016-05-26 14:42:52 -04:00
Patrice Levesque 87c7e64c89 Soft-ensure SOGo is started after MariaDB. 2016-05-24 10:33:42 -04:00
extrafu f1bb581dcc Merge pull request #209 from extrafu/master
Latest OpenChange changes from Zentyal
2016-05-17 13:57:57 -04:00
Ludovic Marcotte e3c7bdd5d8 Revert "Remove listRequiresDot option from *Source classes"
This reverts commit 6b2ec7a2e7.
2016-05-17 13:41:33 -04:00
Ludovic Marcotte 96b36861f2 Updated NEWS file 2016-05-17 11:27:26 -04:00
Ludovic Marcotte 98c5f77945 (fix) safe guard against bogus tz offset definition 2016-05-17 11:18:40 -04:00
Ludovic Marcotte c5526bb70a Fixed NEWS file 2016-05-12 15:09:21 -04:00
Francis Lachapelle 0f9dce8bb2 Update ChangeLog 2016-05-12 13:53:22 -04:00
Francis Lachapelle e35f9c4fad Preparation for release 2.3.11 2016-05-12 13:52:50 -04:00
Francis Lachapelle e830900a5f Fix sensitive range of checkboxes in event editor
Fixes #3665
2016-05-12 09:38:00 -04:00
Ludovic Marcotte 9438685299 Updated NEWS file 2016-05-11 12:30:25 -04:00
Ludovic Marcotte a8574d8e75 (fix) handle multi-value org units 2016-05-11 11:44:46 -04:00
Ludovic Marcotte 11844283d1 (fix) don't use removeItemAtPath - it is not available on Precise
Conflicts:

	SoObjects/Mailer/SOGoDraftObject.m
2016-05-10 15:54:02 -04:00
Ludovic Marcotte af85f4dd92 Updated NEWS 2016-05-10 08:53:41 -04:00
Ludovic Marcotte d601608024 (fix) fixed bogus headers generation when stripping folded bcc headers (fixes #3664) 2016-05-10 08:51:59 -04:00
Ludovic Marcotte f425d61dc7 Updated NEWS 2016-05-09 15:16:14 -04:00
Ludovic Marcotte a4c69215db (fix) use uid and not always-nil login value at this point 2016-05-09 15:14:48 -04:00
Ludovic Marcotte a26b2ec9ef (fix) make sure we don't double-append domain part (fixes #3614) 2016-05-06 13:48:59 -04:00
Ludovic Marcotte fbd2f1511b (fix) make sure found tag is always defined 2016-05-06 08:15:02 -04:00
Ludovic Marcotte 2fb2485b12 (fix) improvement for #3518 2016-05-06 08:02:40 -04:00
Ludovic Marcotte 4ac2811caf Fixed typo 2016-05-03 09:57:22 -04:00
Ludovic Marcotte 83c464f051 Updated NEWS 2016-05-03 09:06:19 -04:00
Ludovic Marcotte da489c6499 (fix) correctly write the content on disk before zipping it 2016-05-03 09:04:36 -04:00
Ludovic Marcotte c1c44b8996 Updated NEWS file 2016-05-02 10:14:30 -04:00
Ludovic Marcotte 92a7cc6b95 (fix) don't mark calendar invitations as read when using EAS and fetching mesasges 2016-05-02 10:09:53 -04:00
Ludovic Marcotte 20d8fde945 (fix) correctly set flags when replying/forwarding emails using EAS 2016-05-02 09:43:13 -04:00
Ludovic Marcotte 3c11c6ac4e Updated NEWS 2016-04-28 00:51:46 -04:00
Ludovic Marcotte a2cec25543 (fix) create cookie after password change using ppolicy 2016-04-28 00:50:57 -04:00
Ludovic Marcotte 04f2002feb (fix) return correct response 2016-04-27 17:04:22 -04:00
Ludovic Marcotte 2c01cb7a0a (fix) ppolicy password change should now work on login page 2016-04-27 16:24:49 -04:00
Ludovic Marcotte 05505eb3e5 (doc) improve the doc regarding non-alpha characters in password (fixes #1059) 2016-04-21 16:01:09 -04:00
Ludovic Marcotte b064f94f03 Updated NEWS file 2016-04-14 15:23:58 -04:00
Ludovic Marcotte 012ac98b31 (fix) encore CR for EAS (fixes #3626) 2016-04-14 15:23:09 -04:00
Patrice Levesque 8d166dd80c Add missing EOF that got lost somewhere 2016-04-13 09:39:50 -04:00
Ludovic Marcotte 065f8478e6 (fix) ported v3 fix to v2 for search+classification (fixes #3629) 2016-04-12 16:11:21 -04:00
Ludovic Marcotte e6ed07879c Fixed typo 2016-04-12 14:31:22 -04:00
Patrice Levesque 3ab9fb481c Port two recent debian packaging commits to debian-multiarch
Add a post-install/upgrade note on DB schema upgrade.
commit 9d7a21883a

Make example scripts in documentation executable.
commit 1f029c9c70
2016-04-12 13:22:31 -04:00
Patrice Levesque 431fe3406f Wrap RequestHeader in conditional for safety.
Prevent breaking users' Apache configuration (and prevent frightening
error message) when mod_headers is not turned on at SOGo installation.
2016-04-12 13:22:21 -04:00
Patrice Levesque 33565bce6a Add a post-install/upgrade note on DB schema upgrade. 2016-04-12 13:21:58 -04:00
Ludovic Marcotte 181f1ec22d Updated NEWS 2016-04-12 13:18:31 -04:00
Ludovic Marcotte fc86e60acc (fix) avoid double-appending domain in cache (fixes #3614) 2016-04-12 13:17:04 -04:00
Ludovic Marcotte c091c05185 (fix) adjust offset datatype to avoid int overflows (fixes #3628) 2016-04-11 15:56:02 -04:00
Patrice Levesque 7432145347 Make example scripts in documentation executable (RHEL).
Addresses bug #3053 at http://sogo.nu/bugs/view.php?id=3053
2016-04-11 14:23:55 -04:00
Patrice Levesque 57fc2082b2 Make example scripts in documentation executable.
Addresses bug #3053 at http://sogo.nu/bugs/view.php?id=3053
2016-04-11 11:37:22 -04:00
Ludovic Marcotte 7f6211ae4a (fix) avoid going to far when checking logins if no login is defined 2016-04-11 10:18:09 -04:00
Francis Lachapelle f9d2acded7 (fix) Calendars list in component editor 2016-04-07 20:00:30 -04:00
Ludovic Marcotte 2115c46fbb (fix) rename the start var to avoid potential SOPE confusion 2016-04-07 14:23:28 -04:00
Ludovic Marcotte 1615545584 (fix) don't escape \r 2016-04-07 09:27:26 -04:00
Ludovic Marcotte 76d39f21f2 Updated NEWS file 2016-04-06 11:21:13 -04:00
Ludovic Marcotte 2b137d6bc0 (fix) properly XML escape wide characters (fixes #3616) 2016-04-06 11:20:46 -04:00
Ludovic Marcotte 5ac42d79a8 Updated NEWS file 2016-04-05 15:24:55 -04:00
Ludovic Marcotte 40b040f26e (fix) Make sure we escape the organizer name over EAS (fixes #3615) 2016-04-05 15:23:09 -04:00
Ludovic Marcotte e931b141bf Release preparation 2016-04-05 12:31:35 -04:00
Francis Lachapelle 1e491d45a5 (i18n) Update translations 2016-04-05 11:54:23 -04:00
Francis Lachapelle 5fbb40a8ae (doc) Improve formatting 2016-04-05 11:01:50 -04:00
Jens Erat 2b13db1d0e (doc) Add caveat on using a database host alias 2016-04-05 11:01:15 -04:00
Ludovic Marcotte 35ed24511d (fix) rename sig handler 2016-04-04 08:35:44 -04:00
Ludovic Marcotte afa71a186c Updated NEWS 2016-04-04 08:31:28 -04:00
Ludovic Marcotte a9dc1c03ce (fix) sanitize non-us-ascii 7bit emails 2016-04-04 08:29:37 -04:00
Ludovic Marcotte aade18eec2 Updated NEWS 2016-04-01 14:54:17 -04:00
Ludovic Marcotte 38ddc0b69a (fix) now cache heartbeat and folders during EAS ping ops (fixes #3606) 2016-04-01 14:53:28 -04:00
Ludovic Marcotte afc4552cb0 (fix) set minimal interval (fixes #3605) 2016-03-30 14:32:32 -04:00
Ludovic Marcotte f2086b76c7 (fix) added missing header 2016-03-30 08:45:50 -04:00
Ludovic Marcotte aaf3e292be Updated NEWS 2016-03-29 11:39:02 -04:00
Ludovic Marcotte 33583ea872 (fix) use PEEK when archiving messages (fixes #2792) 2016-03-29 11:38:30 -04:00
Ludovic Marcotte 1d56a9256a (fix) fixed broken code after commit 663c4a44 2016-03-29 10:38:37 -04:00
Ludovic Marcotte 920b1aea32 Updated NEWS file 2016-03-29 10:35:25 -04:00
Ludovic Marcotte 44d8b63136 (fix) handle EAS termination when SOGo is being shutdown (fixes #3604)
Conflicts:

	ActiveSync/SOGoActiveSyncDispatcher.m
2016-03-29 10:34:59 -04:00
Ludovic Marcotte 5a2676f91b Updated NEWS 2016-03-28 17:38:54 -04:00
Ludovic Marcotte 821b9d1f3c (fix) prevent double Sync ops from same device (fixes #3603) 2016-03-28 17:38:33 -04:00
Ludovic Marcotte feca4ca3a5 (fix) memory leak 2016-03-28 15:10:41 -04:00
Ludovic Marcotte 7c814add25 Updated NEWS file 2016-03-28 11:19:54 -04:00
Ludovic Marcotte 663c4a44a2 (fix) handle Dovecot's mail_shared_explicit_inbox when using EAS
Conflicts:

	ActiveSync/SOGoActiveSyncDispatcher.m
	SoObjects/Mailer/SOGoMailAccount.m
2016-03-28 11:18:35 -04:00
Ludovic Marcotte c885aaeb88 Updated NEWS file 2016-03-28 08:46:49 -04:00
Ludovic Marcotte d047822eb5 (fix) handle FilterType changes using EAS (fixes #3543) 2016-03-28 08:46:22 -04:00
Ludovic Marcotte 50cb8772c4 (fix) small performance optimization 2016-03-23 15:10:18 -04:00
Ludovic Marcotte a13a72aff1 Updated NEWS 2016-03-23 13:43:09 -04:00
Ludovic Marcotte cfddf147c4 (fix) handle default classification for tasks (fixes #3541) 2016-03-23 13:42:21 -04:00
Ludovic Marcotte 44ee450fd7 (doc) documented WOMaxUploadSize 2016-03-21 13:07:02 -04:00
Francis Lachapelle dcf246ab54 (i18n) Restore missing strings
Fixes #3593
2016-03-21 11:19:32 -04:00
Francis Lachapelle 3a75491e0f Update NEWS file 2016-03-21 09:25:15 -04:00
Ludovic Marcotte b115f26834 (fix) make sure we don't consider SOGoMaximumRequestCount when it is 0 2016-03-21 08:19:40 -04:00
Ludovic Marcotte 69d90e1fad Updated NEWS 2016-03-18 13:02:04 -04:00
Ludovic Marcotte 9621527414 (fix) use the correct message class for S/MIME mails 2016-03-18 13:00:02 -04:00
Ludovic Marcotte 01499a9315 Updated NEWS 2016-03-18 12:56:20 -04:00
Ludovic Marcotte f16cc609ea (fix) handle empty body data correctly (fixes #3581) 2016-03-18 12:54:00 -04:00
Ludovic Marcotte a87c276b6b (fix) handle "username" as path 2016-03-18 12:50:09 -04:00
Ludovic Marcotte 599f00a571 Updated NEWS file 2016-03-18 12:38:20 -04:00
Ludovic Marcotte 5ae40a02ec (fix) respect the LDAP attributes mapping in the list view 2016-03-18 12:37:21 -04:00
Ludovic Marcotte 7d383639b9 Updated NEWS file 2016-03-18 11:07:13 -04:00
Ludovic Marcotte 766d0ff64e (feat) user rate-limiting support for all SOGo requests 2016-03-18 11:03:45 -04:00
Jesús García Sáez 9ddc5eb49b Merge pull request #250 from zentyal/ejhernandez/sharing-support
Give sharing support
2016-02-23 19:44:34 +01:00
Enrique J. Hernández 7f0c5a86f8 Merge pull request #256 from zentyal/jag/multipart-nested-2
oc-mail: Better management of nested multipart types
2016-02-23 17:40:55 +01:00
Jesús García Sáez 573de4900c Merge pull request #257 from zentyal/sogo-tool-loadproducts
Ensure sogo-tool loads all available products
2016-02-23 17:18:23 +01:00
Carlos Pérez-Aradros Herce 9784995d41 Ensure sogo-tool loads all available products 2016-02-23 17:16:02 +01:00
Jesús García Sáez 698918abf9 Fix prepareRightsForm, keep the highest role
userRights is sorted highest to lowest right so we have to assign
only the first right found for each type
2016-02-23 15:08:15 +01:00
Enrique J. Hernández Blasco 12e952eb55 oc: Honor calendar WebMail UI permissions on OpenChange library
By expanding roles from the given ACL to have these values as flags
inside the OpenChange library. This only applies to Calendar and
Tasks folders which stored four different access rights to three
different types of events/tasks.

As the events and tasks are stored in the same table, I have added
two new classes to manage permissions in the same way and this
avoids the code duplication called MAPIStoreCalTask(Folder|Message).
2016-02-23 10:10:48 +01:00
Javier Amor García f388d180ae oc-mail: Better management of nested multipart types
Instead of treating all the message either as alternative or mixed with
this changeset the MIME type of the parent part is used.
This allows a correct disposition of the message in the cases when
nested multiparts elements are used.
Also in mixed parts we convert between plain text and HTML as needed.
2016-02-22 17:19:44 +01:00
Jesús García Sáez 36d257e1c7 Merge pull request #254 from zentyal/jag/test-for-string-encoding-for-encoding-named-methods
Tests for SOPE string-encoding-for-encoding-named-methods branch
2016-02-22 16:32:17 +01:00
Jesús García Sáez 8d04a83731 Merge pull request #245 from zentyal/jag/html-part-not-assume-charset
oc-mail: Use UTF-8 when there are parts with multiple charsets
2016-02-18 18:15:27 +01:00
Javier Amor García d2e7fdf4d2 Tests for SOPE string-encoding-for-encoding-named-methods branch 2016-02-18 11:01:56 +01:00
Javier Amor García e1b1812364 oc-mail: Use UTF-8 when they are parts with multiple charsets
If we have multiple parts with different encodings we recode
all HTML parts to UTF-8 and we use it as message charset.
This is neccesary because Outlook assummessa single charset
for all the message.

Also we convert the end of line in text/plain to <br/> tag
when showing them as HTML in multipart/mixed parts.
2016-02-17 19:02:14 +01:00
Enrique J. Hernández Blasco 17b2e3946c oc-notes: Point which folder class must be used while opening subfolders
It was using MAPIStoreDBFolder class instead of specialised version
MAPIStoreNotesFolder and thus the shared subfolders where set to create
messages as normal messages instead of notes.
2016-02-16 14:56:38 +01:00
Enrique J. Hernández Blasco 51408bbde0 oc-tasks: Add edit/delete own and Folder Contact/Owner sharing perm
By storing these custom MAPI roles in the ACL. Take into account that
a task folder is shared with a calendar folder with the same name, therefore
permissions are shared and overwritten from different Outlook sections.

The extension 'X-SOGO-COMPONENT-CREATED-BY' is used to store the task
creator in both Outlook and SOGo Webmail.

The PidLidTaskOwner is not yet properly managed and we are always returning
the folder owner but to effects of sharing that extension is used by now
which matches a little more with what the user expects until we fix
the task ownership defined in [MS-OXOTASK].
2016-02-16 14:56:36 +01:00
Enrique J. Hernández Blasco 9d461d646f oc-contacts: Add edit/delete own and Folder Contact/Owner sharing perm
By storing these custom MAPI roles in the ACL.

An extension field called 'X-OPENCHANGE-CREATOR' is created in the vcard
to validate the creator/owner of the contact in the shared folder.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco dd32c659f6 oc-calendar: Add edit/delete own and Folder Contact/Owner sharing perm
By storing these custom MAPI roles in the ACL.

The extension field 'X-SOGO-COMPONENT-CREATED-BY' is used to store the
event creator when it is done from Outlook. It is the same field SOGo
uses when an event is created from a shared folder in the webmail.

The creator and the organizer/owner of the event can be different and it can
be used from external sources by checking the organizer field. This matches
the specification from [MS-OXOCAL] Section 1.1 which defines the organizer
as the owner or creator of the event.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 12ac1d30de oc: Implement edit own and delete own in GCSFolders
And returning back PidTagCreatorName.

This is done by checking the owner of the resource if the given
permission is restricted to edit/delete own items.

This requires a52bc3b to work in calendar folders as it requires to store and retrieve
the MAPI custom permissions in the ACL.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 8b45ee886b oc: Use the same permission set original from MAPIStoreDBFolder
To keep backwards compatibility.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 1ca1a273d9 oc-notes: Implement edit own and delete own permissions
By storing the PidTagCreatorName on creation and checking when
trying to edit or delete an specific message.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 76e586deca oc: Added custom MAPI permissions
This set is only available at sogo-openchange library scope but
they are useful to provide all permissions set from any MAPI client
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco a9f336c69d oc: Check permissions on read opening a shared folder
This is a security issue that allowed a user to read the number
of messages and its subjects when it does not have any permission to read.

Now the user cannot see other's folder without asking for me to the owner.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco b92ca092ed oc: Remove specialised PidTagAccess and PidTagAccessLevel
As the generic one from MAPIStoreMessage applies here since
we use subscriberCan* protocol to know the values from these
properties.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco dcb1d2f574 oc: API to know if a message can be deleted by a subscriber
Instead of asking general container. This gives the possibility to
perform the deletion depending on the data from the message, for instance,
the user creator.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco bcf94c5b43 oc: Check FolderOwner right to modify permissions
As specified by [MS-OXCPERM] Section 3.2.5.2, the ModifyPermissions ROP
is only possible to users which have this right.

After this changeset, we check the active user can modify permission
list. This is a security fix.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 8c8ad301b4 oc: Check FolderVisible permission to show permission list
When the active user is not the owner of the resource as specified
by [MS-OXCPERM] Section 3.2.5.1
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 026c37709a oc: Mimetise PidTagRights behaviour to PidTagMemberRights
As specified by [MS-OXCFOLD] Section 2.2.2.2.2.8 we exclude
FreeBusySimple and FreeBusyDetailed right flags.
2016-02-16 14:55:20 +01:00
Enrique J. Hernández Blasco c45baad188 oc: Read FAI messages from shared folder must be possible
At least, to be able to read a shared folder using Online mode.
It requests the folder to know if the message can be read by
current active user.
2016-02-16 14:55:06 +01:00
Enrique J. Hernández Blasco e86e3b2481 oc: Get new change numbers using resource's owner
Instead of using the connected active user.

Although this provides no changes in the result, it could be depending
on changes from the backend so it'd better have it accurated to what
the OpenChange DB API offers.
2016-02-16 14:54:58 +01:00
Enrique J. Hernández Blasco 967cc29c4e oc: Query for fmids in behalf of owner's resource
Instead of using connected active user because the fmids are related
to the root folder (context) owner. This avoids returning back incorrect
identifiers which mostly collide with already associated URLs.
2016-02-16 11:43:21 +01:00
Jesús García Sáez 0e49f7ed87 Merge pull request #251 from zentyal/ejhernandez/mapistore-error
oc: Use enum mapistore_error instead of int
2016-02-15 20:55:13 +01:00
Jesús García Sáez b62d58d4d7 Merge pull request #249 from zentyal/ejhernandez/proper-fix-user-many-groups-calendar-sharing
Keep all roles in calendar folder ACLs
2016-02-15 20:53:14 +01:00
Jesús García Sáez c99fd1d93c Merge pull request #248 from zentyal/ejhernandez/groups-domain-based-uid
Support for groups using EnableDomainBasedUID configuration
2016-02-15 20:18:51 +01:00
Enrique J. Hernández Blasco e08ee9a265 oc: Use enum mapistore_error instead of int
This specifies a little the scope of the variable to make it
more realistic with the actual values it may have. We do have
a static typed compiled language, why don't we use it?
2016-02-15 15:44:14 +01:00
Enrique J. Hernández Blasco 15779c2cfb Keep all roles in calendar folder ACLs
Instead of keeping only the highest access roles. This reverts
2c678101 to fix handling of ACLs with multiple groups.

This is done because OpenChange library stores other roles/permissions
in the ACLs that have limited scope to the MAPI protocol and it
maintains an homogeneous returned data with other folders by returning
the actual data is stored in the DB.

By sorting the roles, we give the ability to callers to validate
permissions more efficiency (less loops) and keep the right highest
access level. As an example, check
[SOGoApppointmentFolder:roleForComponentsWithAccessClass:forUser]
for details.
2016-02-11 16:54:49 +01:00
Enrique J. Hernández Blasco 3b0cfa00f7 Support for groups using EnableDomainBasedUID conf
Using LDAP as source, the group entry must have a valid
group objectClass such as posixGroup or group and have a
valid UIDField which does not include the domain.

With this changeset, SOGo is aware of these groups when it has
an email and you can share a component such as a calendar with
the member of the group.
2016-02-11 15:59:54 +01:00
Enrique J. Hernández 0de07acb16 Merge pull request #234 from zentyal/jag/multipart-support
sogo-openchange: Support for multipart/mixed and multipart/alternative
2016-02-03 11:01:30 +01:00
Enrique J. Hernández 27fb035f34 Merge pull request #242 from zentyal/jag/rtf-parser-charset-in-plain-rtf-text
RTFHandler: fixed problem with plain chars from no-ascii charset
2016-02-03 09:53:42 +01:00
Jesús García Sáez 8749028e1d Merge pull request #244 from zentyal/ejhernandez/fix-contacts-no-email
oc-contacts: Return not found when there is no information
2016-02-01 20:16:35 +01:00
Javier Amor García e5f15f69df RTFHandler: protect against CR and bad hexadecimal sequence
In RTF is possible to specify characters with the sequence \'XX being
XX an hexadecimal number.
With this changeset we guard against incorrect hexadecimal numbers which
will be ignored.

The other change added is to ignore carriadge returns in plain text.
2016-02-01 16:55:20 +01:00
Javier Amor García 8e80b57d31 RTFHandler: support charsets in plain text
Allow to switch charset in RTF plain text parts.
2016-02-01 11:48:15 +01:00
Enrique J. Hernández Blasco 75ffdd2ee1 oc-contacts: Return not found when there is no information
In _getElement which match many properties and in both
PidLidAddressBookProviderEmailList and PidLidAddressBookProviderArrayType.

As it is specified in [MS-OXOCNTC] Section 2.2.1, each property
must be stored when the user needs it. So we can assume we can avoid
returning them if we don't have it.

This fix a Sync Issue which make it impossible to sync a contact
folder where some contact object does not any email. The sync issue
message is as follows:

   Error synchronizing folder
       [80070057-30FFFFFF-0-560]
2016-01-28 23:21:46 +01:00
Jesús García Sáez 46bffaa449 Merge pull request #241 from zentyal/fail-on-broken-imap
Allow exception raising when connecting to IMAP
2016-01-28 11:57:33 +01:00
Carlos Pérez-Aradros Herce 061244a0a5 Allow exception raising when connecting to IMAP
By setting `SoIMAP4ExceptionsEnabled` config key to YES

Enabled for OpenChange by default, it will ensure no action is taken
when IMAP connection is not valid.
2016-01-27 15:30:27 +01:00
Javier Amor García dee7b4be1a oc-mail: Support for multipart/mixed and multipart/alternative
With multipart messages only one of the parts was displayed as message body.
This changeset supports both mixed and alternative multipart types.
2016-01-27 09:14:45 +01:00
Enrique J. Hernández 13a82826f8 Merge pull request #240 from zentyal/jgarcia/set-log-level
Setting log level on backend initialization
2016-01-25 23:29:59 +01:00
Jesús García Sáez 3d9466df45 Setting log level on backend initialization
Get the current openchange log level (actually is the samba's log level)
2016-01-25 20:18:45 +01:00
Carlos Pérez-Aradros Herce aac9cd7c07 Merge pull request #237 from zentyal/jgarcia/contacts-all-2
Fix contact listing properly
2016-01-25 17:17:57 +01:00
Jesús García Sáez a7c04187a2 Merge pull request #238 from zentyal/ejhernandez/fix-tz-def-start-display
oc-calendar: Fix typo setting or operator
2016-01-25 11:08:44 +01:00
Enrique J. Hernández Blasco 359da78d81 oc-calendar: Fix typo setting or operator
For PidLidAppointmentTimeZoneDefinitionStartDisplay.

It is a typo introduced by 376e717.
2016-01-24 01:13:00 +01:00
Jesús García Sáez 1bae41e127 Request all contacts no longer needs value=.
This reverts 1c8b693 and it's possible thanks to removing
listRequiresDot option 6b2ec7a

Listing contacts didn't work for sources with listRequiresDot
set to YES (LDAPSource, by default, had this option that way)
2016-01-20 11:03:04 +01:00
Jesús García Sáez 6b2ec7a2e7 Remove listRequiresDot option from *Source classes
This option is not needed. SQLSource was not using it
and LDAPSource will transform the filter to (UIDField=*) when
there is nothing set as filter, before this patch it was needed
to either insert '.' as filter or set listRequiresDot to NO
2016-01-20 11:01:27 +01:00
Enrique J. Hernández 169356b8a0 Merge pull request #236 from zentyal/jgarcia/test-sope-subject-qp
Jgarcia/test sope subject qp
2016-01-20 09:41:19 +01:00
Jesús García Sáez bad7fd4532 Unit test encode qp text: long of second line
This will fail without sope commit 361178217156177a2a40c327a64f70716b30ae3a
2016-01-19 19:51:41 +01:00
Jesús García Sáez cb3959d991 Unit test encode qp text
This will crash without sope commit 0c9b08d18f07205b4de58bb700ad15a4a4649e53
2016-01-19 19:51:06 +01:00
459 changed files with 20313 additions and 9785 deletions

No files matched your search

+22
View File
@@ -30,7 +30,9 @@ trans.pt_BR = UI/MailerUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/MailerUI/Russian.lproj/Localizable.strings
trans.sk = UI/MailerUI/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/MailerUI/Slovenian.lproj/Localizable.strings
trans.sr = UI/MailerUI/Serbian.lproj/Localizable.strings
trans.sv = UI/MailerUI/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/MailerUI/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/MailerUI/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/MailerUI/ChineseTaiwan.lproj/Localizable.strings
@@ -63,7 +65,9 @@ trans.pt_BR = UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/PreferencesUI/Russian.lproj/Localizable.strings
trans.sk = UI/PreferencesUI/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/PreferencesUI/Slovenian.lproj/Localizable.strings
trans.sr = UI/PreferencesUI/Serbian.lproj/Localizable.strings
trans.sv = UI/PreferencesUI/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/PreferencesUI/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/PreferencesUI/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/PreferencesUI/ChineseTaiwan.lproj/Localizable.strings
@@ -96,7 +100,9 @@ trans.pt_BR = UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/Scheduler/Russian.lproj/Localizable.strings
trans.sk = UI/Scheduler/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/Scheduler/Slovenian.lproj/Localizable.strings
trans.sr = UI/Scheduler/Serbian.lproj/Localizable.strings
trans.sv = UI/Scheduler/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/Scheduler/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/Scheduler/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/Scheduler/ChineseTaiwan.lproj/Localizable.strings
@@ -129,7 +135,9 @@ trans.pt_BR = UI/Contacts/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/Contacts/Russian.lproj/Localizable.strings
trans.sk = UI/Contacts/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/Contacts/Slovenian.lproj/Localizable.strings
trans.sr = UI/Contacts/Serbian.lproj/Localizable.strings
trans.sv = UI/Contacts/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/Contacts/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/Contacts/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/Contacts/ChineseTaiwan.lproj/Localizable.strings
@@ -162,7 +170,9 @@ trans.pt_BR = UI/MainUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/MainUI/Russian.lproj/Localizable.strings
trans.sk = UI/MainUI/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/MainUI/Slovenian.lproj/Localizable.strings
trans.sr = UI/MainUI/Serbian.lproj/Localizable.strings
trans.sv = UI/MainUI/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/MainUI/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/MainUI/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/MainUI/ChineseTaiwan.lproj/Localizable.strings
@@ -195,7 +205,9 @@ trans.pt_BR = UI/Common/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/Common/Russian.lproj/Localizable.strings
trans.sk = UI/Common/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/Common/Slovenian.lproj/Localizable.strings
trans.sr = UI/Common/Serbian.lproj/Localizable.strings
trans.sv = UI/Common/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/Common/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/Common/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/Common/ChineseTaiwan.lproj/Localizable.strings
@@ -228,7 +240,9 @@ trans.pt_BR = UI/AdministrationUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/AdministrationUI/Russian.lproj/Localizable.strings
trans.sk = UI/AdministrationUI/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/AdministrationUI/Slovenian.lproj/Localizable.strings
trans.sr = UI/AdministrationUI/Serbian.lproj/Localizable.strings
trans.sv = UI/AdministrationUI/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/AdministrationUI/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/AdministrationUI/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/AdministrationUI/ChineseTaiwan.lproj/Localizable.strings
@@ -261,7 +275,9 @@ trans.pt_BR = SoObjects/Appointments/BrazilianPortuguese.lproj/Localizable.strin
trans.ru = SoObjects/Appointments/Russian.lproj/Localizable.strings
trans.sk = SoObjects/Appointments/Slovak.lproj/Localizable.strings
trans.sl_SI = SoObjects/Appointments/Slovenian.lproj/Localizable.strings
trans.sr = SoObjects/Appointments/Serbian.lproj/Localizable.strings
trans.sv = SoObjects/Appointments/Swedish.lproj/Localizable.strings
trans.tr_TR = SoObjects/Appointments/TurkishTurkey.lproj/Localizable.strings
trans.uk = SoObjects/Appointments/Ukrainian.lproj/Localizable.strings
trans.zh_TW = SoObjects/Appointments/ChineseTaiwan.lproj/Localizable.strings
@@ -294,7 +310,9 @@ trans.pt_BR = SoObjects/Contacts/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = SoObjects/Contacts/Russian.lproj/Localizable.strings
trans.sk = SoObjects/Contacts/Slovak.lproj/Localizable.strings
trans.sl_SI = SoObjects/Contacts/Slovenian.lproj/Localizable.strings
trans.sr = SoObjects/Contacts/Serbian.lproj/Localizable.strings
trans.sv = SoObjects/Contacts/Swedish.lproj/Localizable.strings
trans.tr_TR = SoObjects/Contacts/TurkishTurkey.lproj/Localizable.strings
trans.uk = SoObjects/Contacts/Ukrainian.lproj/Localizable.strings
trans.zh_TW = SoObjects/Contacts/ChineseTaiwan.lproj/Localizable.strings
@@ -327,7 +345,9 @@ trans.pt_BR = SoObjects/Mailer/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = SoObjects/Mailer/Russian.lproj/Localizable.strings
trans.sk = SoObjects/Mailer/Slovak.lproj/Localizable.strings
trans.sl_SI = SoObjects/Mailer/Slovenian.lproj/Localizable.strings
trans.sr = SoObjects/Mailer/Serbian.lproj/Localizable.strings
trans.sv = SoObjects/Mailer/Swedish.lproj/Localizable.strings
trans.tr_TR = SoObjects/Mailer/TurkishTurkey.lproj/Localizable.strings
trans.uk = SoObjects/Mailer/Ukrainian.lproj/Localizable.strings
trans.zh_TW = SoObjects/Mailer/ChineseTaiwan.lproj/Localizable.strings
@@ -360,6 +380,8 @@ trans.pt_BR = UI/MailPartViewers/BrazilianPortuguese.lproj/Localizable.strings
trans.ru = UI/MailPartViewers/Russian.lproj/Localizable.strings
trans.sk = UI/MailPartViewers/Slovak.lproj/Localizable.strings
trans.sl_SI = UI/MailPartViewers/Slovenian.lproj/Localizable.strings
trans.sr = UI/MailPartViewers/Serbian.lproj/Localizable.strings
trans.sv = UI/MailPartViewers/Swedish.lproj/Localizable.strings
trans.tr_TR = UI/MailPartViewers/TurkishTurkey.lproj/Localizable.strings
trans.uk = UI/MailPartViewers/Ukrainian.lproj/Localizable.strings
trans.zh_TW = UI/MailPartViewers/ChineseTaiwan.lproj/Localizable.strings
+8 -11
View File
@@ -142,7 +142,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"<JobTitle xmlns=\"Contacts:\">%@</JobTitle>", [o activeSyncRepresentationInContext: context]];
if ((o = [self preferredEMail]))
[s appendFormat: @"<Email1Address xmlns=\"Contacts:\">%@</Email1Address>", o];
[s appendFormat: @"<Email1Address xmlns=\"Contacts:\">%@</Email1Address>", [o activeSyncRepresentationInContext: context]];
// Secondary email addresses (2 and 3)
@@ -152,7 +152,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
o = [[emails objectAtIndex: i] flattenedValuesForKey: @""];
[s appendFormat: @"<Email%dAddress xmlns=\"Contacts:\">%@</Email%dAddress>", i+2, o, i+2];
[s appendFormat: @"<Email%dAddress xmlns=\"Contacts:\">%@</Email%dAddress>", i+2, [o activeSyncRepresentationInContext: context], i+2];
if (i == 1)
break;
@@ -185,10 +185,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
a = [NSMutableString string];
if ((o = [homeAdr flattenedValueAtIndex: 2 forKey: @""]))
[a appendString: o];
[a appendString: [o activeSyncRepresentationInContext: context]];
if ((o = [homeAdr flattenedValueAtIndex: 1 forKey: @""]) && [o length])
[a appendFormat: @"\n%@", o];
[a appendFormat: @"\n%@", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<HomeStreet xmlns=\"Contacts:\">%@</HomeStreet>", [a activeSyncRepresentationInContext: context]];
@@ -216,10 +216,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
a = [NSMutableString string];
if ((o = [workAdr flattenedValueAtIndex: 2 forKey: @""]))
[a appendString: o];
[a appendString: [o activeSyncRepresentationInContext: context]];
if ((o = [workAdr flattenedValueAtIndex: 1 forKey: @""]) && [o length])
[a appendFormat: @"\n%@", o];
[a appendFormat: @"\n%@", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<BusinessStreet xmlns=\"Contacts:\">%@</BusinessStreet>", [a activeSyncRepresentationInContext: context]];
@@ -239,13 +239,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Other, less important fields
if ((o = [self birthday]))
{
NSTimeZone *userTimeZone;
userTimeZone = [[[context activeUser] userDefaults] timeZone];
[s appendFormat: @"<Birthday xmlns=\"Contacts:\">%@</Birthday>",
[[o dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: ([userTimeZone secondsFromGMTForDate: o])*-1]
hours: -12 minutes: 0
seconds: 0]
activeSyncRepresentationInContext: context]];
}
+1
View File
@@ -53,6 +53,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (NSString *) itemid;
- (BOOL) acceptsMultiPart;
- (NSData *) convertHexStringToBytes;
- (NSString *) protocolVersion;
@end
+22 -94
View File
@@ -46,99 +46,6 @@ static NSArray *easCommandParameters = nil;
@implementation NSString (ActiveSync)
//
// This is a copy from NSString+XMLEscaping.m from SOPE.
// The difference here is that we use wchar_t instead of unichar.
// This is needed to get the rigth numeric character reference.
// e.g. SMILING FACE WITH OPEN MOUTH
// ok: wchar_t -> &#128515; wrong: unichar -> &#55357; &#56835;
//
// We avoir naming it like the one in SOPE since if the ActiveSync
// bundle is loaded, it'll overwrite the one provided by SOPE.
//
- (NSString *) _stringByEscapingXMLStringUsingCharacters {
register unsigned i, len, j;
register wchar_t *buf;
const wchar_t *chars;
unsigned escapeCount;
if ([self length] == 0) return @"";
NSData *data = [self dataUsingEncoding:NSUTF32StringEncoding];
chars = [data bytes];
len = [data length]/4;
/* check for characters to escape ... */
for (i = 0, escapeCount = 0; i < len; i++) {
switch (chars[i]) {
case '&': case '"': case '<': case '>': case '\r':
escapeCount++;
break;
default:
if (chars[i] < 0x20 || chars[i] > 127)
escapeCount++;
break;
}
}
if (escapeCount == 0 ) {
/* nothing to escape ... */
return [[self copy] autorelease];
}
buf = calloc((len + 5) + (escapeCount * 16), sizeof(wchar_t));
for (i = 0, j = 0; i < len; i++) {
switch (chars[i]) {
/* escape special chars */
case '\r':
buf[j] = '&'; j++; buf[j] = '#'; j++; buf[j] = '1'; j++;
buf[j] = '3'; j++; buf[j] = ';'; j++;
break;
case '&':
buf[j] = '&'; j++; buf[j] = 'a'; j++; buf[j] = 'm'; j++;
buf[j] = 'p'; j++; buf[j] = ';'; j++;
break;
case '"':
buf[j] = '&'; j++; buf[j] = 'q'; j++; buf[j] = 'u'; j++;
buf[j] = 'o'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++;
break;
case '<':
buf[j] = '&'; j++; buf[j] = 'l'; j++; buf[j] = 't'; j++;
buf[j] = ';'; j++;
break;
case '>':
buf[j] = '&'; j++; buf[j] = 'g'; j++; buf[j] = 't'; j++;
buf[j] = ';'; j++;
break;
default:
/* escape big chars */
if (chars[i] > 127) {
unsigned char nbuf[32];
unsigned int k;
sprintf((char *)nbuf, "&#%i;", (int)chars[i]);
for (k = 0; nbuf[k] != '\0'; k++) {
buf[j] = nbuf[k];
j++;
}
}
else if (chars[i] == 0x9 || chars[i] == 0xA || chars[i] == 0xD || chars[i] >= 0x20) { // ignore any unsupported control character
/* nothing to escape */
buf[j] = chars[i];
j++;
}
break;
}
}
self = [[NSString alloc] initWithBytesNoCopy: buf
length: (j*sizeof(wchar_t))
encoding: NSUTF32StringEncoding
freeWhenDone: YES];
return [self autorelease];
}
- (NSString *) sanitizedServerIdWithType: (SOGoMicrosoftActiveSyncFolderType) folderType
{
if (folderType == ActiveSyncEventFolder)
@@ -158,7 +65,7 @@ static NSArray *easCommandParameters = nil;
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
return [self _stringByEscapingXMLStringUsingCharacters];
return [self safeStringByEscapingXMLString: YES];
}
- (int) activeSyncFolderType
@@ -231,6 +138,27 @@ static NSArray *easCommandParameters = nil;
return o;
}
- (NSString *) protocolVersion
{
NSMutableArray *components;
components = [NSMutableArray arrayWithArray: [[[self componentsSeparatedByString: @"?"] lastObject] componentsSeparatedByString: @"&"]];
// We handle BASE64 encoded queryStrings. See http://msdn.microsoft.com/en-us/library/ee160227%28v=exchg.80%29.aspx for details.
if ([components count] == 1)
{
NSData *queryString;
const char* qs_bytes;
queryString = [[components objectAtIndex: 0] dataByDecodingBase64];
qs_bytes = (const char*)[queryString bytes];
return [NSString stringWithFormat:@"%.1f", (float)((uint8_t)qs_bytes[0]/10)];
}
return nil;
}
- (NSString *) _valueForParameter: (NSString *) theParameter
{
NSMutableArray *components;
+576 -60
View File
@@ -96,6 +96,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import <Mailer/SOGoMailNamespace.h>
#include "iCalEvent+ActiveSync.h"
#include "iCalToDo+ActiveSync.h"
@@ -114,11 +115,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@implementation SOGoActiveSyncDispatcher (Sync)
- (void) _setOrUnsetSyncRequest: (BOOL) set
collections: (NSArray *) collections
collections: (NSArray *) collections
{
SOGoCacheGCSObject *o;
NSNumber *processIdentifier;
NSString *key;
NSString *key, *collectionId;;
int i;
processIdentifier = [NSNumber numberWithInt: [[NSProcessInfo processInfo] processIdentifier]];
@@ -138,7 +139,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
for (i = 0; i < [collections count]; i++)
{
key = [NSString stringWithFormat: @"SyncRequest+%@", [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL]];
if ([[collections objectAtIndex: i] isKindOfClass: [NSString class]])
collectionId = [collections objectAtIndex: i];
else
collectionId = [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL];
key = [NSString stringWithFormat: @"SyncRequest+%@", collectionId];
[[o properties] setObject: processIdentifier forKey: key];
}
}
@@ -147,7 +154,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[[o properties] removeObjectForKey: @"SyncRequest"];
for (i = 0; i < [collections count]; i++)
{
key = [NSString stringWithFormat: @"SyncRequest+%@", [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL]];
if ([[collections objectAtIndex: i] isKindOfClass: [NSString class]])
collectionId = [collections objectAtIndex: i];
else
collectionId = [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL];
key = [NSString stringWithFormat: @"SyncRequest+%@", collectionId];
[[o properties] removeObjectForKey: key];
}
}
@@ -161,7 +174,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NSNumber *processIdentifier, *processIdentifierInCache;
SOGoCacheGCSObject *o;
NSDictionary *values;
NSString *key;
NSString *key, *pkey;
NSArray *a;
if ([theFolderKey hasPrefix: @"folder"])
key = [NSString stringWithFormat: @"SyncRequest+mail/%@", [theFolderKey substringFromIndex: 6]];
@@ -172,7 +186,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
processIdentifierInCache = [[self globalMetadataForDevice] objectForKey: key];
// Don't update the cache if another request is processing the same collection.
if (!([processIdentifierInCache isEqual: processIdentifier]))
// I case of a merged folder we have to check personal folder's lock.
a = [key componentsSeparatedByString: @"/"];
pkey = [NSString stringWithFormat: @"%@/personal", [a objectAtIndex:0]];
if (!([processIdentifierInCache isEqual: processIdentifier] || [[[self globalMetadataForDevice] objectForKey: pkey] isEqual: processIdentifier]))
{
if (debugOn)
[self logWithFormat: @"EAS - We lost our lock - discard folder cache update %@ %@ <> %@", key, processIdentifierInCache, processIdentifier];
@@ -191,11 +209,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[[o properties] removeObjectForKey: @"SyncKey"];
[[o properties] removeObjectForKey: @"SyncCache"];
[[o properties] removeObjectForKey: @"DateCache"];
[[o properties] removeObjectForKey: @"UidCache"];
[[o properties] removeObjectForKey: @"MoreAvailable"];
[[o properties] removeObjectForKey: @"FolderPermissions"];
[[o properties] removeObjectForKey: @"BodyPreferenceType"];
[[o properties] removeObjectForKey: @"SupportedElements"];
[[o properties] removeObjectForKey: @"SuccessfulMoveItemsOps"];
[[o properties] removeObjectForKey: @"InitialLoadSequence"];
[[o properties] removeObjectForKey: @"FirstIdInCache"];
[[o properties] removeObjectForKey: @"LastIdInCache"];
[[o properties] removeObjectForKey: @"MergedFoldersSyncKeys"];
[[o properties] removeObjectForKey: @"MergedFolder"];
[[o properties] removeObjectForKey: @"CleanoutDate"];
[[o properties] addEntriesFromDictionary: values];
[o save];
@@ -283,8 +308,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
withType: (SOGoMicrosoftActiveSyncFolderType) theFolderType
inBuffer: (NSMutableString *) theBuffer
{
NSMutableDictionary *folderMetadata, *dateCache, *syncCache, *allValues;
NSString *clientId, *serverId;
NSMutableDictionary *folderMetadata, *dateCache, *syncCache, *uidCache, *allValues;
NSString *clientId, *serverId, *easId;
NSArray *additions;
id anAddition, sogoObject, o;
@@ -362,23 +387,54 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[sogoObject setIsNew: is_new];
[sogoObject saveComponent: o];
// Everything is fine, lets generate our response
[theBuffer appendString: @"<Add>"];
[theBuffer appendFormat: @"<ClientId>%@</ClientId>", clientId];
[theBuffer appendFormat: @"<ServerId>%@</ServerId>", serverId];
[theBuffer appendFormat: @"<Status>%d</Status>", 1];
[theBuffer appendString: @"</Add>"];
// Update syncCache
folderMetadata = [self _folderMetadataForKey: [self _getNameInCache: theCollection withType: theFolderType]];
syncCache = [folderMetadata objectForKey: @"SyncCache"];
dateCache = [folderMetadata objectForKey: @"DateCache"];
uidCache = [folderMetadata objectForKey: @"UidCache"];
if (uidCache)
{
if (is_new && [serverId length] > 64)
{
easId = [theCollection globallyUniqueObjectId];
[uidCache setObject: easId forKey: serverId];
if (debugOn)
[self logWithFormat: @"EAS - Generated new easId: %@ for serverId: %@", easId, serverId];
}
else
{
easId = [uidCache objectForKey: serverId];
if (easId)
{
if (debugOn)
[self logWithFormat: @"EAS - Reuse easId: %@ for serverId: %@", easId, serverId];
}
else
{
if (debugOn)
[self logWithFormat: @"EAS - Use original serverId: %@ %@", serverId, easId];
easId = serverId;
}
}
}
else
easId = serverId;
[syncCache setObject: [NSString stringWithFormat:@"%f", [[sogoObject lastModified] timeIntervalSince1970]] forKey: serverId];
[dateCache setObject: [NSCalendarDate date] forKey: serverId];
[self _setFolderMetadata: folderMetadata forKey: [self _getNameInCache: theCollection withType: theFolderType]];
// Everything is fine, lets generate our response
[theBuffer appendString: @"<Add>"];
[theBuffer appendFormat: @"<ClientId>%@</ClientId>", clientId];
[theBuffer appendFormat: @"<ServerId>%@</ServerId>", easId];
[theBuffer appendFormat: @"<Status>%d</Status>", 1];
[theBuffer appendString: @"</Add>"];
}
}
}
@@ -425,10 +481,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
inBuffer: (NSMutableString *) theBuffer
{
NSDictionary *allChanges;
NSString *serverId;
NSArray *changes;
NSString *serverId, *easId, *origServerId, *mergedFolder;
NSArray *changes, *a;
id aChange, o, sogoObject;
NSMutableDictionary *folderMetadata, *syncCache;
NSMutableDictionary *folderMetadata, *syncCache, *uidCache;
int i;
@@ -438,14 +494,50 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
folderMetadata = [self _folderMetadataForKey: [self _getNameInCache: theCollection withType: theFolderType]];
syncCache = [folderMetadata objectForKey: @"SyncCache"];
uidCache = [folderMetadata objectForKey: @"UidCache"];
for (i = 0; i < [changes count]; i++)
{
aChange = [changes objectAtIndex: i];
serverId = [[(id)[aChange getElementsByTagName: @"ServerId"] lastObject] textValue];
origServerId = [[(id)[aChange getElementsByTagName: @"ServerId"] lastObject] textValue];
easId = origServerId;
a = [origServerId componentsSeparatedByString: @"{+}"];
if ([a count] > 1)
{
easId = [a objectAtIndex: 1];
mergedFolder = [a objectAtIndex: 0];
// Make sure that the change goes to the target folder and not to personal.
if ([[theCollection nameInContainer] isEqualToString: @"personal"])
{
if (debugOn)
[self logWithFormat: @"EAS - Change - Target folder %@, easId %@", mergedFolder, easId];
[self processSyncChangeCommand: theDocumentElement
inCollection: [self collectionFromId: mergedFolder type: theFolderType]
withType: theFolderType
inBuffer: theBuffer];
continue;
}
}
if (debugOn)
[self logWithFormat: @"EAS - Change - Process change for folder %@ easId %@", [theCollection nameInContainer],easId];
allChanges = [[(id)[aChange getElementsByTagName: @"ApplicationData"] lastObject] applicationData];
if (uidCache && (serverId = [[uidCache allKeysForObject: easId] objectAtIndex: 0]))
{
if (debugOn)
[self logWithFormat: @"EAS - Found serverId: %@ for easId: %@", serverId, easId];
}
else
serverId = easId;
// Fetch the object and apply the changes
sogoObject = [theCollection lookupName: [serverId sanitizedServerIdWithType: theFolderType]
inContext: context
@@ -454,7 +546,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Object was removed inbetween sync/commands?
if ([sogoObject isKindOfClass: [NSException class]])
{
// FIXME - return status == 8
[theBuffer appendString: @"<Change>"];
[theBuffer appendFormat: @"<ServerId>%@</ServerId>", origServerId];
[theBuffer appendFormat: @"<Status>%d</Status>", 8];
[theBuffer appendString: @"</Change>"];
continue;
}
@@ -510,7 +605,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[theBuffer appendString: @"<Change>"];
[theBuffer appendFormat: @"<ServerId>%@</ServerId>", serverId];
[theBuffer appendFormat: @"<ServerId>%@</ServerId>", origServerId];
[theBuffer appendFormat: @"<Status>%d</Status>", 1];
[theBuffer appendString: @"</Change>"];
}
@@ -549,8 +644,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
id aDelete, sogoObject, value;
NSArray *deletions;
NSString *serverId;
NSArray *deletions, *a;
NSString *serverId, *easId, *origServerId, *mergedFolder;
BOOL deletesAsMoves, useTrash;
int i;
@@ -559,6 +654,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ([deletions count])
{
NSMutableDictionary *folderMetadata, *dateCache, *syncCache, *uidCache;
folderMetadata = [self _folderMetadataForKey: [self _getNameInCache: theCollection withType: theFolderType]];
syncCache = [folderMetadata objectForKey: @"SyncCache"];
dateCache = [folderMetadata objectForKey: @"DateCache"];
uidCache = [folderMetadata objectForKey: @"UidCache"];
// From the documention, if DeletesAsMoves is missing, we must assume it's a YES.
// See https://msdn.microsoft.com/en-us/library/gg675480(v=exchg.80).aspx for all details.
value = [theDocumentElement getElementsByTagName: @"DeletesAsMoves"];
@@ -572,8 +674,41 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
aDelete = [deletions objectAtIndex: i];
serverId = [[(id)[aDelete getElementsByTagName: @"ServerId"] lastObject] textValue];
origServerId = [[(id)[aDelete getElementsByTagName: @"ServerId"] lastObject] textValue];
easId = origServerId;
a = [origServerId componentsSeparatedByString: @"{+}"];
if ([a count] > 1)
{
easId = [a objectAtIndex: 1];
mergedFolder = [a objectAtIndex: 0];
// Make sure that the delete goes to the target folder and not to personal.
if ([[theCollection nameInContainer] isEqualToString: @"personal"])
{
if (debugOn)
[self logWithFormat: @"EAS - Delete - Target folder %@, easId %@", mergedFolder, easId];
[self processSyncDeleteCommand: theDocumentElement
inCollection: [self collectionFromId: mergedFolder type: theFolderType]
withType: theFolderType
inBuffer: theBuffer];
continue;
}
}
if (debugOn)
[self logWithFormat: @"EAS - Delete - Process delete for folder %@ easId %@", [theCollection nameInContainer],easId];
if (uidCache && (serverId = [[uidCache allKeysForObject: easId] objectAtIndex: 0]))
{
if (debugOn)
[self logWithFormat: @"EAS - Found serverId: %@ for easId: %@", serverId, easId];
}
else
serverId = easId;
sogoObject = [theCollection lookupName: [serverId sanitizedServerIdWithType: theFolderType]
inContext: context
acquire: NO];
@@ -590,24 +725,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
else
[sogoObject delete];
}
[theBuffer appendString: @"<Delete>"];
[theBuffer appendFormat: @"<ServerId>%@</ServerId>", serverId];
[theBuffer appendFormat: @"<Status>%d</Status>", 1];
[theBuffer appendString: @"</Delete>"];
[syncCache removeObjectForKey: serverId];
[dateCache removeObjectForKey: serverId];
//[uidCache removeObjectForKey: serverId];
[self _setFolderMetadata: folderMetadata forKey: [self _getNameInCache: theCollection withType: theFolderType]];
// update syncCache
NSMutableDictionary *folderMetadata, *dateCache, *syncCache;
folderMetadata = [self _folderMetadataForKey: [self _getNameInCache: theCollection withType: theFolderType]];
syncCache = [folderMetadata objectForKey: @"SyncCache"];
dateCache = [folderMetadata objectForKey: @"DateCache"];
[syncCache removeObjectForKey: serverId];
[dateCache removeObjectForKey: serverId];
[self _setFolderMetadata: folderMetadata forKey: [self _getNameInCache: theCollection withType: theFolderType]];
[theBuffer appendString: @"<Delete>"];
[theBuffer appendFormat: @"<ServerId>%@</ServerId>", origServerId];
[theBuffer appendFormat: @"<Status>%d</Status>", 1];
[theBuffer appendString: @"</Delete>"];
}
}
}
}
@@ -660,8 +788,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
inBuffer: (NSMutableString *) theBuffer
lastServerKey: (NSString **) theLastServerKey
defaultInterval: (unsigned int) theDefaultInterval
mergeFolders: (BOOL) theMergeFolder
{
NSMutableDictionary *folderMetadata, *dateCache, *syncCache;
NSMutableDictionary *folderMetadata, *dateCache, *syncCache, *uidCache;
NSString *davCollectionTagToStore;
NSAutoreleasePool *pool;
NSMutableString *s;
@@ -679,6 +808,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
[folderMetadata setObject: [NSMutableDictionary dictionary] forKey: @"SyncCache"];
[folderMetadata setObject: [NSMutableDictionary dictionary] forKey: @"DateCache"];
if (theFolderType != ActiveSyncMailFolder)
{
[folderMetadata setObject: [NSCalendarDate date] forKey: @"CleanoutDate"];
[folderMetadata setObject: [NSMutableDictionary dictionary] forKey: @"UidCache"];
}
}
else if ([folderMetadata objectForKey: @"SyncKey"] && !([theSyncKey isEqualToString: [folderMetadata objectForKey: @"SyncKey"]]))
{
@@ -690,6 +824,32 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syncCache = [folderMetadata objectForKey: @"SyncCache"];
dateCache = [folderMetadata objectForKey: @"DateCache"];
uidCache = [folderMetadata objectForKey: @"UidCache"];
if (!cleanup_needed && -[[folderMetadata objectForKey: @"CleanoutDate"] timeIntervalSinceNow] > 3600)
{
NSArray *allKeys;
NSString *key;
if (debugOn)
[self logWithFormat: @"EAS - Cleanout UidCache of folder %@", [theCollection nameInContainer]];
allKeys = [uidCache allKeys];
for (i = 0; i < [allKeys count]; i++)
{
key = [allKeys objectAtIndex: i];
if (![syncCache objectForKey:key] && ![syncCache objectForKey:key])
{
if (debugOn)
[self logWithFormat: @"EAS - Delete UidCache entry %@", key];
[uidCache removeObjectForKey: key];
}
}
[folderMetadata setObject: [NSCalendarDate date] forKey: @"CleanoutDate"];
[self _setFolderMetadata: folderMetadata forKey: [self _getNameInCache: theCollection withType: theFolderType]];
}
if ((theFolderType == ActiveSyncMailFolder || theFolderType == ActiveSyncEventFolder || theFolderType == ActiveSyncTaskFolder) &&
(cleanup_needed ||
@@ -741,6 +901,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Now we are save to remove the dateCache entry.
[dateCache removeObjectForKey: key];
//[uidCache removeObjectForKey: key];
}
}
@@ -766,7 +927,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// No changes in the collection - 2.2.2.19.1.1 Empty Sync Request.
// We check this and we don't generate any commands if we don't have to.
//
if ([theSyncKey isEqualToString: [theCollection davCollectionTag]] && !([s length]))
if ([theSyncKey isEqualToString: [theCollection davCollectionTag]] && !([s length]) && ![context objectForKey: @"FilterTypeChanged"] && ![folderMetadata objectForKey: @"InitialLoadSequence"])
return;
davCollectionTagToStore = [theCollection davCollectionTag];
@@ -779,7 +940,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
case ActiveSyncTaskFolder:
{
id sogoObject, componentObject;
NSString *uid, *component_name;
NSString *uid, *easId, *component_name;
NSDictionary *component;
NSArray *allComponents;
@@ -797,6 +958,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ([theSyncKey isEqualToString: @"-1"])
[folderMetadata setObject: davCollectionTagToStore forKey: @"InitialLoadSequence"];
else if ([context objectForKey: @"FilterTypeChanged"])
{
if (debugOn)
[self logWithFormat: @"EAS - FilterTypeChanged!"];
theSyncKey = @"-1";
}
if ([folderMetadata objectForKey: @"InitialLoadSequence"])
{
@@ -851,7 +1019,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[syncCache removeObjectForKey: uid];
[dateCache removeObjectForKey: uid];
}
else
else
{
if (debugOn)
[self logWithFormat: @"EAS - Cache cleanup: CHANGE %@", uid];
@@ -864,6 +1032,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
return_count = 0;
component = nil;
for (i = 0; i < max; i++)
{
@@ -891,13 +1060,49 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
uid = [[component objectForKey: @"c_name"] sanitizedServerIdWithType: theFolderType];
if (uidCache)
{
easId = [uidCache objectForKey: uid];
if (!easId)
{
if ([uid length] > 64)
{
easId = [theCollection globallyUniqueObjectId];
[uidCache setObject: easId forKey: uid];
if (debugOn)
[self logWithFormat: @"EAS - Generated new easId: %@ for serverId: %@", easId, uid];
}
else
{
if (debugOn)
[self logWithFormat: @"EAS - Use original serverId: %@ %@", uid, easId];
easId = uid;
}
}
else
{
if (debugOn)
[self logWithFormat: @"EAS - Reuse easId: %@ for serverId: %@", easId, uid];
}
}
else
easId = uid;
if (deleted)
{
if ([syncCache objectForKey: uid])
{
[s appendString: @"<Delete xmlns=\"AirSync:\">"];
[s appendFormat: @"<ServerId xmlns=\"AirSync:\">%@</ServerId>", uid];
if (![[theCollection nameInContainer] isEqualToString: @"personal"] && theMergeFolder)
[s appendFormat: @"<ServerId xmlns=\"AirSync:\">%@{+}%@</ServerId>", [theCollection nameInContainer], easId];
else
[s appendFormat: @"<ServerId xmlns=\"AirSync:\">%@</ServerId>", easId];
[s appendString: @"</Delete>"];
[syncCache removeObjectForKey: uid];
@@ -950,7 +1155,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
else
[s appendString: @"<Add xmlns=\"AirSync:\">"];
[s appendFormat: @"<ServerId xmlns=\"AirSync:\">%@</ServerId>", uid];
if (![[theCollection nameInContainer] isEqualToString: @"personal"] && theMergeFolder)
[s appendFormat: @"<ServerId xmlns=\"AirSync:\">%@{+}%@</ServerId>", [theCollection nameInContainer], easId];
else
[s appendFormat: @"<ServerId xmlns=\"AirSync:\">%@</ServerId>", easId];
[s appendString: @"<ApplicationData xmlns=\"AirSync:\">"];
[s appendString: [componentObject activeSyncRepresentationInContext: context]];
@@ -1009,6 +1218,31 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
a = [[theCollection davCollectionTag] componentsSeparatedByString: @"-"];
[folderMetadata setObject: [a objectAtIndex: 1] forKey: @"InitialLoadSequence"];
}
else if ([context objectForKey: @"FilterTypeChanged"])
{
NSMutableArray *sortedByUID;
if (debugOn)
[self logWithFormat: @"EAS - FilterTypeChanged!"];
sortedByUID = [[NSMutableArray alloc] initWithDictionary: syncCache];
if ([sortedByUID count])
{
[sortedByUID sortUsingSelector: @selector(compareUID:)];
// Save first and last uid in cache. We don't need to touch this range in case a cleanup is required.
[folderMetadata setObject: [[sortedByUID objectAtIndex: 0] uid] forKey: @"FirstIdInCache"];
[folderMetadata setObject: [[sortedByUID lastObject] uid] forKey: @"LastIdInCache"];
[folderMetadata setObject: [[sortedByUID lastObject] sequence] forKey: @"InitialLoadSequence"];
}
theSyncKey = @"-1";
highestmodseq = 0;
RELEASE(sortedByUID);
}
else
{
a = [theSyncKey componentsSeparatedByString: @"-"];
@@ -1020,7 +1254,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (highestmodseq < [[folderMetadata objectForKey: @"InitialLoadSequence"] intValue])
initialLoadInProgress = YES;
else
[folderMetadata removeObjectForKey: @"InitialLoadSequence"];
{
[folderMetadata removeObjectForKey: @"FirstIdInCache"];
[folderMetadata removeObjectForKey: @"LastIdInCache"];
[folderMetadata removeObjectForKey: @"InitialLoadSequence"];
}
}
allMessages = [theCollection syncTokenFieldsWithProperties: nil matchingSyncToken: theSyncKey fromDate: theFilterType initialLoad: initialLoadInProgress];
@@ -1069,6 +1307,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Remove all entries from cache beginning with the first uid added by the last sync request.
for (j = uidnextFromCache; j <= [[[sortedByUID lastObject] uid] intValue]; j++)
{
if ([folderMetadata objectForKey: @"FirstIdInCache"])
{
if (j >= [[folderMetadata objectForKey: @"FirstIdInCache"] intValue] && j <= [[folderMetadata objectForKey: @"LastIdInCache"] intValue])
{
if (debugOn)
[self logWithFormat: @"EAS - Cache cleanupa: ignore (a) %d", j];
continue;
}
}
if (debugOn)
[self logWithFormat: @"EAS - Cache cleanup: ADD %d", j];
@@ -1080,8 +1329,20 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
for (j = 0; j < [allCacheObjects count]; j++)
{
// Update the modseq in cache, sence othersie, it would be identical to the modseq from server
//and we would skip the cache when generating the response.
if ([folderMetadata objectForKey: @"FirstIdInCache"])
{
if ([[[allCacheObjects objectAtIndex: j] uid] intValue] >= [[folderMetadata objectForKey: @"FirstIdInCache"] intValue] &&
[[[allCacheObjects objectAtIndex: j] uid] intValue] <= [[folderMetadata objectForKey: @"LastIdInCache"] intValue])
{
if (debugOn)
[self logWithFormat: @"EAS - Cache cleanupa: ignore (c) %@", [[allCacheObjects objectAtIndex: j] uid]];
continue;
}
}
// Update the modseq in cache, since otherwise, it would be identical to the modseq from server
// and we would skip the cache when generating the response.
if ([syncCache objectForKey: [[allCacheObjects objectAtIndex: j] uid]] && ![[[allCacheObjects objectAtIndex: j] sequence] isEqual: [NSNull null]])
{
if (debugOn)
@@ -1136,7 +1397,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[self logWithFormat: @"EAS - found in cache: %d k = %d", found_in_cache, k];
return_count = 0;
aCacheObject = nil;
for (; k < [allCacheObjects count]; k++)
{
pool = [[NSAutoreleasePool alloc] init];
@@ -1283,7 +1545,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (firstUIDAdded)
{
a = [davCollectionTagToStore componentsSeparatedByString: @"-"];
[folderMetadata setObject: [[NSString alloc] initWithFormat: @"%@-%@", firstUIDAdded, [a objectAtIndex: 1]] forKey: @"SyncKey"];
[folderMetadata setObject: [NSString stringWithFormat: @"%@-%@", firstUIDAdded, [a objectAtIndex: 1]] forKey: @"SyncKey"];
RELEASE(firstUIDAdded);
}
else
@@ -1393,7 +1655,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
changeDetected: (BOOL *) changeDetected
maxSyncResponseSize: (int) theMaxSyncResponseSize
{
NSString *collectionId, *realCollectionId, *syncKey, *davCollectionTag, *bodyPreferenceType, *mimeSupport, *mimeTruncation, *lastServerKey, *syncKeyInCache, *folderKey;
NSString *collectionId, *realCollectionId, *syncKey, *davCollectionTag, *bodyPreferenceType, *mimeSupport, *mimeTruncation, *filterType, *lastServerKey, *syncKeyInCache, *folderKey;
NSMutableDictionary *folderMetadata, *folderOptions;
NSMutableArray *supportedElements, *supportedElementNames;
NSMutableString *changeBuffer, *commandsBuffer;
@@ -1434,6 +1696,27 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
folderKey = [self _getNameInCache: collection withType: folderType];
folderMetadata = [self _folderMetadataForKey: folderKey];
if (![folderMetadata count])
{
if (debugOn)
[self logWithFormat: @"EAS - processSyncCollection: no folderMetadata found: %@", [collection nameInContainer]];
// We request foldersync to initialize the missing metadata.
// We skip root-folders for shared mailboxes (shared and shared/jdoe@example.com).
if (![collection isKindOfClass: [SOGoMailNamespace class]])
{
[theBuffer appendString: @"<Collection>"];
[theBuffer appendFormat: @"<SyncKey>%@</SyncKey>", syncKey];
[theBuffer appendFormat: @"<CollectionId>%@</CollectionId>", collectionId];
[theBuffer appendFormat: @"<Status>%d</Status>", 12];
[theBuffer appendString: @"</Collection>"];
*changeDetected = YES;
}
return;
}
// We check for a window size, default to 100 if not specfied or out of bounds
windowSize = [[[(id)[theDocumentElement getElementsByTagName: @"WindowSize"] lastObject] textValue] intValue];
@@ -1514,17 +1797,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mimeSupport = [[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"MIMESupport"];
mimeTruncation = [[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"MIMETruncation"];
filterType = [[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"FilterType"];
if (!mimeSupport)
mimeSupport = @"1";
if (!mimeTruncation)
mimeTruncation = @"8";
if (!filterType)
filterType = @"0";
}
else
{
mimeSupport = [[(id)[theDocumentElement getElementsByTagName: @"MIMESupport"] lastObject] textValue];
mimeTruncation = [[(id)[theDocumentElement getElementsByTagName: @"MIMETruncation"] lastObject] textValue];
filterType = [[(id)[theDocumentElement getElementsByTagName: @"FilterType"] lastObject] textValue];
if (!mimeSupport)
mimeSupport = [[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"MIMESupport"];
@@ -1538,6 +1826,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (!mimeTruncation)
mimeTruncation = @"8";
if (!filterType)
filterType = @"0";
if ([mimeSupport isEqualToString: @"1"] && [bodyPreferenceType isEqualToString: @"4"])
bodyPreferenceType = @"2";
else if ([mimeSupport isEqualToString: @"2"] && [bodyPreferenceType isEqualToString: @"4"])
@@ -1548,9 +1839,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Avoid writing to cache if there is nothing to change.
if (![[[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"BodyPreferenceType"] isEqualToString: bodyPreferenceType] ||
![[[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"MIMESupport"] isEqualToString: mimeSupport] ||
![[[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"MIMETruncation"] isEqualToString: mimeTruncation])
![[[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"MIMETruncation"] isEqualToString: mimeTruncation] ||
![[[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"FilterType"] isEqualToString: filterType])
{
folderOptions = [[NSDictionary alloc] initWithObjectsAndKeys: mimeSupport, @"MIMESupport", mimeTruncation, @"MIMETruncation", bodyPreferenceType, @"BodyPreferenceType", nil];
if ((([filterType intValue] != 0) && [[[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"FilterType"] intValue] < [filterType intValue]) ||
(([filterType intValue] == 0) && ([[[folderMetadata objectForKey: @"FolderOptions"] objectForKey: @"FilterType"] intValue] > [filterType intValue])))
{
[context setObject: [NSNumber numberWithBool: YES] forKey: @"FilterTypeChanged"];
}
folderOptions = [[NSDictionary alloc] initWithObjectsAndKeys: mimeSupport, @"MIMESupport", mimeTruncation, @"MIMETruncation", filterType, @"FilterType", bodyPreferenceType, @"BodyPreferenceType", nil];
[folderMetadata setObject: folderOptions forKey: @"FolderOptions"];
[self _setFolderMetadata: folderMetadata forKey: folderKey];
}
@@ -1599,11 +1897,215 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
withFilterType: [NSCalendarDate dateFromFilterType: [[(id)[theDocumentElement getElementsByTagName: @"FilterType"] lastObject] textValue]]
inBuffer: changeBuffer
lastServerKey: &lastServerKey
defaultInterval: [[SOGoSystemDefaults sharedSystemDefaults] maximumSyncInterval]];
defaultInterval: [[SOGoSystemDefaults sharedSystemDefaults] maximumSyncInterval]
mergeFolders: NO];
}
folderMetadata = [self _folderMetadataForKey: folderKey];
// We only check for changes in other folders if we got nothing back from personal folder and
// MergedFolder is set (sogo-tool manage-eas mergeVCard).
if (getChanges && !first_sync &&
([[collection nameInContainer] isEqualToString: @"personal"]) &&
([folderMetadata objectForKey: @"MergedFolder"]))
{
NSArray *unsortedArray;
NSMutableDictionary *mergedFolderMetadata, *mergedFoldersSyncKeys;
NSString *mergedFolderSyncKey, *component_name, *mfLastServerKey;
id mfCollection;
BOOL cacheUpdateNeeded;
mfLastServerKey = nil;
cacheUpdateNeeded=NO;
if (folderType == ActiveSyncContactFolder)
component_name = @"vcard";
else if (folderType == ActiveSyncEventFolder)
component_name = @"vevent";
else
component_name = @"vtodo";
mergedFoldersSyncKeys = [folderMetadata objectForKey: @"MergedFoldersSyncKeys"];
// Initialize if MergedFoldersSyncKeys doesn't exists.
// We user MergedFoldersSyncKeys to store the SyncKey for merged folders:
// MergedFoldersSyncKeys = { 1447166580 = {"vcard/34B2-543AB980-D-DB9ECF0" = 1447157519; "vcard/5DE4-5640BC80-3-37E3EE00" = 1447166074; }
// 1447166638 = {"vcard/34B2-543AB980-D-DB9ECF0" = 1447157519; "vcard/5DE4-5640BC80-3-37E3EE00" = 1447166074; } }
if (!mergedFoldersSyncKeys || [syncKey isEqualToString: @"-1"])
{
[folderMetadata setObject: [NSMutableDictionary dictionaryWithObject: [NSMutableDictionary dictionary] forKey: syncKey]
forKey: @"MergedFoldersSyncKeys"];
mergedFoldersSyncKeys = [folderMetadata objectForKey: @"MergedFoldersSyncKeys"];
cacheUpdateNeeded=YES;
}
// Copy the MergedFoldersSyncKeys entry. Later we update this entry with new SyncKeys if there are changes.
if (![syncKey isEqualToString: [folderMetadata objectForKey: @"SyncKey"]])
{
[mergedFoldersSyncKeys setObject: [mergedFoldersSyncKeys objectForKey: syncKey] forKey: [folderMetadata objectForKey: @"SyncKey"]];
cacheUpdateNeeded=YES;
}
// We only keep 5 entries in MergedFoldersSyncKeys.
unsortedArray = [mergedFoldersSyncKeys allKeys];
if ([unsortedArray count] > 5)
[mergedFoldersSyncKeys removeObjectForKey: [[unsortedArray sortedArrayUsingSelector:@selector(compare:)] objectAtIndex:0]];
// Don't check for changes in other folders if personal folder has changes.
if (![changeBuffer length])
{
NSArray *foldersInCache;
SOGoCacheGCSObject *o;
NSString *folderName, *realCollectionId;
NSArray *a, *folderNames;
SOGoMicrosoftActiveSyncFolderType mergedFolderType;
o = [SOGoCacheGCSObject objectWithName: @"0" inContainer: nil];
[o setObjectType: ActiveSyncFolderCacheObject];
[o setTableUrl: folderTableURL];
foldersInCache = [o cacheEntriesForDeviceId: [context objectForKey: @"DeviceId"] newerThanVersion: -1];
// Add folders to MergedFoldersSyncKeys.
for (i = 0; i < [foldersInCache count]; i++)
{
a = [[foldersInCache objectAtIndex: i] componentsSeparatedByString: @"+"];
folderName = [a objectAtIndex: 1];
if (![folderName hasPrefix: component_name] || [folderName hasSuffix: @"/personal"])
continue;
mergedFolderSyncKey = [[mergedFoldersSyncKeys objectForKey: [folderMetadata objectForKey: @"SyncKey"]] objectForKey: folderName ];
if (!mergedFolderSyncKey)
{
realCollectionId = [folderName realCollectionIdWithFolderType: &mergedFolderType];
mfCollection = [self collectionFromId: realCollectionId type: mergedFolderType];
// Cache-entry still exists but folder doesn't exists or synchronize flag is not set.
// We ignore the folder and wait for foldersync to do the cleanup.
if (!(mfCollection && [mfCollection synchronize]))
{
if (debugOn)
[self logWithFormat: @"EAS - Folder %@ not found. Ignoring ...", folderName];
continue;
}
mergedFolderMetadata = [self _folderMetadataForKey: folderName];
if (debugOn)
[self logWithFormat: @"EAS - Add folder %@ for merging into personal folder", folderName];
// Initialize MergedFoldersSyncKeys entry. e.g. "vcard/34B2-543AB980-D-DB9ECF0" = -1
[[mergedFoldersSyncKeys objectForKey: [folderMetadata objectForKey: @"SyncKey"]] setObject: @"-1" forKey: folderName];
cacheUpdateNeeded = YES;
// Flag folder as a merged folder.
if (![[mergedFolderMetadata objectForKey: @"MergedFolder"] isEqualToString: @"2"])
{
[mergedFolderMetadata setObject: @"1" forKey: @"MergedFolder"];
[self _setFolderMetadata: mergedFolderMetadata forKey: folderName];
}
}
}
// Check merged folders for changes.
folderNames = [[mergedFoldersSyncKeys objectForKey: [folderMetadata objectForKey: @"SyncKey"]] allKeys];
for (i = 0; i < [folderNames count]; i++)
{
folderName = [folderNames objectAtIndex: i];
realCollectionId = [folderName realCollectionIdWithFolderType: &mergedFolderType];
mfCollection = [self collectionFromId: realCollectionId type: mergedFolderType];
if (!(mfCollection && [mfCollection synchronize]))
{
if (debugOn)
[self logWithFormat: @"EAS - Folder %@ not found. Reset peronal folder to cleanup", folderName];
davCollectionTag = @"0";
*changeDetected = YES;
status = 3;
// Reset personal folder - Cleanup metadata of personal folder.
[folderMetadata removeObjectForKey: @"SyncKey"];
[folderMetadata removeObjectForKey: @"SyncCache"];
[folderMetadata removeObjectForKey: @"DateCache"];
[folderMetadata removeObjectForKey: @"UidCache"];
[folderMetadata removeObjectForKey: @"MoreAvailable"];
[folderMetadata removeObjectForKey: @"CleanoutDate"];
[self _setFolderMetadata: folderMetadata forKey: folderKey];
break;
}
if (debugOn)
[self logWithFormat: @"EAS - Merging folder %@ into personal folder", folderName];
mergedFolderSyncKey = [[mergedFoldersSyncKeys objectForKey: [folderMetadata objectForKey: @"SyncKey"]] objectForKey: folderName ];
[self processSyncGetChanges: theDocumentElement
inCollection: mfCollection
withWindowSize: windowSize
withMaxSyncResponseSize: theMaxSyncResponseSize
withSyncKey: mergedFolderSyncKey
withFolderType: folderType
withFilterType: [NSCalendarDate dateFromFilterType: [[(id)[theDocumentElement getElementsByTagName: @"FilterType"] lastObject] textValue]]
inBuffer: changeBuffer
lastServerKey: &mfLastServerKey
defaultInterval: [[SOGoSystemDefaults sharedSystemDefaults] maximumSyncInterval]
mergeFolders: YES];
mergedFolderMetadata = [self _folderMetadataForKey: folderName];
if ([changeBuffer length] || [commandsBuffer length])
{
if (mfLastServerKey)
mergedFolderSyncKey = mfLastServerKey;
else
{
mergedFolderSyncKey = [mergedFolderMetadata objectForKey: @"SyncKey"];
if (!mergedFolderSyncKey)
mergedFolderSyncKey = [mfCollection davCollectionTag];
}
*changeDetected = YES;
}
else
{
// Make sure that client is updated with the right syncKey. - This keeps vtodo's and vevent's syncKey in sync.
syncKeyInCache = [mergedFolderMetadata objectForKey: @"SyncKey"];
if (syncKeyInCache && !([mergedFolderSyncKey isEqualToString:syncKeyInCache]) && !first_sync)
{
mergedFolderSyncKey = syncKeyInCache;
*changeDetected = YES;
}
}
// Update MergedFoldersSyncKeys with new SyncKey.
[[mergedFoldersSyncKeys objectForKey: [folderMetadata objectForKey: @"SyncKey"]] setObject: mergedFolderSyncKey forKey: folderName];
if (*changeDetected)
{
// Set MoreAvailable to make sure we come back and check remaining folders.
[folderMetadata setObject: [NSNumber numberWithBool: YES] forKey: @"MoreAvailable"];
break;
}
else if ([folderMetadata objectForKey: @"MoreAvailable"])
{
[folderMetadata removeObjectForKey: @"MoreAvailable"];
cacheUpdateNeeded = YES;
}
}
} // end if
if (*changeDetected || cacheUpdateNeeded)
[self _setFolderMetadata: folderMetadata forKey: folderKey];
}
// If we got any changes or if we have applied any commands
// let's regenerate our SyncKey based on the collection tag.
if ([changeBuffer length] || [commandsBuffer length])
@@ -1767,7 +2269,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NSArray *allCollections;
NSData *d;
int i, j, defaultInterval, heartbeatInterval, internalInterval, maxSyncResponseSize, total_sleep;
int i, j, defaultInterval, heartbeatInterval, internalInterval, maxSyncResponseSize, total_sleep, sleepInterval;
BOOL changeDetected;
// We initialize our output buffer
@@ -1804,6 +2306,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
maxSyncResponseSize = [[SOGoSystemDefaults sharedSystemDefaults] maximumSyncResponseSize];
heartbeatInterval = [[[(id)[theDocumentElement getElementsByTagName: @"HeartbeatInterval"] lastObject] textValue] intValue];
internalInterval = [defaults internalSyncInterval];
sleepInterval = (internalInterval < 5) ? internalInterval : 5;
// If the request doesn't contain "HeartbeatInterval" there is no reason to delay the response.
if (heartbeatInterval == 0)
@@ -1826,10 +2329,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
[output appendString: @"<Collections>"];
s = nil;
// We enter our loop detection change
for (i = 0; i < (heartbeatInterval/internalInterval); i++)
{
if ([self easShouldTerminate])
break;
s = [NSMutableString string];
for (j = 0; j < [allCollections count]; j++)
@@ -1869,7 +2376,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
total_sleep = 0;
while (total_sleep < internalInterval)
while (![self easShouldTerminate] && total_sleep < internalInterval)
{
// We check if we must break the current synchronization since an other Sync
// has just arrived.
@@ -1886,9 +2393,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
else
{
int t;
[self logWithFormat: @"Sleeping %d seconds while detecting changes in Sync...", internalInterval-total_sleep];
sleep(5);
total_sleep += 5;
for (t = 0; t < sleepInterval; t++)
{
if ([self easShouldTerminate])
break;
sleep(1);
}
total_sleep += sleepInterval;
}
}
}
@@ -1907,7 +2422,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// We always return the last generated response.
// If we only return <Sync><Collections/></Sync>,
// iOS powered devices will simply crash.
[output appendString: s];
if (s)
[output appendString: s];
[output appendString: @"</Collections></Sync>"];
+3 -1
View File
@@ -37,6 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@class NSURL;
@class NSNumber;
static volatile BOOL easShouldTerminate = NO;
@interface SOGoActiveSyncDispatcher : NSObject
{
NSURL *folderTableURL;
@@ -44,7 +46,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
id context;
NSNumber *syncRequest;
BOOL debugOn;
}
@@ -62,5 +63,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (NSURL *) folderTableURL;
- (void) ensureFolderTableExists;
- (BOOL) easShouldTerminate;
@end
File diff suppressed because it is too large. Load diff
+110 -17
View File
@@ -485,7 +485,7 @@ struct GlobalObjectId {
{
encoding = [[theParts objectAtIndex: i ] objectForKey: @"encoding"];
charset = [[[theParts objectAtIndex: i ] objectForKey: @"parameterList"] objectForKey: @"charset"];
if (encoding && [encoding caseInsensitiveCompare: @"8bit"] == NSOrderedSame &&
if (encoding && ([encoding caseInsensitiveCompare: @"7bit"] == NSOrderedSame || [encoding caseInsensitiveCompare: @"8bit"] == NSOrderedSame) &&
charset && ![charset caseInsensitiveCompare: @"utf-8"] == NSOrderedSame
&& ![charset caseInsensitiveCompare: @"us-ascii"] == NSOrderedSame)
{
@@ -499,6 +499,91 @@ struct GlobalObjectId {
return NO;
}
- (BOOL) _isSigned: (NSDictionary *) thePart
{
NSMutableDictionary *currentPart;
NSArray *subparts;
NSString *type, *subtype;
NSUInteger i;
type = [[thePart objectForKey: @"type"] lowercaseString];
subtype = [[thePart objectForKey: @"subtype"] lowercaseString];
if ([type isEqualToString: @"multipart"])
{
if ([subtype isEqualToString: @"signed"])
return YES;
subparts = [thePart objectForKey: @"parts"];
for (i = 0; i < [subparts count]; i++)
{
currentPart = [subparts objectAtIndex: i];
if ([self _isSigned: currentPart])
return YES;
}
}
return NO;
}
- (BOOL) _isSmimeEncrypted: (NSDictionary *) thePart
{
NSMutableDictionary *currentPart;
NSArray *subparts;
NSString *type, *subtype;
NSUInteger i;
type = [[thePart objectForKey: @"type"] lowercaseString];
subtype = [[thePart objectForKey: @"subtype"] lowercaseString];
if ([type isEqualToString: @"multipart"])
{
subparts = [thePart objectForKey: @"parts"];
for (i = 0; i < [subparts count]; i++)
{
currentPart = [subparts objectAtIndex: i];
if ([self _isSmimeEncrypted: currentPart])
return YES;
}
}
else if ([type isEqualToString: @"application"] && ([subtype isEqualToString: @"pkcs7-mime"] ||
[subtype isEqualToString: @"x-pkcs7-mime"]))
return YES;
return NO;
}
- (BOOL) _isPGP: (NSDictionary *) thePart
{
NSMutableDictionary *currentPart;
NSArray *subparts;
NSString *type, *subtype, *protocol;
NSUInteger i;
type = [[thePart objectForKey: @"type"] lowercaseString];
subtype = [[thePart objectForKey: @"subtype"] lowercaseString];
protocol = [[[thePart objectForKey: @"parameterList"] objectForKey: @"protocol"] lowercaseString];
if ([type isEqualToString: @"multipart"])
{
if (([protocol isEqualToString: @"application/pgp-signature"] || [protocol isEqualToString: @"application/pgp-encrypted"]))
return YES;
subparts = [thePart objectForKey: @"parts"];
for (i = 0; i < [subparts count]; i++)
{
currentPart = [subparts objectAtIndex: i];
if ([self _isPGP: currentPart])
return YES;
}
}
else if ([type isEqualToString: @"application"] && [subtype isEqualToString: @"pgp-encrypted"])
return YES;
return NO;
}
//
//
//
@@ -523,7 +608,9 @@ struct GlobalObjectId {
else if ([type isEqualToString: @"multipart"])
*theNativeType = 4;
if (([subtype isEqualToString: @"signed"] || [subtype isEqualToString: @"pkcs7-mime"] ) && theMimeSupport > 0)
if (([self _isSigned: [self bodyStructure]] ||
[self _isSmimeEncrypted: [self bodyStructure]] ||
[self _isPGP: [self bodyStructure]]) && theMimeSupport > 0)
{
*theNativeType = 4;
isSMIME = YES;
@@ -695,7 +782,7 @@ struct GlobalObjectId {
iCalCalendar *calendar;
NSData *calendarData;
calendarData = [bodyPart fetchBLOB];
calendarData = [bodyPart fetchBLOBWithPeek: YES];
calendar = nil;
NS_DURING
@@ -721,15 +808,13 @@ struct GlobalObjectId {
NSData *d, *globalObjId;
NSArray *attachmentKeys;
iCalCalendar *calendar;
NSString *p, *subtype;
NSString *p;
NSMutableString *s;
id value;
int preferredBodyType, mimeSupport, mimeTruncation, nativeBodyType;
uint32_t v;
subtype = [[[self bodyStructure] valueForKey: @"subtype"] lowercaseString];
preferredBodyType = [[context objectForKey: @"BodyPreferenceType"] intValue];
mimeSupport = [[context objectForKey: @"MIMESupport"] intValue];
mimeTruncation = [[context objectForKey: @"MIMETruncation"] intValue];
@@ -918,7 +1003,7 @@ struct GlobalObjectId {
[s appendFormat: @"<GlobalObjId xmlns=\"Email:\">%@</GlobalObjId>", [globalObjId activeSyncRepresentationInContext: context]];
// We set the right message type - we must set AS version to 14.1 for this
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.1"])
if ([[context valueForKey: @"ASProtocolVersion"] floatValue] >= 14.1)
[s appendFormat: @"<MeetingMessageType xmlns=\"Email2:\">%d</MeetingMessageType>", 1];
[s appendString: @"</MeetingRequest>"];
@@ -929,12 +1014,13 @@ struct GlobalObjectId {
else
{
// MesssageClass and ContentClass
if ([subtype isEqualToString: @"signed"])
if ([self _isSigned: [self bodyStructure]])
[s appendFormat: @"<MessageClass xmlns=\"Email:\">%@</MessageClass>", @"IPM.Note.SMIME.MultipartSigned"];
else if ([subtype isEqualToString: @"pkcs7-mime"])
else if ([self _isSmimeEncrypted: [self bodyStructure]])
[s appendFormat: @"<MessageClass xmlns=\"Email:\">%@</MessageClass>", @"IPM.Note.SMIME"];
else
[s appendFormat: @"<MessageClass xmlns=\"Email:\">%@</MessageClass>", @"IPM.Note"];
[s appendFormat: @"<ContentClass xmlns=\"Email:\">%@</ContentClass>", @"urn:content-classes:message"];
}
@@ -1083,7 +1169,7 @@ struct GlobalObjectId {
truncated = 0;
}
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<Body xmlns=\"Email:\">%@</Body>", content];
[s appendFormat: @"<BodyTruncated xmlns=\"Email:\">%d</BodyTruncated>", truncated];
@@ -1096,7 +1182,9 @@ struct GlobalObjectId {
// For s/mime mails type is always 4 if mimeSupport is 1 or 2.
if (preferredBodyType == 2 && nativeBodyType == 1)
[s appendString: @"<Type>1</Type>"];
else if (([subtype isEqualToString: @"signed"] || [subtype isEqualToString: @"pkcs7-mime"] ) && mimeSupport > 0)
else if (([self _isSigned: [self bodyStructure]] ||
[self _isSmimeEncrypted: [self bodyStructure]] ||
[self _isPGP: [self bodyStructure]]) && mimeSupport > 0)
[s appendString: @"<Type>4</Type>"];
else
[s appendFormat: @"<Type>%d</Type>", preferredBodyType];
@@ -1112,11 +1200,11 @@ struct GlobalObjectId {
// Attachments -namespace 16
attachmentKeys = [self fetchFileAttachmentKeys];
if ([attachmentKeys count] && !([subtype isEqualToString: @"signed"]))
if ([attachmentKeys count] && !([self _isSigned: [self bodyStructure]]))
{
int i;
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
[s appendString: @"<Attachments xmlns=\"Email:\">"];
else
[s appendString: @"<Attachments xmlns=\"AirSyncBase:\">"];
@@ -1131,18 +1219,24 @@ struct GlobalObjectId {
// FileReference must be a unique identifier across the whole store. We use the following structure:
// mail/<foldername>/<message UID/<pathofpart>
// mail/INBOX/2
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
[s appendFormat: @"<AttName>mail/%@/%@/%@</AttName>", [[[self container] relativeImap4Name] stringByEscapingURL], [self nameInContainer], [value objectForKey: @"path"]];
else
[s appendFormat: @"<FileReference>mail/%@/%@/%@</FileReference>", [[[self container] relativeImap4Name] stringByEscapingURL], [self nameInContainer], [value objectForKey: @"path"]];
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<AttMethod>%d</AttMethod>", 1];
[s appendFormat: @"<AttSize>%d</AttSize>", [[value objectForKey: @"size"] intValue]];
}
else
{
if ([[value objectForKey: @"bodyId"] length])
{
[s appendFormat: @"<ContentId>%@</ContentId>", [[value objectForKey: @"bodyId"] activeSyncRepresentationInContext: context]];
[s appendFormat: @"<IsInline>%d</IsInline>", 1];
}
[s appendFormat: @"<Method>%d</Method>", 1]; // See: http://msdn.microsoft.com/en-us/library/ee160322(v=exchg.80).aspx
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", [[value objectForKey: @"size"] intValue]];
//[s appendFormat: @"<IsInline>%d</IsInline>", 1];
@@ -1179,8 +1273,7 @@ struct GlobalObjectId {
[s appendFormat: @"</Categories>"];
}
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.0"] ||
[[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.1"])
if ([[context valueForKey: @"ASProtocolVersion"] floatValue] >= 14.0)
{
id value;
NSString *reference;
+40 -10
View File
@@ -70,7 +70,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (int) _attendeeStatus: (iCalPerson *) attendee
{
int attendee_status;
attendee_status = 5;
if ([[attendee partStat] caseInsensitiveCompare: @"ACCEPTED"] == NSOrderedSame)
attendee_status = 3;
@@ -82,6 +82,29 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
return attendee_status;
}
//
// Possible values are:
// 0 Free
// 1 Tentative
// 2 Busy
// 3 Out of Office
// 4 Working elsewhere
//
- (int) _busyStatus: (iCalPerson *) attendee
{
int attendee_status;
attendee_status = 2;
if ([[attendee partStat] caseInsensitiveCompare: @"DECLINED"] == NSOrderedSame)
attendee_status = 0;
else if ([[attendee partStat] caseInsensitiveCompare: @"TENTATIVE"] == NSOrderedSame)
attendee_status = 1;
return attendee_status;
}
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
NSMutableString *s;
@@ -152,7 +175,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
o = [organizer cn];
if ([o length])
[s appendFormat: @"<Organizer_Name xmlns=\"Calendar:\">%@</Organizer_Name>", o];
[s appendFormat: @"<Organizer_Name xmlns=\"Calendar:\">%@</Organizer_Name>", [o activeSyncRepresentationInContext: context]];
}
}
@@ -190,7 +213,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
else
{
meetingStatus = 0; // appointment
meetingStatus = 0; // The event is an appointment, which has no attendees.
}
// This depends on the 'NEEDS-ACTION' parameter.
@@ -211,6 +234,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"<DisallowNewTimeProposal xmlns=\"Calendar:\">%d</DisallowNewTimeProposal>", 1];
// BusyStatus -- http://msdn.microsoft.com/en-us/library/ee202290(v=exchg.80).aspx
[s appendFormat: @"<BusyStatus xmlns=\"Calendar:\">%d</BusyStatus>", [self _busyStatus: attendee]];
}
else
{
// If it's a normal event (ie, with no organizer/attendee) or we are the organizer to an event
// invitation, we set the busy status to 2 (Busy)
[s appendFormat: @"<BusyStatus xmlns=\"Calendar:\">%d</BusyStatus>", 2];
}
@@ -251,7 +280,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// otherwise it'll prevent WP8 phones from sync'ing. See #3028 for details.
o = [o activeSyncRepresentationInContext: context];
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<Body xmlns=\"Calendar:\">%@</Body>", o];
[s appendString: @"<BodyTruncated xmlns=\"Calendar:\">0</BodyTruncated>"];
@@ -494,7 +523,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
// FIXME: merge with iCalToDo
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
{
if ((o = [theValues objectForKey: @"Body"]))
[self setComment: o];
@@ -508,6 +537,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ((o = [theValues objectForKey: @"Location"]))
[self setLocation: o];
deltasecs = 0;
start = nil;
if ((o = [theValues objectForKey: @"StartTime"]))
{
o = [o calendarDate];
@@ -515,8 +547,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
oldstart = [start dateTime];
[start setTimeZone: tz];
if (isAllDay)
{
if (isAllDay)
{
[start setDate: o];
[start setTimeZone: nil];
}
@@ -527,9 +559,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Calculate delta if start date has been changed.
if (oldstart)
deltasecs = [[start dateTime ] timeIntervalSinceDate: oldstart] * -1;
else
deltasecs = 0;
deltasecs = [[start dateTime ] timeIntervalSinceDate: oldstart] * -1;
}
if ((o = [theValues objectForKey: @"EndTime"]))
+22 -4
View File
@@ -37,11 +37,25 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <NGCards/iCalEvent.h>
#import <NGCards/iCalByDayMask.h>
#import <NGCards/iCalDateTime.h>
#import <NGCards/iCalTimeZone.h>
#import "NSCalendarDate+ActiveSync.h"
#import "NSDate+ActiveSync.h"
@implementation iCalRecurrenceRule (ActiveSync)
- (NSCalendarDate *) _adjustedStartDate
{
iCalTimeZone *timeZone;
timeZone = [(iCalDateTime *)[[self parent] firstChildWithTag: @"dtstart"] timeZone];
if (timeZone)
return [timeZone computedDateForDate: [[self parent] startDate]];
else
return [[self parent] startDate];
}
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
NSMutableString *s;
@@ -90,7 +104,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
// No byDayMask, we take the event's start date to compute the DayOfWeek
// 0 == Sunday, 6 == Saturday
v = (1 << [[[self parent] startDate] dayOfWeek]);
v = (1 << [[self _adjustedStartDate] dayOfWeek]);
}
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"Calendar:\">%d</Recurrence_DayOfWeek>", v];
@@ -139,8 +153,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
// Simple reccurrence rule of type "Monthly"
type = 2;
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"Calendar:\">%d</Recurrence_DayOfMonth>",
(int)[[[self parent] startDate] dayOfMonth]];
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"Calendar:\">%d</Recurrence_DayOfMonth>", [[self _adjustedStartDate] dayOfMonth]];
}
}
else if ([self frequency] == iCalRecurrenceFrequenceYearly)
@@ -176,7 +189,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
}
else
type = 5;
{
type = 5;
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"Calendar:\">%d</Recurrence_DayOfMonth>", [[self _adjustedStartDate] dayOfMonth]];
[s appendFormat: @"<Recurrence_MonthOfYear xmlns=\"Calendar:\">%d</Recurrence_MonthOfYear>", [[self _adjustedStartDate] monthOfYear]];
}
}
[s appendFormat: @"<Recurrence_Type xmlns=\"Calendar:\">%d</Recurrence_Type>", type];
+12 -8
View File
@@ -128,7 +128,7 @@ struct SYSTEMTIME {
//uint16_t wStandardYear;
struct SYSTEMTIME stStandardDate;
//uint16_t wDaylightYear;
struct SYSTEMTIME stDaylightDate;
struct SYSTEMTIME stDaylightDate = {0,0,0,0,0,0,0,0};
char standardName[64], daylightName[64];
@@ -144,13 +144,17 @@ struct SYSTEMTIME {
period = [self _mostRecentPeriodWithName: @"DAYLIGHT"];
if (!period)
stStandardDate.wMonth = 0;
lDaylightBias = (uint32_t) -([period secondsOffsetFromGMT] / 60) - lBias;
[period _fillTZDate: &stDaylightDate];
//wStandardYear = stStandardDate.wYear;
//wDaylightYear = stDaylightDate.wYear;
{
stStandardDate.wMonth = 0;
lDaylightBias = 0;
}
else
{
lDaylightBias = (uint32_t) -([period secondsOffsetFromGMT] / 60) - lBias;
[period _fillTZDate: &stDaylightDate];
//wStandardYear = stStandardDate.wYear;
//wDaylightYear = stDaylightDate.wYear;
}
// We build the timezone
[bytes appendBytes: &lBias length: 4];
+2 -2
View File
@@ -131,7 +131,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// otherwise it'll prevent WP8 phones from sync'ing. See #3028 for details.
o = [o activeSyncRepresentationInContext: context];
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<Body xmlns=\"Tasks:\">%@</Body>", o];
[s appendString: @"<BodyTruncated xmlns=\"Tasks:\">0</BodyTruncated>"];
@@ -165,7 +165,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[self setSummary: o];
// FIXME: merge with iCalEvent
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[context valueForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
{
if ((o = [theValues objectForKey: @"Body"]))
[self setComment: o];
+5 -2
View File
@@ -69,9 +69,11 @@ ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
<Proxy http://127.0.0.1:20000/SOGo>
## adjust the following to your configuration
## and do not forget to enable the headers module
<IfModule headers_module>
RequestHeader set "x-webobjects-server-port" "443"
# RequestHeader set "x-webobjects-server-name" "yourhostname"
# RequestHeader set "x-webobjects-server-url" "https://yourhostname"
RequestHeader set "x-webobjects-server-name" "%{HTTP_HOST}e" env=HTTP_HOST
RequestHeader set "x-webobjects-server-url" "https://%{HTTP_HOST}e" env=HTTP_HOST
## When using proxy-side autentication, you need to uncomment and
## adjust the following line:
@@ -79,6 +81,7 @@ ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e" env=REMOTE_USER
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
</IfModule>
AddDefaultCharset UTF-8
+3082
View File
File diff suppressed because it is too large. Load diff
-5655
View File
File diff suppressed because it is too large. Load diff
+61 -5
View File
@@ -216,12 +216,10 @@ gpgcheck=0
Some of the softwares on which SOGo depends are available from the
repository of RepoForge (previously known as RPMforge). To add RepoForge
to your packages sources, download and install the appropriate RPM
package
from http://packages.sw.be/rpmforge-release/.
package from http://packages.sw.be/rpmforge-release/.
Also make sure you enabled the "rpmforge-extras" repository.
For more information on using RepoForge,
visit http://repoforge.org/use/.
For more information on using RepoForge, visit http://repoforge.org/use/.
Software Installation
~~~~~~~~~~~~~~~~~~~~~
@@ -370,6 +368,13 @@ Defaults to 10 (minutes).
Do not set this too low as child processes replying to clients on a slow
internet connection could be killed prematurely.
|S |WOMaxUploadSize
|Parameter used to set the maximum allowed size for content being
sent to SOGo using a PUT or a POST call. This can also limit the file
attachment size being uploaded to SOGo when composing a mail. The
value is in kilobyte. By default, the value is 0, or disabled so no
limit will be set.
|S |SxVMemLimit
|Parameter used to set the maximum amount of memory (in
megabytes) that a child can use. Reaching that value will force children
@@ -716,6 +721,21 @@ Default value is `0`, or disabled.
|Number of seconds, default to `300` (or 5 minutes). Note that
_SOGoCacheCleanupInterval_ must be set to a value equal or higher than
_SOGoFailedLoginBlockInterval_.
|S |SOGoMaximumRequestCount
|Parameter used to control the number of requests a user can send to the SOGo
server in _SOGoMaximumRequestInterval_ seconds or more. If conditions are met
or exceeded, the user will not be able to perform requests on the SOGo server
for _SOGoRequestBlockInterval_ seconds and will receive 429 HTTP responses for
any requests being made. Default value is 0, or disabled
|S |SOGoMaximumRequestInterval
|Number of seconds, defaults to `30`.
|S |SOGoRequestBlockInterval
|Number of seconds, defaults to 300 (or 5 minutes). Note that _SOGoCacheCleanupInterval_
must be set to a value equal or higher than _SOGoRequestBlockInterval_.
|=======================================================================
Authentication using LDAP
@@ -887,7 +907,8 @@ table.
|MailFieldNames
|An array of fields that returns the user's email addresses (defaults to
`mail` when unset).
`mail` when unset). Note that SOGo will always automatically strip the
protocol value from the attribute if the attribute name is `proxyAddresses`.
|SearchFieldNames
|An array of fields to to match against the search string when filtering
@@ -1324,6 +1345,29 @@ supported, such as MySQL and Oracle.
First, make sure that your PostgreSQL server has TCP/IP connections
support enabled.
[TIP]
===============================
SOGo stores the database hostname together with table references inside
several database tables. To prevent possible future issues when moving
the database to another host, it is best practice to add a local alias name to
your `/etc/hosts` file, and using this in `/etc/sogo/sogo.conf` instead of the
actual name of your server or localhost. When the database host name changes,
you can now simply change the hosts file instead of updating several table
columns replacing the old hostname. An example entry for `/etc/hosts` when
running the database on the same host, registering `127.0.0.1` not only for
`localhost`, but also the `db-alias` alias:
127.0.0.1 localhost db-alias
In the SOGo configuration, use the alias name instead of the real IP address or
host name, for example
----
SOGoProfileURL =
"postgresql://sogo:sogo@db-alias:5432/sogo/sogo_user_profile";
----
===============================
Create the database user and schema using the following commands:
----
@@ -1387,6 +1431,13 @@ URL could be set to something like:
See the "EMail reminders" section in this document for more information.
|=======================================================================
[NOTE]
Any non-URL safe characters in username/password must be URL-encoded.
For example, if your SOGo database password is `so%go`, you must set
the value in your preferences to `so%25go` - where `%` is encoded
to `%25`.
If you're using MySQL, make sure in your `my.cnf` file you have:
----
@@ -1842,6 +1893,11 @@ host.
Defaults to `NO` when unset.
|U |SOGoSieveFilters
|Parameter used to define initial Sieve scripts for users. The user
can still modify the scripts and the initial values will be written
to the Sieve server upon first login.
|D |SOGoMailPollingIntervals
|Parameter used to define the mail polling intervals (in minutes)
available to the user. The parameter is an array that can contain the
+3 -3
View File
@@ -1,7 +1,7 @@
<!-- TODO have the build system take care of this -->
<releaseinfo>Version 2.3.9 - March 2016</releaseinfo>
<subtitle>for version 2.3.9</subtitle>
<date>2016-03-16</date>
<releaseinfo>Version 2.3.17 - October 2016</releaseinfo>
<subtitle>for version 2.3.17</subtitle>
<date>2016-10-20</date>
<legalnotice>
<para>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".</para>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@@ -13,6 +13,6 @@
// TODO have the build system take care of this
:release_version: 2.3.9
:release_version: 2.3.17
// vim: set syntax=asciidoc tabstop=2 shiftwidth=2 expandtab:
+14 -19
View File
@@ -42,6 +42,7 @@
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserFolder.h>
#import <SOGo/SOGoUserManager.h>
#import "SOGo+DAV.h"
@@ -365,31 +366,26 @@
withEmailAddressSetMatching: (NSString *) value
inContext: (WOContext *) localContext
{
id <SOGoSource> authenticationSource;
SOGoUser *activeUser;
SOGoUserManager *um;
NSArray *records;
NSUInteger count, max;
NSString *uid;
SOGoUserFolder *collection;
activeUser = [localContext activeUser];
if ([activeUser respondsToSelector: @selector (authenticationSource)])
um = [SOGoUserManager sharedUserManager];
records = [um fetchUsersMatching: value
inDomain: [[localContext activeUser] domain]];
max = [records count];
for (count = 0; count < max; count++)
{
authenticationSource = [[localContext activeUser] authenticationSource];
records = [authenticationSource
fetchContactsMatching: value
inDomain: [activeUser domain]];
max = [records count];
for (count = 0; count < max; count++)
{
uid = [[records objectAtIndex: count] objectForKey: @"c_uid"];
if ([uid length] > 0)
{
collection = [[SOGoUser userWithLogin: uid]
uid = [[records objectAtIndex: count] objectForKey: @"c_uid"];
if ([uid length] > 0)
{
collection = [[SOGoUser userWithLogin: uid]
homeFolderInContext: localContext];
[collections addObject: collection];
}
}
[collections addObject: collection];
}
}
}
@@ -585,7 +581,6 @@
@"addressbook", @"calendar-access",
@"calendar-schedule", @"calendar-auto-schedule",
@"calendar-proxy",
@"calendar-query-extended",
@"extended-mkcol",
@"calendarserver-principal-property-search",
+64 -1
View File
@@ -145,7 +145,7 @@ static BOOL debugLeaks;
[$(@"SOGoFolder") soClass];
/* load products */
[[SOGoProductLoader productLoader] loadAllProducts];
[[SOGoProductLoader productLoader] loadAllProducts: YES];
}
- (id) init
@@ -425,8 +425,12 @@ static BOOL debugLeaks;
{
static NSArray *runLoopModes = nil;
static BOOL debugOn = NO;
SOGoSystemDefaults *sd;
WOResponse *resp;
NSDate *startDate;
NSString *path;
NSTimeInterval timeDelta;
if (debugRequests)
@@ -436,6 +440,7 @@ static BOOL debugLeaks;
startDate = [NSDate date];
}
sd = [SOGoSystemDefaults sharedSystemDefaults];
cache = [SOGoCache sharedCache];
#ifdef GNUSTEP_BASE_LIBRARY
if (debugLeaks)
@@ -450,6 +455,64 @@ static BOOL debugLeaks;
}
#endif
// We check for rate-limiting settings - ignore anything actually
// sent to /SOGo/ (so unauthenticated requests).
path = [_request requestHandlerPath];
if ([path length] && [sd maximumRequestCount] > 0)
{
NSDictionary *requestCount;
NSString *username;
NSRange r;
r = [path rangeOfString: @"/"];
// We handle /sogo1/Calendar/.../ and "sogo1" as paths
if (r.length)
username = [path substringWithRange: NSMakeRange(0, r.location)];
else
username = path;
requestCount = [cache requestCountForLogin: username];
if (requestCount)
{
unsigned int current_time, start_time, delta, block_time, request_count;
current_time = [[NSCalendarDate date] timeIntervalSince1970];
start_time = [[requestCount objectForKey: @"InitialDate"] unsignedIntValue];
delta = current_time - start_time;
block_time = [sd requestBlockInterval];
request_count = [[requestCount objectForKey: @"RequestCount"] intValue];
if ( request_count >= [sd maximumRequestCount] &&
delta < [sd maximumRequestInterval] &&
delta <= block_time )
{
resp = [WOResponse responseWithRequest: _request];
[resp setStatus: 429];
return resp;
}
if (delta > block_time)
{
[cache setRequestCount: 1
forLogin: username
interval: current_time];
}
else
[cache setRequestCount: (request_count+1)
forLogin: username
interval: start_time];
}
else
{
[cache setRequestCount: 1
forLogin: username
interval: 0];
}
}
resp = [super dispatchRequest: _request];
[cache killCache];
+146 -1
View File
@@ -1,3 +1,148 @@
2.3.17 (2016-10-20)
-------------------
Enhancements
- [web] allow custom email address to be one of the user's profile (#3551)
- [web] the left column of the attendees editor is resizable (not supported in IE) (#1479, #3667)
Bug fixes
- [eas] make sure we don't sleep for too long when EAS processes need interruption
- [eas] fixed recurring events with timezones for EAS (#3822)
- [eas] improve handling of email folders without a parent
- [eas] never send IMIP reply when the "initiator" is Outlook 2013/2016
- [core] only consider SMTP addresses for AD's proxyAddresses (#3842)
2.3.16 (2016-09-28)
-------------------
New features
- [eas] initial support for server-side mailbox search operations
Enhancements
- [eas] propagate message submission errors to EAS clients (#3774)
- [web] updated CKEditor to version 4.5.11
- [web] added Serbian (sr) translation - thanks to Bogdanović Bojan
Bug fixes
- [web] correctly set percent-complete for tasks from the list view (#3197)
- [core] fixed caching expiration of ACLs assigned to LDAP groups (#2867)
- [core] we now search in all domain sources for Apple Calendar
- [core] properly handle groups in Apple Calendar's delegation
- [core] make sure new cards always have a UID (#3819)
2.3.15 (2016-09-14)
------------------
Enhancements
- [web] don't allow a recurrence rule to end before the first occurrence
Bug fixes
- [eas] properly generate the BusyStatus for normal events
- [eas] properly escape all email and address fields
- [eas] properly generate yearly rrule
- [core] strip protocol value from proxyAddresses attribute (#3182)
- [web] handle binary content transfer encoding when displaying mails
2.3.14 (2016-08-17)
-------------------
New features
- [eas] added folder merging capabilities
Enhancements
- [web] expunge drafts mailbox when a draft is sent and deleted
- [web] style cancelled events in Calendar module (#2800)
- [web] updated CKEditor to version 4.5.10
Bug fixes
- [eas] fixed long GUID issue preventing sometimes synchronisation (#3460)
- [web] improved extraction of HTML signature in Preferences module
- [web] really delete mailboxes being deleted from the Trash folder (#595, #1189, #641)
- [core] fixing sogo-tool backup with multi-domain configuration but domain-less logins
- [core] during event scheduling, use 409 instead of 403 so Lightning doesn't fail silently
- [core] correctly calculate recurrence exceptions when not overlapping the recurrence id
- [core] prevent invalid SENT-BY handling during event invitations (#3759)
2.3.13 (2016-07-06)
-------------------
New features
- [core] now possible to set default Sieve script (#2949)
- [core] new sogo-tool truncate-calendar feature (#1513, #3141)
- [eas] initial Out-of-Office support in EAS
Enhancements
- [core] avoid showing bundle loading info when not needed (#3726)
- [core] when restoring data using sogo-tool, regenerate Sieve script (#3029)
- [eas] use the preferred email identity in EAS if valid (#3698)
- [eas] handle inline attachments during EAS content generation
- [web] update jQuery File Upload library to 9.12.5
Bug fixes
- [web] fixed crash when an attachment filename has no extension
- [web] dragging a toolbar button was blocking the mail editor in Firefox
- [eas] handle base64 EAS protocol version
2.3.12 (2016-06-10)
-------------------
Enhancements
- [web] updated CKEditor to version 4.5.9
- [web] CKEditor: switched to the minimalist skin
- [web] CKEditor: added the base64image plugin
- [web] CKEditor: added the pastefromword plugin (#2295, #3313)
- [web] added Turkish (Turkey) (tr_TR) translation - thanks to Sinan Kurşunoğlu
Bug fixes
- [core] sanity checks for events with bogus timezone offsets
- [core] strip X- tags when securing content (#3695)
- [core] properly handle flattened timezone definitions (#2690)
- [eas] when using EAS/ItemOperations, use IMAP PEEK operation
- [web] fixed recipients when replying from a message in the Sent mailbox (#2625)
- [web] fixed localizable strings in Card viewer
- [web] properly encode HTML attributes in Contacts module to avoid XSS issues
- [web] handle c_mail field format of quick record of contacts of v3 (#3443)
- [web] fixed all-day events covering a timezone change (#3457)
- [web] fixed display of invitation with a category (#3590)
2.3.11 (2016-05-12)
-------------------
Bug fixes
- properly escape organizer name when using EAS (#3615)
- properly escape wide characters (#3616)
- calendars list when creating a new component in a calendar in which the user
can't delete components
- avoid double-appending domains in cache for multi-domain configurations (#3614)
- encode CR in EAS payload (#3626)
- password change during login process when using ppolicy
- correctly set answered/forwarded flags during EAS smart operations
- don't mark calendar invitations as read when fetching messages using EAS
- fixed messages archiving as zip file
- fixed multi-domain issue with non-unique ID across domains (#3625)
- fixed bogus headers generation when stripping folded bcc header (#3664)
- fixed issue with multi-value org units (#3630)
- fixed sensitive range of checkboxes in appointment editor (#3665)
2.3.10 (2016-04-05)
-------------------
New features
- new user-based rate-limiting support for all SOGo requests (#3188)
Bug fixes
- respect the LDAP attributes mapping in the list view
- handle empty body data when forwarding mails (#3581)
- correctly set EAS message class for S/MIME messages (#3576)
- we now handle the default classifications for tasks (#3541)
- handle FilterType changes using EAS (#3543)
- handle Dovecot's mail_shared_explicit_inbox parameter when using EAS
- prevent concurrent Sync ops from same EAS device (#3603)
- handle EAS loop termination when SOGo is being shutdown (#3604)
- avoid marking mails as read when archiving a folder (#2792)
- now cache heartbeat interval and folders list during EAS Ping ops (#3606)
- sanitize non-us-ascii 7bit emails when using EAS (#3592)
2.3.9 (2016-03-16)
------------------
@@ -8,7 +153,7 @@ New features
Enhancements
- allow resources to prevent invitations (#3410)
- now support EAS MIME truncation
- [web] added Lithuanan (lt) translation - thanks to Mantas Liobė
- added Lithuanan (lt) translation - thanks to Mantas Liobė
Bug fixes
- allow EAS attachments get on 2nd-level mailboxes (#3505)
+3
View File
@@ -78,6 +78,9 @@ $(SOGOBACKEND)_OBJC_FILES += \
MAPIStoreGCSMessage.m \
MAPIStoreGCSMessageTable.m \
\
MAPIStoreCalTaskFolder.m \
MAPIStoreCalTaskMessage.m \
\
MAPIStoreCalendarAttachment.m \
MAPIStoreCalendarContext.m \
MAPIStoreCalendarFolder.m \
+98 -94
View File
@@ -68,105 +68,109 @@
- (void) fillMessageData: (struct mapistore_message *) dataPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (NSString *) creator;
- (NSString *) owner;
- (NSUInteger) sensitivity;
- (int) getPidTagReceivedByAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSenderEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSenderAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSenderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSenderEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagOwnerAppointmentId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidMeetingType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagStartDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentSequence: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentStateFlags: (void **) data
- (enum mapistore_error) getPidTagReceivedByAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagReceivedByEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagReceivedByName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagReceivedByEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagOwnerAppointmentId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidMeetingType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagStartDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentSequence: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentStateFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidResponseStatus: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentStartWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidCommonStart: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagEndDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentEndWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidCommonEnd: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentDuration: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentSubType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidBusyStatus: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidIndentedBusyStatus: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data // SUMMARY
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidLocation: (void **) data // LOCATION
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSensitivity: (void **) data // not implemented, depends on CLASS
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidResponseStatus: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentStartWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidCommonStart: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagEndDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentEndWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidCommonEnd: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentDuration: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentSubType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidBusyStatus: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidIndentedBusyStatus: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagNormalizedSubject: (void **) data // SUMMARY
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidLocation: (void **) data // LOCATION
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSensitivity: (void **) data // not implemented, depends on CLASS
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidIsRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentRecur: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidCleanGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidServerProcessed: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidServerProcessingActions: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentReplyTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidIsRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentRecur: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidCleanGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidServerProcessed: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidServerProcessingActions: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidAppointmentReplyTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
/* reminders */
- (int) getPidLidReminderSet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderDelta: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderSignalTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderOverride: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderPlaySound: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderFileParameter: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderSet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderDelta: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderSignalTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderOverride: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderPlaySound: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidReminderFileParameter: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
@end
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -36,13 +36,13 @@
- (void) setAID: (uint32_t) newAID;
- (uint32_t) AID;
- (int) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMID: (uint64_t *) mid
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMID: (uint64_t *) mid
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx;
/* helpers */
- (NSData *) mimeAttachTag;
+15 -15
View File
@@ -67,40 +67,40 @@
return mimeAttachTag;
}
- (int) getPidTagMid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, [container objectId]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, aid);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagRenderingPosition: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagRenderingPosition: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0xffffffff);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMID: (uint64_t *) mid
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMID: (uint64_t *) mid
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreEmbeddedMessage *attMessage;
struct mapistore_message *mapistoreMsg;
@@ -118,9 +118,9 @@
return (attMessage ? MAPISTORE_SUCCESS : MAPISTORE_ERROR);
}
- (int) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreEmbeddedMessage *attMessage;
struct mapistore_message *mapistoreMsg;
+35
View File
@@ -0,0 +1,35 @@
/* MAPIStoreCalTaskFolder.h - this file is part of SOGo
*
* Copyright (C) 2016 Enrique J. Hernandez
*
* Author: Enrique J. Hernandez <ejhernandez@zentyal.com>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef MAPISTORECALTASKFOLDER_H
#define MAPISTORECALTASKFOLDER_H
#import "MAPIStoreGCSFolder.h"
/* This class is intended to share code between Calendar and Tasks as
of nowadays share the table */
@interface MAPIStoreCalTaskFolder : MAPIStoreGCSFolder
@end
#endif /* MAPISTORECALTASKFOLDER_H */
+101
View File
@@ -0,0 +1,101 @@
/* MAPIStoreCalTaskFolder.m - this file is part of SOGo
*
* Copyright (C) 2016 Enrique J. Hernandez
*
* Author: Enrique J. Hernandez <ejhernandez@zentyal.com>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSString.h>
#import <SOGo/SOGoPermissions.h>
#import "MAPIStoreCalTaskFolder.h"
@implementation MAPIStoreCalTaskFolder
- (NSArray *) expandRoles: (NSArray *) roles
{
static NSDictionary *rolesMap = nil;
NSArray *subRoles;
NSMutableSet *expandedRoles;
NSString *role, *subRole;
NSUInteger i, max, j;
if (!rolesMap)
{
/* Build the map of array permissions */
rolesMap = [[NSDictionary alloc] initWithObjects: [NSArray arrayWithObjects:
[NSArray arrayWithObjects: SOGoCalendarRole_PublicDAndTViewer,
SOGoCalendarRole_PublicViewer,
SOGoCalendarRole_PublicResponder,
SOGoCalendarRole_PublicModifier, nil],
[NSArray arrayWithObjects: SOGoCalendarRole_ConfidentialDAndTViewer,
SOGoCalendarRole_ConfidentialViewer,
SOGoCalendarRole_ConfidentialResponder,
SOGoCalendarRole_ConfidentialModifier, nil],
[NSArray arrayWithObjects: SOGoCalendarRole_PrivateDAndTViewer,
SOGoCalendarRole_PrivateViewer,
SOGoCalendarRole_PrivateResponder,
SOGoCalendarRole_PrivateModifier, nil],
[NSArray arrayWithObjects: SOGoCalendarRole_ComponentDAndTViewer,
SOGoCalendarRole_ComponentViewer,
SOGoCalendarRole_ComponentResponder,
SOGoCalendarRole_ComponentModifier, nil],
nil]
forKeys: [NSArray arrayWithObjects: @"Public", @"Confidential", @"Private",
@"Component", nil]];
}
max = [roles count];
expandedRoles = [NSMutableSet set];
for (i = 0; i < max; i++)
{
role = [roles objectAtIndex: i];
subRoles = nil;
if ([role hasPrefix: @"Public"])
subRoles = [rolesMap objectForKey: @"Public"];
else if ([role hasPrefix: @"Confidential"])
subRoles = [rolesMap objectForKey: @"Confidential"];
else if ([role hasPrefix: @"Private"])
subRoles = [rolesMap objectForKey: @"Private"];
else if ([role hasPrefix: @"Component"])
subRoles = [rolesMap objectForKey: @"Component"];
if (subRoles)
{
for (j = 0; j < [subRoles count]; j++)
{
subRole = [subRoles objectAtIndex: j];
[expandedRoles addObject: subRole];
if ([subRole isEqualToString: role])
break;
}
}
else
{
[expandedRoles addObject: role];
}
}
return [expandedRoles allObjects];
}
@end
+40
View File
@@ -0,0 +1,40 @@
/* MAPIStoreCalTaskMessage.h - this file is part of SOGo
*
* Copyright (C) 2016 Enrique J. Hernandez
*
* Author: Enrique J. Hernandez <ejhernandez@zentyal.com>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef MAPISTORECALTASKMESSAGE_H
#define MAPISTORECALTASKMESSAGE_H
#import "MAPIStoreGCSMessage.h"
/* This class is intended to share common logic for Calendar and Tasks
as of today they are stored in the same table. This is relevant for
permissions */
@interface MAPIStoreCalTaskMessage : MAPIStoreGCSMessage
{
}
/* Get the sensitivity (access class) from a message */
- (NSUInteger) sensitivity;
@end
#endif /* MAPISTORECALTASKMESSAGE_H */
+107
View File
@@ -0,0 +1,107 @@
/* MAPIStoreCalTaskMessage.h - this file is part of SOGo
*
* Copyright (C) 2016 Enrique J. Hernandez
*
* Author: Enrique J. Hernandez <ejhernandez@zentyal.com>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <SOGo/SOGoPermissions.h>
#import "MAPIStoreFolder.h"
#import "MAPIStoreCalTaskMessage.h"
@implementation MAPIStoreCalTaskMessage
/* It must be implemented by subclasses */
- (NSUInteger) sensitivity
{
[self subclassResponsibility: _cmd];
return 0;
}
- (NSArray *) expandRoles: (NSArray *) roles
{
return [container expandRoles: roles];
}
- (BOOL) subscriberCanModifyMessage
{
BOOL rc;
NSArray *roles;
roles = [self activeUserRoles];
if (isNew)
rc = [roles containsObject: SOGoRole_ObjectCreator];
else
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
/* Check if the message is owned and it has permission to edit it */
if (!rc && [roles containsObject: MAPIStoreRightEditOwn])
{
NSString *currentUser;
currentUser = [[container context] activeUser];
rc = [currentUser isEqual: [self ownerUser]];
}
if (!rc)
{
NSUInteger sensitivity;
/* Get sensitivity of the message to check if the user can
modify the message */
sensitivity = [self sensitivity];
/* FIXME: Use OpenChange constant names */
switch (sensitivity)
{
case 0: /* PUBLIC */
rc = [roles containsObject: SOGoCalendarRole_PublicModifier]
|| [roles containsObject: SOGoCalendarRole_PublicResponder];
break;
case 1: /* PERSONAL */
case 2: /* PRIVATE */
rc = [roles containsObject: SOGoCalendarRole_PrivateModifier]
|| [roles containsObject: SOGoCalendarRole_PrivateResponder];
break;
case 3: /* CONFIDENTIAL */
rc = [roles containsObject: SOGoCalendarRole_ConfidentialModifier]
|| [roles containsObject: SOGoCalendarRole_ConfidentialResponder];
}
}
return rc;
}
- (BOOL) subscriberCanReadMessage
{
NSArray *roles;
roles = [self activeUserRoles];
return ([roles containsObject: SOGoCalendarRole_ComponentViewer]
|| [roles containsObject: SOGoCalendarRole_ComponentDAndTViewer]
|| [self subscriberCanModifyMessage]);
}
@end
+22 -22
View File
@@ -94,64 +94,64 @@
flattenedValuesForKey: @""];
}
- (int) getPidTagAttachmentHidden: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagAttachmentHidden: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getYes: data inMemCtx: localMemCtx];
}
- (int) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = MAPILongValue (localMemCtx, 0x00000002); /* afException */
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getLongZero: data inMemCtx: localMemCtx];
}
- (int) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getLongZero: data inMemCtx: localMemCtx];
}
- (int) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = MAPILongValue (localMemCtx, afEmbeddedMessage);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachEncoding: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagAttachEncoding: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = [[NSData data] asBinaryInMemCtx: localMemCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = [@"Untitled" asUnicodeInMemCtx: localMemCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagExceptionReplaceTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagExceptionReplaceTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc;
NSCalendarDate *dateValue;
@@ -178,8 +178,8 @@
return rc;
}
- (int) getPidTagExceptionStartTime: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagExceptionStartTime: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
enum mapistore_error rc;
NSCalendarDate *dateValue;
@@ -205,8 +205,8 @@
return rc;
}
- (int) getPidTagExceptionEndTime: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
- (enum mapistore_error) getPidTagExceptionEndTime: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
enum mapistore_error rc;
NSCalendarDate *dateValue;
+22 -21
View File
@@ -89,73 +89,73 @@
*dataPtr = msgData;
}
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = talloc_strdup (memCtx, "IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}");
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMessageFlags: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageFlags: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, MSGFLAG_UNMODIFIED);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagResponseRequested: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagResponseRequested: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
/* discarded properties */
- (int) getPidLidAppointmentLastSequence: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidAppointmentLastSequence: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidMeetingWorkspaceUrl: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidMeetingWorkspaceUrl: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidContacts: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidContacts: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagSensitivity: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSensitivity: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidPrivate: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidPrivate: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidNameKeywords: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameKeywords: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidFExceptionalBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidFExceptionalBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
@@ -208,6 +208,7 @@
[[container event] updateFromMAPIProperties: properties
inUserContext: [self userContext]
withActiveUser: activeUser
isNew: NO
inMemCtx: memCtx];
}
+2 -2
View File
@@ -23,9 +23,9 @@
#ifndef MAPISTORECALENDARFOLDER_H
#define MAPISTORECALENDARFOLDER_H
#import "MAPIStoreGCSFolder.h"
#import "MAPIStoreCalTaskFolder.h"
@interface MAPIStoreCalendarFolder : MAPIStoreGCSFolder
@interface MAPIStoreCalendarFolder : MAPIStoreCalTaskFolder
@end
+33 -19
View File
@@ -81,11 +81,7 @@
Following rights are not supported by SOGo specifically:
- DeleteOwned : Delete only own objects
- EditOwned : Edit only own objects
- CreateSubfolders: No calendar subfolders
- FolderOwner: No sharing folder ownership?
- FolderContact: No support to store this information
- FolderVisible: It is inferred by other rights when extracting
*/
NSMutableArray *roles;
@@ -95,26 +91,35 @@
[roles addObject: SOGoRole_ObjectCreator];
if (rights & RightsDeleteAll)
[roles addObject: SOGoRole_ObjectEraser];
if (rights & RightsDeleteOwn)
[roles addObject: MAPIStoreRightDeleteOwn];
if (rights & RightsEditAll)
{
[roles addObject: SOGoCalendarRole_PublicModifier];
[roles addObject: SOGoCalendarRole_PrivateModifier];
[roles addObject: SOGoCalendarRole_ConfidentialModifier];
}
else if (rights & RightsReadItems)
if (rights & RightsEditOwn)
[roles addObject: MAPIStoreRightEditOwn];
if (rights & RightsReadItems)
{
[roles addObject: SOGoCalendarRole_PublicViewer];
[roles addObject: SOGoCalendarRole_PrivateViewer];
[roles addObject: SOGoCalendarRole_ConfidentialViewer];
}
if (rights & RightsFreeBusySimple)
{
[roles addObject: SOGoCalendarRole_PublicDAndTViewer];
}
[roles addObject: SOGoCalendarRole_PublicDAndTViewer];
if (rights & RightsFreeBusyDetailed)
{
[roles addObject: SOGoCalendarRole_ConfidentialDAndTViewer];
}
[roles addObject: SOGoCalendarRole_ConfidentialDAndTViewer];
if (rights & RightsFolderOwner)
[roles addObject: MAPIStoreRightFolderOwner];
if (rights & RightsFolderContact)
[roles addObject: MAPIStoreRightFolderContact];
// [self logWithFormat: @"roles for rights %.8x = (%@)", rights, roles];
@@ -136,19 +141,28 @@
else if ([roles containsObject: SOGoCalendarRole_PublicViewer]
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
// We have to set by hand other rights as only the highest role is returned
// See SOGoAppointmentFolder.m:aclsForUser for details
rights |= RightsReadItems | RightsFreeBusySimple | RightsFreeBusyDetailed;
rights |= RightsReadItems;
if ([roles containsObject: MAPIStoreRightEditOwn])
rights |= RightsEditOwn;
if ([roles containsObject: MAPIStoreRightDeleteOwn])
rights |= RightsDeleteOwn;
if ([roles containsObject: SOGoCalendarRole_PublicDAndTViewer])
rights |= RightsFreeBusySimple;
if ([roles containsObject: SOGoCalendarRole_ConfidentialDAndTViewer])
rights |= RightsFreeBusyDetailed;
rights |= RightsFreeBusySimple | RightsFreeBusyDetailed;
if ((rights & RightsReadItems) != 0 || (rights & RightsCreateItems) != 0 || (rights & RightsDeleteAll) != 0)
rights |= RoleNone; /* actually "folder visible" */
if ([roles containsObject: MAPIStoreRightFolderOwner])
rights |= RightsFolderOwner | RoleNone;
if ([roles containsObject: MAPIStoreRightFolderContact])
rights |= RightsFolderContact;
// [self logWithFormat: @"rights for roles (%@) = %.8x", roles, rights];
return rights;
@@ -193,16 +207,16 @@
[(SOGoAppointmentFolder *) sogoObject aclSQLListingFilter]];
}
- (int) getPidTagContainerClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagContainerClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPF.Appointment" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Appointment" asUnicodeInMemCtx: memCtx];
+2 -2
View File
@@ -23,13 +23,13 @@
#ifndef MAPISTORECALENDARMESSAGE_H
#define MAPISTORECALENDARMESSAGE_H
#import "MAPIStoreGCSMessage.h"
#import "MAPIStoreCalTaskMessage.h"
@class iCalCalendar;
@class iCalEvent;
@class MAPIStoreAppointmentWrapper;
@interface MAPIStoreCalendarMessage : MAPIStoreGCSMessage
@interface MAPIStoreCalendarMessage : MAPIStoreCalTaskMessage
{
iCalCalendar *calendar;
iCalEvent *masterEvent;
+22 -31
View File
@@ -228,8 +228,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
/* getters */
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
SOGoUser *owner;
@@ -242,8 +242,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
return MAPISTORE_SUCCESS;
}
- (int) getPidLidSideEffects: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSideEffects: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx,
seOpenToDelete | seOpenToCopy | seOpenToMove
@@ -252,7 +252,7 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
return MAPISTORE_SUCCESS;
}
- (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
@@ -347,8 +347,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
*dataPtr = msgData;
}
- (int) getPidTagResponseRequested: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagResponseRequested: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
@@ -358,8 +358,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
MAPIStoreMessage base class, then the proxy method is not reached
(see MAPIStoreObject).
*/
- (int) getPidTagNormalizedSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
@@ -370,8 +370,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
@@ -382,8 +382,8 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
@@ -528,29 +528,19 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
ASSIGN (sogoObject, newObject);
}
- (BOOL) subscriberCanReadMessage
- (NSUInteger) sensitivity
{
NSArray *roles;
roles = [self activeUserRoles];
return ([roles containsObject: SOGoCalendarRole_ComponentViewer]
|| [roles containsObject: SOGoCalendarRole_ComponentDAndTViewer]
|| [self subscriberCanModifyMessage]);
return [[self _appointmentWrapper] sensitivity];
}
- (BOOL) subscriberCanModifyMessage
- (NSString *) creator
{
BOOL rc;
NSArray *roles = [self activeUserRoles];
return [[self _appointmentWrapper] creator];
}
if (isNew)
rc = [roles containsObject: SOGoRole_ObjectCreator];
else
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
return rc;
- (NSString *) owner
{
return [[self _appointmentWrapper] owner];
}
- (void) _updateAttachedEvents
@@ -632,6 +622,7 @@ static Class NSArrayK, MAPIStoreAppointmentWrapperK;
[masterEvent updateFromMAPIProperties: properties
inUserContext: [self userContext]
withActiveUser: activeUser
isNew: isNew
inMemCtx: memCtx];
[self _updateAttachedEvents];
[[self userContext] activate];
+24 -24
View File
@@ -92,52 +92,52 @@
return [container lastModificationTime];
}
- (int) getPidTagAttachEncoding: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagAttachEncoding: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
{
*data = [[NSData data] asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagAttachmentHidden: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachmentHidden: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00000001);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagAttachDataBinary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachDataBinary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!photoData)
ASSIGN (photoData,
@@ -148,8 +148,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachSize: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachSize: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!photoData)
ASSIGN (photoData,
@@ -160,16 +160,16 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachExtension: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachExtension: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self fileExtension] asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachLongFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachLongFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *filename;
@@ -181,15 +181,15 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagAttachLongFilename: data
inMemCtx: memCtx];
}
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagAttachLongFilename: data inMemCtx: memCtx];
}
+32 -3
View File
@@ -74,18 +74,34 @@
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
{
/* Limitations
Following rights are not supported by SOGo specifically:
- CreateSubfolders: No contacts subfolders
- FolderVisible: It is inferred by other rights when extracting
*/
NSMutableArray *roles;
roles = [NSMutableArray arrayWithCapacity: 6];
roles = [NSMutableArray arrayWithCapacity: 8];
if (rights & RightsCreateItems)
[roles addObject: SOGoRole_ObjectCreator];
if (rights & RightsDeleteAll)
[roles addObject: SOGoRole_ObjectEraser];
if (rights & RightsDeleteOwn)
[roles addObject: MAPIStoreRightDeleteOwn];
if (rights & RightsEditAll)
[roles addObject: SOGoRole_ObjectEditor];
if (rights & RightsEditOwn)
[roles addObject: MAPIStoreRightEditOwn];
if (rights & RightsReadItems)
[roles addObject: SOGoRole_ObjectViewer];
if (rights & RightsFolderOwner)
[roles addObject: MAPIStoreRightFolderOwner];
if (rights & RightsFolderContact)
[roles addObject: MAPIStoreRightFolderContact];
return roles;
}
@@ -95,15 +111,28 @@
if ([roles containsObject: SOGoRole_ObjectCreator])
rights |= RightsCreateItems;
if ([roles containsObject: SOGoRole_ObjectEraser])
rights |= RightsDeleteAll | RightsDeleteOwn;
else if ([roles containsObject: MAPIStoreRightDeleteOwn])
rights |= RightsDeleteOwn;
if ([roles containsObject: SOGoRole_ObjectEditor])
rights |= RightsEditAll | RightsEditOwn;
else if ([roles containsObject: MAPIStoreRightEditOwn])
rights |= RightsEditOwn;
if ([roles containsObject: SOGoRole_ObjectViewer])
rights |= RightsReadItems;
if (rights != 0)
rights |= RoleNone; /* actually "folder visible" */
if ([roles containsObject: MAPIStoreRightFolderOwner])
rights |= RightsFolderOwner | RoleNone;
if ([roles containsObject: MAPIStoreRightFolderContact])
rights |= RightsFolderContact;
return rights;
}
@@ -117,8 +146,8 @@
return [[self activeUserRoles] containsObject: SOGoRole_ObjectViewer];
}
- (int) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Contact" asUnicodeInMemCtx: memCtx];
+231 -207
View File
@@ -31,9 +31,11 @@
#import <NGCards/NGVCardPhoto.h>
#import <NGCards/NSArray+NGCards.h>
#import <NGCards/NSString+NGCards.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <Contacts/SOGoContactGCSEntry.h>
#import <Mailer/NSString+Mail.h>
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserManager.h>
#import "MAPIStoreAttachment.h"
@@ -104,8 +106,8 @@
return element;
}
- (int) getPidTagIconIndex: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagIconIndex: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
*data = MAPILongValue (memCtx, 0x00000200);
@@ -113,52 +115,52 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAlternateRecipientAllowed: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAlternateRecipientAllowed: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagMessageFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, MSGFLAG_READ);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDeleteAfterSubmit: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDeleteAfterSubmit: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = talloc_strdup (memCtx, "IPM.Contact");
return MAPISTORE_SUCCESS;
}
- (int) getPidTagSendInternetEncoding: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSendInternetEncoding: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00065001);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagNormalizedSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagDisplayName: data inMemCtx: memCtx];
}
- (int) getPidLidFileUnder: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidFileUnder: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *surName, *givenName, *middleName;
NSMutableString *fileUnder;
@@ -184,22 +186,22 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidLidFileUnderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidFileUnderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00008017); /* what ol2003 sets */
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAccount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAccount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidEmail1EmailAddress: data inMemCtx: memCtx];
}
- (int) getPidTagContactEmailAddresses: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagContactEmailAddresses: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -212,8 +214,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagEmsAbTargetAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagEmsAbTargetAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -224,8 +226,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagSearchKey: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSearchKey: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -236,16 +238,16 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMailPermission: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMailPermission: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSString *stringValue;
stringValue = [[sogoObject vCard] note];
@@ -257,8 +259,8 @@
return rc;
}
- (int) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
@@ -267,8 +269,8 @@
// Contact Name Properties [MS-OXOCNTC 2.2.1.1]
// ---------------------------------------------------------
- (int) getPidTagNickname: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagNickname: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -278,8 +280,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagGeneration: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagGeneration: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -291,8 +293,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagSurname: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSurname: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -304,8 +306,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMiddleName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMiddleName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -317,8 +319,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagGivenName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagGivenName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -330,8 +332,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDisplayNamePrefix: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayNamePrefix: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -398,9 +400,9 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
Store on *data the given email (position)
It can return MAPISTORE_ERR_NOT_FOUND if the email doesn't exist
*/
- (int) _getPidLidEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
atPosition: (NSUInteger) position
- (enum mapistore_error) _getPidLidEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
atPosition: (NSUInteger) position
{
NSString *email;
@@ -412,60 +414,60 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return MAPISTORE_SUCCESS;
}
- (int) getPidLidEmail1EmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail1EmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailAddress: data inMemCtx: memCtx atPosition: 1];
}
- (int) getPidLidEmail2EmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail2EmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailAddress: data inMemCtx: memCtx atPosition: 2];
}
- (int) getPidLidEmail3EmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail3EmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailAddress: data inMemCtx: memCtx atPosition: 3];
}
- (int) getPidLidEmail1OriginalDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail1OriginalDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidEmail1EmailAddress: data inMemCtx: memCtx];
}
- (int) getPidLidEmail2OriginalDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail2OriginalDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidEmail2EmailAddress: data inMemCtx: memCtx];
}
- (int) getPidLidEmail3OriginalDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail3OriginalDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidEmail3EmailAddress: data inMemCtx: memCtx];
}
- (int) getPidLidEmail1AddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail1AddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (![self _fetchEmailAddress: 1]) return MAPISTORE_ERR_NOT_FOUND;
return [self getSMTPAddrType: data inMemCtx: memCtx];
}
- (int) getPidLidEmail2AddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail2AddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (![self _fetchEmailAddress: 2]) return MAPISTORE_ERR_NOT_FOUND;
return [self getSMTPAddrType: data inMemCtx: memCtx];
}
- (int) getPidLidEmail3AddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail3AddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (![self _fetchEmailAddress: 3]) return MAPISTORE_ERR_NOT_FOUND;
@@ -476,9 +478,9 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
Store on *data a string with the display name for the given email (position)
It can return MAPISTORE_ERR_NOT_FOUND if the email doesn't exist
*/
- (int) _getPidLidEmailDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
atPosition: (NSUInteger) position
- (enum mapistore_error) _getPidLidEmailDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
atPosition: (NSUInteger) position
{
NGVCard *vCard;
NSString *fn, *email;
@@ -495,20 +497,20 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return MAPISTORE_SUCCESS;
}
- (int) getPidLidEmail1DisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail1DisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailDisplayName: data inMemCtx: memCtx atPosition: 1];
}
- (int) getPidLidEmail2DisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail2DisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailDisplayName: data inMemCtx: memCtx atPosition: 2];
}
- (int) getPidLidEmail3DisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail3DisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailDisplayName: data inMemCtx: memCtx atPosition: 3];
}
@@ -544,9 +546,9 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
Store on *data an entryId for the given email (position)
It can return MAPISTORE_ERR_NOT_FOUND if the email doesn't exist
*/
- (int) _getPidLidEmailOriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
atPosition: (NSUInteger) position
- (enum mapistore_error) _getPidLidEmailOriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
atPosition: (NSUInteger) position
{
NSData *value;
@@ -558,36 +560,36 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return MAPISTORE_SUCCESS;
}
- (int) getPidLidEmail1OriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail1OriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailOriginalEntryId: data
inMemCtx: memCtx
atPosition: 1];
}
- (int) getPidLidEmail2OriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail2OriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailOriginalEntryId: data
inMemCtx: memCtx
atPosition: 2];
}
- (int) getPidLidEmail3OriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidEmail3OriginalEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getPidLidEmailOriginalEntryId: data
inMemCtx: memCtx
atPosition: 3];
}
- (int) _getElement: (NSString *) elementTag
ofType: (NSString *) aType
excluding: (NSString *) aTypeToExclude
atPos: (NSUInteger) pos
inData: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) _getElement: (NSString *) elementTag
ofType: (NSString *) aType
excluding: (NSString *) aTypeToExclude
atPos: (NSUInteger) pos
inData: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSArray *elements;
CardElement *ce;
@@ -611,15 +613,15 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
}
if (!stringValue)
stringValue = @"";
return MAPISTORE_ERR_NOT_FOUND;
*data = [stringValue asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagBusinessFaxNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagBusinessFaxNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"tel" ofType: @"fax" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
@@ -656,30 +658,39 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return list;
}
- (int) getPidLidAddressBookProviderArrayType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidAddressBookProviderArrayType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
// [MS-OXOCNTC] 2.2.1.2.12
// https://msdn.microsoft.com/en-us/library/ee218011%28v=exchg.80%29.aspx
uint32_t value = 0;
NSArray *emailList = [self _buildAddressBookProviderEmailList];
for (NSNumber *maskValue in emailList)
value |= 1 << [maskValue intValue];
if ([emailList count] > 0)
{
for (NSNumber *maskValue in emailList)
value |= 1 << [maskValue intValue];
*data = MAPILongValue (memCtx, value);
*data = MAPILongValue (memCtx, value);
return MAPISTORE_SUCCESS;
return MAPISTORE_SUCCESS;
}
else
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidAddressBookProviderEmailList: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidAddressBookProviderEmailList: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSArray *emailList = [self _buildAddressBookProviderEmailList];
*data = [emailList asMVLongInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
if ([emailList count] > 0)
{
*data = [emailList asMVLongInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
else
return MAPISTORE_ERR_NOT_FOUND;
}
// ---------------------------------------------------------
@@ -688,49 +699,49 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
// Home Address
- (int) getPidTagHomeAddressStreet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHomeAddressStreet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"home" excluding: nil
atPos: 2 inData: data inMemCtx: memCtx];
}
- (int) getPidTagHomeAddressCity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHomeAddressCity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"home" excluding: nil
atPos: 3 inData: data inMemCtx: memCtx];
}
- (int) getPidTagHomeAddressStateOrProvince: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHomeAddressStateOrProvince: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"home" excluding: nil
atPos: 4 inData: data inMemCtx: memCtx];
}
- (int) getPidTagHomeAddressPostalCode: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHomeAddressPostalCode: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"home" excluding: nil
atPos: 5 inData: data inMemCtx: memCtx];
}
- (int) getPidTagHomeAddressCountry: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHomeAddressCountry: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"home" excluding: nil
atPos: 6 inData: data inMemCtx: memCtx];
}
- (int) getPidTagHomeAddressPostOfficeBox: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHomeAddressPostOfficeBox: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"home" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidLidHomeAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidHomeAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"label" ofType: @"home" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
@@ -738,50 +749,50 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
// Work Address
- (int) getPidLidWorkAddressStreet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidWorkAddressStreet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"work" excluding: nil
atPos: 2 inData: data inMemCtx: memCtx];
}
- (int) getPidLidWorkAddressCity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidWorkAddressCity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"work" excluding: nil
atPos: 3 inData: data inMemCtx: memCtx];
}
- (int) getPidLidWorkAddressState: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidWorkAddressState: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"work" excluding: nil
atPos: 4 inData: data inMemCtx: memCtx];
}
- (int) getPidLidWorkAddressPostalCode: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidWorkAddressPostalCode: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"work" excluding: nil
atPos: 5 inData: data inMemCtx: memCtx];
}
- (int) getPidLidWorkAddressCountry: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidWorkAddressCountry: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"work" excluding: nil
atPos: 6 inData: data inMemCtx: memCtx];
}
- (int) getPidLidWorkAddressPostOfficeBox: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidWorkAddressPostOfficeBox: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"work" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidLidWorkAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidWorkAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"label" ofType: @"work" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
@@ -789,57 +800,57 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
// Mailing Address
- (int) getPidTagStreetAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagStreetAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
atPos: 2 inData: data inMemCtx: memCtx];
}
- (int) getPidTagLocality: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagLocality: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
atPos: 3 inData: data inMemCtx: memCtx];
}
- (int) getPidTagStateOrProvince: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagStateOrProvince: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
atPos: 4 inData: data inMemCtx: memCtx];
}
- (int) getPidTagPostalCode: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPostalCode: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
atPos: 5 inData: data inMemCtx: memCtx];
}
- (int) getPidTagCountry: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagCountry: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
atPos: 6 inData: data inMemCtx: memCtx];
}
- (int) getPidTagPostOfficeBox: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPostOfficeBox: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"adr" ofType: @"pref" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidTagPostalAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPostalAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"label" ofType: @"pref" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidLidPostalAddressId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidPostalAddressId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSArray *elements;
CardElement *element;
@@ -869,36 +880,36 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
// Telephone Properties [MS-OXOCNTC 2.2.1.4]
// -------------------------------------------------------
- (int) getPidTagPagerTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPagerTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"tel" ofType: @"pager" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidTagBusinessTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagBusinessTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"tel" ofType: @"work" excluding: @"fax"
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidTagHomeTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHomeTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"tel" ofType: @"home" excluding: @"fax"
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidTagPrimaryTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPrimaryTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"tel" ofType: @"pref" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidTagMobileTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMobileTelephoneNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"tel" ofType: @"cell" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
@@ -908,12 +919,12 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
// Event Properties [MS-OXOCNTC 2.2.1.5]
// ---------------------------------------------------------
- (int) getPidTagBirthday: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagBirthday: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSCalendarDate *dateValue;
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[sogoObject vCard] bday];
if ([stringValue length] != 0)
@@ -929,12 +940,12 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return rc;
}
- (int) getPidTagWeddingAnniversary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagWeddingAnniversary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSCalendarDate *dateValue;
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-anniversary"]
flattenedValuesForKey: @""];
@@ -954,8 +965,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
// Professional Properties [MS-OXOCNTC 2.2.1.6]
// ---------------------------------------------------------
- (int) getPidTagTitle: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagTitle: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -965,8 +976,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return MAPISTORE_SUCCESS;
}
- (int) getPidTagCompanyName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagCompanyName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
CardElement *org;
@@ -977,8 +988,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDepartmentName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDepartmentName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
CardElement *org;
@@ -989,11 +1000,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return MAPISTORE_SUCCESS;
}
- (int) getPidTagOfficeLocation: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagOfficeLocation: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-office"]
flattenedValuesForKey: @""];
@@ -1005,11 +1016,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return rc;
}
- (int) getPidTagManagerName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagManagerName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-manager"]
flattenedValuesForKey: @""];
@@ -1021,11 +1032,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return rc;
}
- (int) getPidTagAssistant: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAssistant: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-assistant"]
flattenedValuesForKey: @""];
@@ -1037,11 +1048,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return rc;
}
- (int) getPidTagProfession: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagProfession: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[sogoObject vCard] role];
if (stringValue)
@@ -1080,8 +1091,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
fetchedAttachments = YES;
}
- (int) getPidLidHasPicture: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidHasPicture: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!fetchedAttachments)
[self _fetchAttachmentParts];
@@ -1154,11 +1165,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
// Other Properties [MS-OXOCNTC 2.2.1.10]
// ---------------------------------------------------------
- (int) getPidTagSpouseName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSpouseName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-spouse"]
flattenedValuesForKey: @""];
@@ -1170,8 +1181,8 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return rc;
}
- (int) getPidLidInstantMessagingAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidInstantMessagingAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -1184,11 +1195,11 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return MAPISTORE_SUCCESS;
}
- (int) getPidLidFreeBusyLocation: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidFreeBusyLocation: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"fburl"]
flattenedValuesForKey: @""];
@@ -1200,38 +1211,43 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
return rc;
}
- (int) getPidTagPersonalHomePage: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPersonalHomePage: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"url" ofType: @"home" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
- (int) getPidTagBusinessHomePage: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagBusinessHomePage: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getElement: @"url" ofType: @"work" excluding: nil
atPos: 0 inData: data inMemCtx: memCtx];
}
// ---------------------------------------------------------
// Permissions
// ---------------------------------------------------------
- (NSString *) creator
{
return [[[sogoObject vCard] uniqueChildWithTag: @"x-openchange-creator"]
flattenedValuesForKey: @""];
}
- (NSString *) owner
{
return [self creator];
}
- (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]));
}
// ---------------------------------------------------------
// Save
// ---------------------------------------------------------
- (void) saveDistList:(TALLOC_CTX *) memCtx
{
[self warnWithFormat: @"IPM.DistList messages are ignored"];
@@ -1575,6 +1591,14 @@ enum { // [MS-OXOCNTC] 2.2.1.2.11
if (value)
[newCard setNote: value];
/* Store the creator name for sharing purposes */
if (isNew)
{
value = [[[self context] activeUser] login];
[[newCard uniqueChildWithTag: @"x-openchange-creator"]
setSingleValue: value forKey: @""];
}
//
// we save the new/modified card
//
+9 -9
View File
@@ -72,10 +72,10 @@
forUser: (NSString *) username
withRole: (enum mapistore_context_role) role;
+ (int) openContext: (MAPIStoreContext **) contextPtr
withURI: (const char *) newUri
connectionInfo: (struct mapistore_connection_info *) newConnInfo
andTDBIndexing: (struct indexing_context *) indexing;
+ (enum mapistore_error) openContext: (MAPIStoreContext **) contextPtr
withURI: (const char *) newUri
connectionInfo: (struct mapistore_connection_info *) newConnInfo
andTDBIndexing: (struct indexing_context *) indexing;
- (id) initFromURL: (NSURL *) newUri
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
@@ -91,11 +91,11 @@
// - (id) lookupObject: (NSString *) objectURLString;
/* backend methods */
- (int) getPath: (char **) path
ofFMID: (uint64_t) fmid
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getRootFolder: (MAPIStoreFolder **) folderPtr
withFID: (uint64_t) fmid;
- (enum mapistore_error) getPath: (char **) path
ofFMID: (uint64_t) fmid
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getRootFolder: (MAPIStoreFolder **) folderPtr
withFID: (uint64_t) fmid;
/* util methods */
- (NSString *) extractChildNameFromURL: (NSString *) childURL
+68 -35
View File
@@ -212,16 +212,16 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
return completeURL;
}
+ (int) openContext: (MAPIStoreContext **) contextPtr
withURI: (const char *) newUri
connectionInfo: (struct mapistore_connection_info *) newConnInfo
andTDBIndexing: (struct indexing_context *) indexing
+ (enum mapistore_error) openContext: (MAPIStoreContext **) contextPtr
withURI: (const char *) newUri
connectionInfo: (struct mapistore_connection_info *) newConnInfo
andTDBIndexing: (struct indexing_context *) indexing
{
MAPIStoreContext *context;
Class contextClass;
NSString *module;
NSURL *baseURL;
int rc = MAPISTORE_ERR_NOT_FOUND;
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
context = nil;
@@ -338,11 +338,11 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
return activeUser;
}
- (int) getPath: (char **) path
ofFMID: (uint64_t) fmid
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPath: (char **) path
ofFMID: (uint64_t) fmid
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
NSString *objectURL, *url;
url = [contextUrl absoluteString];
@@ -379,8 +379,8 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
{
}
- (int) getRootFolder: (MAPIStoreFolder **) folderPtr
withFID: (uint64_t) newFid
- (enum mapistore_error) getRootFolder: (MAPIStoreFolder **) folderPtr
withFID: (uint64_t) newFid
{
enum mapistore_error rc;
MAPIStoreFolder *baseFolder;
@@ -438,8 +438,16 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
mapiStoreObjectWithSOGoObject: currentFolder
inContainer: nil];
[baseFolder setContext: self];
*folderPtr = baseFolder;
rc = MAPISTORE_SUCCESS;
if ([[userContext sogoUser] isEqual: activeUser]
|| [baseFolder subscriberCanReadMessages])
{
*folderPtr = baseFolder;
rc = MAPISTORE_SUCCESS;
}
else
rc = MAPISTORE_ERR_DENIED;
}
else if ([[userContext sogoUser] isEqual: activeUser])
rc = MAPISTORE_ERR_NOT_FOUND;
@@ -494,8 +502,11 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
mappingId = [mapping idFromURL: childURL];
if (mappingId == NSNotFound)
{
const char *owner;
[self logWithFormat: @"No id exist yet for '%@', requesting one", childURL];
ret = mapistore_indexing_get_new_folderID (connInfo->mstore_ctx, &mappingId);
owner = [[userContext username] UTF8String];
ret = mapistore_indexing_get_new_folderID_as_user (connInfo->mstore_ctx, owner, &mappingId);
if (ret == MAPISTORE_SUCCESS)
[mapping registerURL: childURL withID: mappingId];
else
@@ -506,36 +517,56 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
return mappingId;
}
/* Get new change number from openchange db interface using
resource's owner user */
- (uint64_t) getNewChangeNumber
{
const char *owner;
enum MAPISTATUS retval;
uint64_t newVersionNumber;
if (openchangedb_get_new_changeNumber (connInfo->oc_ctx, connInfo->username, &newVersionNumber)
!= MAPI_E_SUCCESS)
abort ();
owner = [[userContext username] UTF8String];
retval = openchangedb_get_new_changeNumber (connInfo->oc_ctx, owner, &newVersionNumber);
if (retval != MAPI_E_SUCCESS)
[NSException raise: @"MAPIStoreIOException"
format: @"Impossible to get new change number for %s: %s", owner,
mapi_get_errstr (retval)];
return newVersionNumber;
}
/* Get new change numbers from openchange db interface using
resource's owner user */
- (NSArray *) getNewChangeNumbers: (uint64_t) max
{
const char *owner;
enum MAPISTATUS retval;
TALLOC_CTX *memCtx;
NSMutableArray *newChangeNumbers;
uint64_t count;
struct UI8Array_r *numbers;
NSString *newNumber;
memCtx = talloc_zero(NULL, TALLOC_CTX);
memCtx = talloc_new (NULL);
if (!memCtx)
[NSException raise: @"MAPIStoreIOException"
format: @"Not enough memory to allocate change numbers"];
newChangeNumbers = [NSMutableArray arrayWithCapacity: max];
owner = [[userContext username] UTF8String];
retval = openchangedb_get_new_changeNumbers (connInfo->oc_ctx, memCtx, owner, max, &numbers);
if (retval != MAPI_E_SUCCESS || numbers->cValues != max)
{
talloc_free (memCtx);
[NSException raise: @"MAPIStoreIOException"
format: @"Failing to get %d new change numbers: %s", max,
mapi_get_errstr (retval)];
}
if (openchangedb_get_new_changeNumbers (connInfo->oc_ctx,
memCtx, connInfo->username, max, &numbers)
!= MAPI_E_SUCCESS || numbers->cValues != max)
abort ();
for (count = 0; count < max; count++)
{
newNumber
= [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
newNumber = [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
[newChangeNumbers addObject: newNumber];
}
@@ -544,29 +575,31 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
return newChangeNumbers;
}
/* Get new fmids from mapistore_indexing interface using resource's
owner user */
- (NSArray *) getNewFMIDs: (uint64_t) max
{
TALLOC_CTX *memCtx;
const char *owner;
enum mapistore_error ret;
NSMutableArray *newFMIDs;
uint64_t count;
struct UI8Array_r *numbers;
NSString *newNumber;
uint64_t count, newFID;
memCtx = talloc_zero(NULL, TALLOC_CTX);
newFMIDs = [NSMutableArray arrayWithCapacity: max];
/* Get the resource's owner name */
owner = [[userContext username] UTF8String];
if (mapistore_indexing_get_new_folderIDs (connInfo->mstore_ctx,
memCtx, max, &numbers)
!= MAPISTORE_SUCCESS || numbers->cValues != max)
abort ();
for (count = 0; count < max; count++)
{
newNumber = [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
ret = mapistore_indexing_get_new_folderID_as_user (connInfo->mstore_ctx, owner, &newFID);
if (ret != MAPISTORE_SUCCESS)
[NSException raise: @"MAPIStoreIOException"
format: @"Impossible to get new fmid for %s", owner];
newNumber = [NSString stringWithUnsignedLongLong: newFID];
[newFMIDs addObject: newNumber];
}
talloc_free (memCtx);
return newFMIDs;
}
+10
View File
@@ -25,6 +25,16 @@
#import "MAPIStoreFolder.h"
extern NSString *MAPIStoreRightReadItems;
extern NSString *MAPIStoreRightCreateItems;
extern NSString *MAPIStoreRightEditOwn;
extern NSString *MAPIStoreRightEditAll;
extern NSString *MAPIStoreRightDeleteOwn;
extern NSString *MAPIStoreRightDeleteAll;
extern NSString *MAPIStoreRightCreateSubfolders;
extern NSString *MAPIStoreRightFolderOwner;
extern NSString *MAPIStoreRightFolderContact;
@interface MAPIStoreDBFolder : MAPIStoreFolder
@end
+2 -14
View File
@@ -51,16 +51,6 @@
static Class EOKeyValueQualifierK, SOGoCacheGCSFolderK, MAPIStoreDBFolderK;
static NSString *MAPIStoreRightReadItems = @"RightsReadItems";
static NSString *MAPIStoreRightCreateItems = @"RightsCreateItems";
static NSString *MAPIStoreRightEditOwn = @"RightsEditOwn";
static NSString *MAPIStoreRightEditAll = @"RightsEditAll";
static NSString *MAPIStoreRightDeleteOwn = @"RightsDeleteOwn";
static NSString *MAPIStoreRightDeleteAll = @"RightsDeleteAll";
static NSString *MAPIStoreRightCreateSubfolders = @"RightsCreateSubfolders";
static NSString *MAPIStoreRightFolderOwner = @"RightsFolderOwner";
static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
@implementation MAPIStoreDBFolder
+ (void) initialize
@@ -355,8 +345,7 @@ static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
- (BOOL) subscriberCanModifyMessages
{
return ([self _testRoleForActiveUser: MAPIStoreRightEditAll]
|| [self _testRoleForActiveUser: MAPIStoreRightEditOwn]);
return [self _testRoleForActiveUser: MAPIStoreRightEditAll];
}
- (BOOL) subscriberCanReadMessages
@@ -377,8 +366,7 @@ static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
- (BOOL) subscriberCanDeleteMessages
{
return ([self _testRoleForActiveUser: MAPIStoreRightDeleteAll]
|| [self _testRoleForActiveUser: MAPIStoreRightDeleteOwn]);
return [self _testRoleForActiveUser: MAPIStoreRightDeleteAll];
}
- (BOOL) subscriberCanCreateSubFolders
+86 -16
View File
@@ -27,6 +27,9 @@
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <SOGo/SOGoFolder.h>
#import <SOGo/SOGoUser.h>
#import "MAPIStoreContext.h"
#import "MAPIStorePropertySelectors.h"
@@ -282,7 +285,7 @@
// We might get there if for some reasons, all classes weren't able
// to tell us the message class.
//
- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
@@ -291,10 +294,10 @@
return MAPISTORE_SUCCESS;
}
- (int) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) memCtx
{
[sogoObject reloadIfNeeded];
@@ -304,12 +307,12 @@
inMemCtx: memCtx];
}
- (int) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
{
id value;
int rc;
enum mapistore_error rc;
value = [properties objectForKey: MAPIPropertyKey (propTag)];
if (value)
@@ -346,6 +349,16 @@
/* Update PredecessorChangeList accordingly */
[self _updatePredecessorChangeList];
if (isNew)
{
NSString *lastModifierName;
lastModifierName = (NSString *)[properties objectForKey: MAPIPropertyKey (PidTagLastModifierName)];
if ([lastModifierName length] > 0)
[properties setObject: lastModifierName
forKey: MAPIPropertyKey (PidTagCreatorName)];
}
// [self logWithFormat: @"Saving %@", [self description]];
// [self logWithFormat: @"%d props in dict", [properties count]];
@@ -364,20 +377,77 @@
return [msgClass isEqualToString: @"IPM.Microsoft.ScheduleData.FreeBusy"];
}
/* TODO: differentiate between the "Own" and "All" cases */
//-----------------------------
// Permissions
//-----------------------------
- (BOOL) subscriberCanReadMessage
{
return [(MAPIStoreFolder *) container subscriberCanReadMessages];
// || [self _messageIsFreeBusy]);
}
- (SOGoUser *) _ownerUser
{
NSString *ownerName;
SOGoUser *ownerUser = nil;
ownerName = [properties objectForKey: MAPIPropertyKey (PidTagCreatorName)];
if ([ownerName length] > 0)
ownerUser = [SOGoUser userWithLogin: ownerName];
return ownerUser;
}
- (NSArray *) activeUserRoles
{
/* Override because of this exception: NSInvalidArgumentException,
reason: [SOGoMAPIDBMessage-aclsForUser:] should be overridden by
subclass */
if (!activeUserRoles)
{
SOGoUser *activeUser;
activeUser = [[self context] activeUser];
activeUserRoles = [[container aclFolder] aclsForUser: [activeUser login]];
[activeUserRoles retain];
}
return activeUserRoles;
}
- (BOOL) subscriberCanModifyMessage
{
return ((isNew
&& [(MAPIStoreFolder *) container subscriberCanCreateMessages])
|| (!isNew
&& [(MAPIStoreFolder *) container subscriberCanModifyMessages]));
// || [self _messageIsFreeBusy]);
BOOL rc;
NSArray *roles;
roles = [self activeUserRoles];
if (isNew)
rc = [(MAPIStoreFolder *) container subscriberCanCreateMessages];
else
rc = [roles containsObject: MAPIStoreRightEditAll];
/* Check if the message is owned and it has permission to edit it */
if (!rc && [roles containsObject: MAPIStoreRightEditOwn])
rc = [[[container context] activeUser] isEqual: [self _ownerUser]];
return rc;
}
- (BOOL) subscriberCanDeleteMessage
{
BOOL rc;
NSArray *roles;
roles = [self activeUserRoles];
rc = [roles containsObject: MAPIStoreRightDeleteAll];
/* Check if the message is owned and it has permission to delete it */
if (!rc && [roles containsObject: MAPIStoreRightDeleteOwn])
rc = [[[container context] activeUser] isEqual: [self _ownerUser]];
return rc;
}
- (NSDate *) creationTime
+26 -26
View File
@@ -56,81 +56,81 @@ static Class MAPIStoreAttachmentK;
idForObjectWithKey: objectKey];
}
- (int) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
/* disabled properties */
- (int) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagChangeNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagChangeNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagInstID: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagInstID: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagInstanceNum: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagInstanceNum: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagRowType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagRowType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagDepth: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDepth: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagOriginalMessageClass: (void **) dataa
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagOriginalMessageClass: (void **) dataa
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
+4 -3
View File
@@ -24,6 +24,7 @@
#import "MAPIStoreActiveTables.h"
#import "MAPIStoreContext.h"
#import "MAPIStoreFolder.h"
#import "MAPIStoreUserContext.h"
#import "NSObject+MAPIStore.h"
@@ -45,8 +46,8 @@
andType: MAPISTORE_FAI_TABLE];
}
- (int) getPidTagAssociated: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAssociated: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
@@ -69,7 +70,7 @@
- (BOOL) subscriberCanReadMessage
{
return NO;
return [(MAPIStoreFolder *)container subscriberCanReadMessages];
}
- (BOOL) subscriberCanModifyMessage
+54 -37
View File
@@ -22,6 +22,7 @@
#define MAPISTOREFOLDER_H
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
@class NSArray;
@class NSMutableArray;
@@ -41,6 +42,20 @@
#import "MAPIStoreSOGoObject.h"
/* MAPI Permissions
This set has only sogo-openchange library scope
*/
extern NSString *MAPIStoreRightReadItems;
extern NSString *MAPIStoreRightCreateItems;
extern NSString *MAPIStoreRightEditOwn;
extern NSString *MAPIStoreRightEditAll;
extern NSString *MAPIStoreRightDeleteOwn;
extern NSString *MAPIStoreRightDeleteAll;
extern NSString *MAPIStoreRightCreateSubfolders;
extern NSString *MAPIStoreRightFolderOwner;
extern NSString *MAPIStoreRightFolderContact;
@interface MAPIStoreFolder : MAPIStoreSOGoObject
{
MAPIStoreContext *context;
@@ -74,6 +89,8 @@
- (MAPIStorePermissionsTable *) permissionsTable;
- (NSArray *) permissionEntries;
- (NSArray *) expandRoles: (NSArray *) roles;
/* message objects and tables */
- (id) lookupMessage: (NSString *) messageKey;
- (NSArray *) messageKeys;
@@ -96,34 +113,34 @@
/* backend interface */
- (int) openFolder: (MAPIStoreFolder **) childFolderPtr
withFID: (uint64_t) fid;
- (int) createFolder: (MAPIStoreFolder **) childFolderPtr
withRow: (struct SRow *) aRow
andFID: (uint64_t) fid;
- (int) deleteFolder;
- (int) getChildCount: (uint32_t *) rowCount
ofTableType: (enum mapistore_table_type) tableType;
- (enum mapistore_error) openFolder: (MAPIStoreFolder **) childFolderPtr
withFID: (uint64_t) fid;
- (enum mapistore_error) createFolder: (MAPIStoreFolder **) childFolderPtr
withRow: (struct SRow *) aRow
andFID: (uint64_t) fid;
- (enum mapistore_error) deleteFolder;
- (enum mapistore_error) getChildCount: (uint32_t *) rowCount
ofTableType: (enum mapistore_table_type) tableType;
- (int) createMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
isAssociated: (BOOL) isAssociated;
- (enum mapistore_error) createMessage: (MAPIStoreMessage **) messagePtr
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;
- (enum mapistore_error) openMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
forWriting: (BOOL) readWrite
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) deleteMessageWithMID: (uint64_t) mid
andFlags: (uint8_t) flags;
- (int) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
andCount: (uint32_t) count
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
wantCopy: (uint8_t) want_copy
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
andCount: (uint32_t) count
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
wantCopy: (uint8_t) want_copy
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) moveCopyToFolder: (MAPIStoreFolder *) targetFolder
withNewName: (NSString *) newFolderName
@@ -131,20 +148,20 @@
isRecursive: (BOOL) isRecursive
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
andCN: (uint64_t *) cnPtr
fromChangeNumber: (uint64_t) changeNum
inTableType: (enum mapistore_table_type) tableType
inMemCtx: (TALLOC_CTX *) mem_ctx;
- (enum mapistore_error) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
andCN: (uint64_t *) cnPtr
fromChangeNumber: (uint64_t) changeNum
inTableType: (enum mapistore_table_type) tableType
inMemCtx: (TALLOC_CTX *) mem_ctx;
- (int) getTable: (MAPIStoreTable **) tablePtr
andRowCount: (uint32_t *) count
tableType: (enum mapistore_table_type) tableType
andHandleId: (uint32_t) handleId;
- (enum mapistore_error) getTable: (MAPIStoreTable **) tablePtr
andRowCount: (uint32_t *) count
tableType: (enum mapistore_table_type) tableType
andHandleId: (uint32_t) handleId;
- (int) modifyPermissions: (struct PermissionData *) permissions
withCount: (uint16_t) pcount
andFlags: (int8_t) flags;
- (enum mapistore_error) modifyPermissions: (struct PermissionData *) permissions
withCount: (uint16_t) pcount
andFlags: (int8_t) flags;
- (enum mapistore_error) preloadMessageBodiesWithMIDs: (const struct UI8Array_r *) mids
ofTableType: (enum mapistore_table_type) tableType;
+162 -113
View File
@@ -65,6 +65,17 @@
Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMessageTableK, MAPIStoreFolderTableK;
/* MAPI permissions */
NSString *MAPIStoreRightReadItems = @"RightsReadItems";
NSString *MAPIStoreRightCreateItems = @"RightsCreateItems";
NSString *MAPIStoreRightEditOwn = @"RightsEditOwn";
NSString *MAPIStoreRightEditAll = @"RightsEditAll";
NSString *MAPIStoreRightDeleteOwn = @"RightsDeleteOwn";
NSString *MAPIStoreRightDeleteAll = @"RightsDeleteAll";
NSString *MAPIStoreRightCreateSubfolders = @"RightsCreateSubfolders";
NSString *MAPIStoreRightFolderOwner = @"RightsFolderOwner";
NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
@implementation MAPIStoreFolder
+ (void) initialize
@@ -365,10 +376,10 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return foundObject;
}
- (int) openFolder: (MAPIStoreFolder **) childFolderPtr
withFID: (uint64_t) fid
- (enum mapistore_error) openFolder: (MAPIStoreFolder **) childFolderPtr
withFID: (uint64_t) fid
{
int rc = MAPISTORE_ERR_NOT_FOUND;
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
MAPIStoreFolder *childFolder;
MAPIStoreMapping *mapping;
NSString *childURL;
@@ -390,9 +401,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) createFolder: (MAPIStoreFolder **) childFolderPtr
withRow: (struct SRow *) aRow
andFID: (uint64_t) fid
- (enum mapistore_error) createFolder: (MAPIStoreFolder **) childFolderPtr
withRow: (struct SRow *) aRow
andFID: (uint64_t) fid
{
BOOL mapped;
enum mapistore_error rc = MAPISTORE_SUCCESS;
@@ -447,7 +458,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) deleteFolder
- (enum mapistore_error) deleteFolder
{
// TODO: raise exception in case underlying delete fails?
// [propsMessage delete];
@@ -458,11 +469,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return MAPISTORE_SUCCESS;
}
- (int) getChildCount: (uint32_t *) rowCount
ofTableType: (enum mapistore_table_type) tableType
- (enum mapistore_error) getChildCount: (uint32_t *) rowCount
ofTableType: (enum mapistore_table_type) tableType
{
NSArray *keys;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
//[self logWithFormat: @"METHOD '%s' (%d) -- tableType: %d",
//__FUNCTION__, __LINE__, tableType];
@@ -483,16 +494,16 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) openMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
forWriting: (BOOL) readWrite
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) openMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
forWriting: (BOOL) readWrite
inMemCtx: (TALLOC_CTX *) memCtx;
{
NSString *messageURL;
MAPIStoreMapping *mapping;
MAPIStoreMessage *message;
SOGoUser *ownerUser;
int rc = MAPISTORE_ERR_NOT_FOUND;
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
mapping = [self mapping];
messageURL = [mapping urlFromID: mid];
@@ -523,9 +534,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) createMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
isAssociated: (BOOL) isAssociated
- (enum mapistore_error) createMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
isAssociated: (BOOL) isAssociated
{
enum mapistore_error rc;
MAPIStoreMessage *message;
@@ -570,8 +581,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) deleteMessageWithMID: (uint64_t) mid
andFlags: (uint8_t) flags
- (enum mapistore_error) deleteMessageWithMID: (uint64_t) mid
andFlags: (uint8_t) flags
{
NSString *childURL;
MAPIStoreMapping *mapping;
@@ -580,7 +591,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
NSUInteger count, max;
id msgObject;
SOGoUser *ownerUser;
int rc;
enum mapistore_error rc;
/* flags that control the behaviour of the operation
(MAPISTORE_SOFT_DELETE or MAPISTORE_PERMANENT_DELETE) */
@@ -597,7 +608,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
if ([[context activeUser] isEqual: ownerUser]
|| (![message isKindOfClass: MAPIStoreFAIMessageK]
&& [self subscriberCanDeleteMessages]))
&& ([self subscriberCanDeleteMessages] || [message subscriberCanDeleteMessage])))
{
/* we ensure the table caches are loaded so that old and new state
can be compared */
@@ -638,15 +649,15 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
}
// private method
- (int) _moveCopyMessageWithMID: (uint64_t) srcMid
fromFolder: (MAPIStoreFolder *) sourceFolder
withMID: (uint64_t) targetMid
andChangeKey: (struct Binary_r *) targetChangeKey
andPredecessorChangeList: (struct Binary_r *) targetPredecessorChangeList
wantCopy: (uint8_t) wantCopy
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) _moveCopyMessageWithMID: (uint64_t) srcMid
fromFolder: (MAPIStoreFolder *) sourceFolder
withMID: (uint64_t) targetMid
andChangeKey: (struct Binary_r *) targetChangeKey
andPredecessorChangeList: (struct Binary_r *) targetPredecessorChangeList
wantCopy: (uint8_t) wantCopy
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
MAPIStoreMessage *sourceMsg, *destMsg;
//TALLOC_CTX *memCtx;
struct SRow aRow;
@@ -695,16 +706,16 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
andCount: (uint32_t) midCount
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
wantCopy: (uint8_t) wantCopy
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
andCount: (uint32_t) midCount
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
wantCopy: (uint8_t) wantCopy
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSUInteger count;
NSMutableArray *oldMessageURLs;
NSString *oldMessageURL;
@@ -908,6 +919,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return nil;
}
- (NSArray *) expandRoles: (NSArray *) roles
{
return roles;
}
- (void) _modifyPermissionEntryForUser: (NSString *) user
withRoles: (NSArray *) roles
isAddition: (BOOL) isAddition
@@ -957,13 +973,13 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
withIDs: newIDs];
}
- (int) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
andCN: (uint64_t *) cnPtr
fromChangeNumber: (uint64_t) changeNum
inTableType: (enum mapistore_table_type) tableType
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
andCN: (uint64_t *) cnPtr
fromChangeNumber: (uint64_t) changeNum
inTableType: (enum mapistore_table_type) tableType
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
NSString *baseURL, *format, *url;
NSArray *keys;
NSNumber *cnNbr;
@@ -1016,14 +1032,15 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) getTable: (MAPIStoreTable **) tablePtr
andRowCount: (uint32_t *) countPtr
tableType: (enum mapistore_table_type) tableType
andHandleId: (uint32_t) handleId
- (enum mapistore_error) getTable: (MAPIStoreTable **) tablePtr
andRowCount: (uint32_t *) countPtr
tableType: (enum mapistore_table_type) tableType
andHandleId: (uint32_t) handleId
{
int rc = MAPISTORE_SUCCESS;
BOOL access;
enum mapistore_error rc = MAPISTORE_SUCCESS;
MAPIStoreTable *table;
SOGoUser *ownerUser;
SOGoUser *activeUser, *ownerUser;
if (tableType == MAPISTORE_MESSAGE_TABLE)
table = [self messageTable];
@@ -1034,8 +1051,20 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
else if (tableType == MAPISTORE_PERMISSIONS_TABLE)
{
ownerUser = [[self userContext] sogoUser];
if ([[context activeUser] isEqual: ownerUser])
table = [self permissionsTable];
activeUser = [context activeUser];
access = [activeUser isEqual: ownerUser];
if (!access)
{
NSArray *roles;
roles = [[self aclFolder] aclsForUser: [activeUser login]];
roles = [self expandRoles: roles]; // Not required here
/* Check FolderVisible right to return the table */
access = ([self exchangeRightsForRoles: roles] & RoleNone) != 0;
}
if (access)
table = [self permissionsTable];
else
rc = MAPISTORE_ERR_DENIED;
}
@@ -1208,16 +1237,16 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
// folderKeys = nil;
}
- (int) getPidTagParentFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagParentFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, [container objectId]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, [self objectId]);
@@ -1234,8 +1263,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
0x00000010 Create Contents Table
0x00000020 Create Associated Contents Table
*/
- (int) getPidTagAccess: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAccess: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t access = 0;
SOGoUser *ownerUser;
@@ -1263,103 +1292,107 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return MAPISTORE_SUCCESS;
}
- (int) getPidTagRights: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagRights: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t rights = 0;
SOGoUser *ownerUser;
BOOL userIsOwner;
SOGoUser *activeUser, *ownerUser;
ownerUser = [[self userContext] sogoUser];
activeUser = [context activeUser];
userIsOwner = [[context activeUser] isEqual: ownerUser];
if (userIsOwner || [self subscriberCanReadMessages])
rights |= RightsReadItems;
if (userIsOwner || [self subscriberCanCreateMessages])
rights |= RightsCreateItems;
if (userIsOwner || [self subscriberCanModifyMessages])
rights |= RightsEditOwn | RightsEditAll;
if (userIsOwner || [self subscriberCanDeleteMessages])
rights |= RightsDeleteOwn | RightsDeleteAll;
if ((userIsOwner || [self subscriberCanCreateSubFolders])
&& [self supportsSubFolders])
rights |= RightsCreateSubfolders;
if (userIsOwner)
rights |= RightsFolderOwner | RightsFolderContact;
if ([activeUser isEqual: ownerUser])
{
rights = RightsReadItems | RightsCreateItems | RightsEditOwn | RightsEditAll
| RightsDeleteOwn | RightsDeleteAll | RightsFolderOwner | RightsFolderContact | RoleNone;
if ([self supportsSubFolders])
rights |= RightsCreateSubfolders;
}
else
{
NSArray *roles;
roles = [[self aclFolder] aclsForUser: [activeUser login]];
roles = [self expandRoles: roles];
rights = [self exchangeRightsForRoles: roles];
/* FreeBusySimple and FreeBusyDetailed does not apply here
[MS-OXCFOLD] Section 2.2.2.2.2.8 */
rights &= ~RightsFreeBusySimple & ~RightsFreeBusyDetailed;
}
*data = MAPILongValue (memCtx, rights);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAccessControlListData: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAccessControlListData: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[NSData data] asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttributeHidden: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttributeHidden: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagAttributeSystem: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttributeSystem: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagAttributeReadOnly: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttributeReadOnly: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagSubfolders: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSubfolders: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPIBoolValue (memCtx, [self supportsSubFolders] && [[self folderKeys] count] > 0);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagFolderChildCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagFolderChildCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, [[self folderKeys] count]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagContentCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagContentCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, [[self messageKeys] count]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagContentUnreadCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagContentUnreadCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAssociatedContentCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAssociatedContentCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, [[self faiMessageKeys] count]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDeletedCountTotal: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDeletedCountTotal: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
/* TODO */
*data = MAPILongValue (memCtx, 0);
@@ -1367,10 +1400,10 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return MAPISTORE_SUCCESS;
}
- (int) getPidTagLocalCommitTimeMax: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagLocalCommitTimeMax: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSDate *date;
date = [self lastMessageModificationTime];
@@ -1382,18 +1415,18 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) memCtx
{
[dbFolder reloadIfNeeded];
@@ -1403,11 +1436,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
inMemCtx: memCtx];
}
- (int) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
id value;
value = [properties objectForKey: MAPIPropertyKey (propTag)];
@@ -1614,9 +1647,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
[users release];
}
- (int) modifyPermissions: (struct PermissionData *) permissions
withCount: (uint16_t) pcount
andFlags: (int8_t) flags
- (enum mapistore_error) modifyPermissions: (struct PermissionData *) permissions
withCount: (uint16_t) pcount
andFlags: (int8_t) flags
{
NSUInteger count, propCount;
struct PermissionData *currentPermission;
@@ -1626,6 +1659,22 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
NSArray *permissionRoles;
BOOL reset, isAdd = NO, isDelete = NO, isModify = NO;
SOGoFolder *aclFolder;
SOGoUser *activeUser, *ownerUser;
/* Check if we have permissions to modify the permissions.
See [MS-OXCPERM] Section 3.2.5.2 for details */
ownerUser = [[self userContext] sogoUser];
activeUser = [context activeUser];
if (![activeUser isEqual: ownerUser])
{
/* Check if we have FolderOwner right */
NSArray *roles;
roles = [[self aclFolder] aclsForUser: [activeUser login]];
roles = [self expandRoles: roles]; // Not required
if (([self exchangeRightsForRoles: roles] & RightsFolderOwner) == 0)
return MAPISTORE_ERR_DENIED;
}
aclFolder = [self aclFolder];
+5 -4
View File
@@ -86,9 +86,9 @@ static Class NSNumberK;
[super dealloc];
}
- (int) deleteFolder
- (enum mapistore_error) deleteFolder
{
int rc;
enum mapistore_error rc;
NSException *error;
NSString *name;
@@ -138,8 +138,8 @@ static Class NSNumberK;
[sogoObject renameTo: newDisplayName];
}
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *displayName;
Class cClass;
@@ -859,6 +859,7 @@ static Class NSNumberK;
woContext = [[self userContext] woContext];
activeUserRoles = [activeUser rolesForObject: sogoObject
inContext: woContext];
activeUserRoles = [self expandRoles: activeUserRoles];
[activeUserRoles retain];
}
+7
View File
@@ -23,6 +23,8 @@
#ifndef MAPISTOREGCSMESSAGE_H
#define MAPISTOREGCSMESSAGE_H
#import <SOGo/SOGoUser.h>
#import "MAPIStoreMessage.h"
@interface MAPIStoreGCSMessage : MAPIStoreMessage
@@ -30,6 +32,11 @@
}
/* subclass helpers */
/* Return the message original creator */
- (NSString *) creator;
- (NSString *) owner;
- (SOGoUser *) ownerUser;
- (void) updateVersions;
@end
+85 -65
View File
@@ -20,10 +20,12 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSValue.h>
#import <NGObjWeb/SoSecurityManager.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NSObject+Values.h>
#import <SOGo/SOGoContentObject.h>
@@ -35,6 +37,7 @@
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import "NSData+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreGCSMessage.h"
@@ -54,76 +57,28 @@
return [sogoObject lastModified];
}
- (int) getPidTagAccess: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagCreatorName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreContext *context;
WOContext *woContext;
SoSecurityManager *sm;
MAPIStoreUserContext *userContext;
uint32_t access;
enum mapistore_error rc;
NSString *creator;
context = [self context];
userContext = [self userContext];
if ([[context activeUser] isEqual: [userContext sogoUser]])
access = 0x03;
else
creator = [self creator];
if (creator)
{
sm = [SoSecurityManager sharedSecurityManager];
woContext = [userContext woContext];
access = 0;
if (![sm validatePermission: SoPerm_ChangeImagesAndFiles
onObject: sogoObject
inContext: woContext])
access |= 1;
if (![sm validatePermission: SoPerm_AccessContentsInformation
onObject: sogoObject
inContext: woContext])
access |= 2;
if (![sm validatePermission: SOGoPerm_DeleteObject
onObject: sogoObject
inContext: woContext])
access |= 4;
*data = [creator asUnicodeInMemCtx: memCtx];
rc = MAPISTORE_SUCCESS;
}
*data = MAPILongValue (memCtx, access);
else
rc = MAPISTORE_ERR_NOT_FOUND;
return MAPISTORE_SUCCESS;
return rc;
}
- (int) getPidTagAccessLevel: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreContext *context;
MAPIStoreUserContext *userContext;
WOContext *woContext;
SoSecurityManager *sm;
uint32_t accessLvl;
context = [self context];
userContext = [self userContext];
if ([[context activeUser] isEqual: [userContext sogoUser]])
accessLvl = 1;
else
{
sm = [SoSecurityManager sharedSecurityManager];
woContext = [userContext woContext];
if (![sm validatePermission: SoPerm_ChangeImagesAndFiles
onObject: sogoObject
inContext: woContext])
accessLvl = 1;
else
accessLvl = 0;
}
*data = MAPILongValue (memCtx, accessLvl);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSData *changeKey;
MAPIStoreGCSFolder *parentFolder;
NSString *nameInContainer;
@@ -155,10 +110,10 @@
return rc;
}
- (int) getPidTagPredecessorChangeList: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPredecessorChangeList: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSData *changeList;
MAPIStoreGCSFolder *parentFolder;
@@ -241,4 +196,69 @@
andPredecessorChangeList: predecessorChangeList];
}
//----------------------
// Sharing
//----------------------
- (NSString *) creator
{
return [self owner];
}
- (NSString *) owner
{
return [sogoObject ownerInContext: nil];
}
- (SOGoUser *) ownerUser
{
NSString *ownerName;
SOGoUser *owner = nil;
ownerName = [self owner];
if ([ownerName length] != 0)
owner = [SOGoUser userWithLogin: ownerName];
return owner;
}
- (BOOL) subscriberCanModifyMessage
{
BOOL rc;
NSArray *roles;
roles = [self activeUserRoles];
if (isNew)
rc = [roles containsObject: SOGoRole_ObjectCreator];
else
rc = [roles containsObject: SOGoRole_ObjectEditor];
/* Check if the message is owned and it has permission to edit it */
if (!rc && [roles containsObject: MAPIStoreRightEditOwn])
rc = [[[container context] activeUser] isEqual: [self ownerUser]];
return rc;
}
- (BOOL) subscriberCanDeleteMessage
{
BOOL rc;
NSArray *roles;
roles = [self activeUserRoles];
rc = [roles containsObject: SOGoRole_ObjectEraser];
/* Check if the message is owned and it has permission to delete it */
if (!rc && [roles containsObject: MAPIStoreRightDeleteOwn])
{
NSString *currentUser;
currentUser = [[container context] activeUser];
rc = [currentUser isEqual: [self ownerUser]];
}
return rc;
}
@end
+20 -20
View File
@@ -76,24 +76,24 @@
ASSIGN (bodyPart, newBodyPart);
}
- (int) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00000001); // afByValue
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachTag: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachTag: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self mimeAttachTag] asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachSize: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachSize: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t longValue;
@@ -103,8 +103,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagRecordKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagRecordKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
static char recordBytes[] = {0xd9, 0xd8, 0x11, 0xa3, 0xe2, 0x90, 0x18, 0x41,
0x9e, 0x04, 0x58, 0x46, 0x9d, 0x6d, 0x1b,
@@ -121,16 +121,16 @@
return [bodyInfo filename];
}
- (int) getPidTagAttachLongFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachLongFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self _fileName] asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *fileName, *baseName, *ext;
@@ -149,8 +149,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *fileName;
@@ -165,8 +165,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachContentId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachContentId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[bodyInfo objectForKey: @"bodyId"]
asUnicodeInMemCtx: memCtx];
@@ -174,8 +174,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachMimeTag: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachMimeTag: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *mimeTag, *fileName;
@@ -193,8 +193,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachDataBinary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAttachDataBinary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[bodyPart fetchBLOBWithPeek: YES] asBinaryInMemCtx: memCtx];
+37 -80
View File
@@ -208,9 +208,9 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
return rc;
}
- (int) deleteFolder
- (enum mapistore_error) deleteFolder
{
int rc;
enum mapistore_error rc;
NSException *error;
NSString *name;
@@ -234,8 +234,8 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
return (rc == MAPISTORE_SUCCESS) ? [super deleteFolder] : rc;
}
- (int) getPidTagContentUnreadCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagContentUnreadCount: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
EOQualifier *searchQualifier;
uint32_t longValue;
@@ -250,8 +250,8 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
return MAPISTORE_SUCCESS;
}
- (int) getPidTagContainerClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagContainerClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPF.Note" asUnicodeInMemCtx: memCtx];
@@ -1363,15 +1363,14 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
// Move (or eventually copy) the mails identified by
// "srcMids" from the source folder into this folder.
//
- (int) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
andCount: (uint32_t) midCount
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
wantCopy: (uint8_t) wantCopy
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
andCount: (uint32_t) midCount
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
andPredecessorChangeLists: (struct Binary_r **) targetPredecessorChangeLists
wantCopy: (uint8_t) wantCopy
inMemCtx: (TALLOC_CTX *) memCtx
{
NGImap4Connection *connection;
NGImap4Client *client;
@@ -1657,7 +1656,7 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
- (id) lookupMessage: (NSString *) messageKey
{
MAPIStoreMailMessage *message;
NSData *rawBodyData;
NSArray *rawBodyData;
message = [super lookupMessage: messageKey];
if (message)
@@ -1731,73 +1730,31 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
- (enum mapistore_error) preloadMessageBodiesWithKeys: (NSArray *) keys
ofTableType: (enum mapistore_table_type) tableType
{
NSEnumerator *enumerator;
NSUInteger max;
NSString *messageKey;
MAPIStoreMailMessage *message;
NSMutableSet *bodyPartKeys;
NSMutableDictionary *keyAssoc;
NSDictionary *response;
NSUInteger count, max;
NSString *messageKey, *messageUid, *bodyPartKey;
NGImap4Client *client;
NSArray *fetch;
NSData *bodyContent;
NSArray* bodyContent;
if (tableType == MAPISTORE_MESSAGE_TABLE)
if (tableType != MAPISTORE_MESSAGE_TABLE)
return MAPISTORE_SUCCESS;
[bodyData removeAllObjects];
max = [keys count];
if (max == 0)
return MAPISTORE_SUCCESS;
enumerator = [keys objectEnumerator];
while ((messageKey = [enumerator nextObject]))
{
[bodyData removeAllObjects];
max = [keys count];
if (max > 0)
message = [self lookupMessage: messageKey];
if (message)
{
bodyPartKeys = [NSMutableSet setWithCapacity: max];
keyAssoc = [NSMutableDictionary dictionaryWithCapacity: max];
for (count = 0; count < max; count++)
bodyContent = [message getBodyContent];
if (bodyContent)
{
messageKey = [keys objectAtIndex: count];
message = [self lookupMessage: messageKey];
if (message)
{
bodyPartKey = [message bodyContentPartKey];
if (bodyPartKey)
{
[bodyPartKeys addObject: bodyPartKey];
messageUid = [self messageUIDFromMessageKey: messageKey];
/* If the bodyPartKey include peek, remove it as it is not returned
as key in the IMAP server response.
IMAP conversation example:
a4 UID FETCH 1 (UID BODY.PEEK[text])
* 1 FETCH (UID 1 BODY[TEXT] {1677}
*/
bodyPartKey = [bodyPartKey stringByReplacingOccurrencesOfString: @"body.peek"
withString: @"body"];
[keyAssoc setObject: bodyPartKey forKey: messageUid];
}
}
}
client = [[(SOGoMailFolder *) sogoObject imap4Connection] client];
[client select: [sogoObject absoluteImap4Name]];
response = [client fetchUids: [keyAssoc allKeys]
parts: [bodyPartKeys allObjects]];
fetch = [response objectForKey: @"fetch"];
max = [fetch count];
for (count = 0; count < max; count++)
{
response = [fetch objectAtIndex: count];
messageUid = [[response objectForKey: @"uid"] stringValue];
bodyPartKey = [keyAssoc objectForKey: messageUid];
if (bodyPartKey)
{
bodyContent = [[response objectForKey: bodyPartKey]
objectForKey: @"data"];
if (bodyContent)
{
messageKey = [NSString stringWithFormat: @"%@.eml",
messageUid];
[bodyData setObject: bodyContent forKey: messageKey];
}
}
[bodyData setObject: bodyContent forKey: messageKey];
}
}
}
@@ -1809,8 +1766,8 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
@implementation MAPIStoreOutboxFolder
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"Outbox" asUnicodeInMemCtx: memCtx];
+33 -26
View File
@@ -25,8 +25,10 @@
#import "MAPIStoreMessage.h"
@class NSData;
@class NSString;
@class NSArray;
@class NSMutableArray;
@class NSMutableDictionary;
@class MAPIStoreAppointmentWrapper;
@class MAPIStoreMailFolder;
@@ -37,12 +39,17 @@
BOOL mailIsEvent;
BOOL mailIsMeetingRequest;
BOOL mailIsSharingObject;
NSString *mimeKey;
NSMutableArray *bodyContentKeys;
NSMutableDictionary *bodyPartsEncodings;
NSMutableDictionary *bodyPartsCharsets;
NSMutableDictionary *bodyPartsMimeTypes;
NSMutableDictionary *bodyPartsMixed;
NSString *headerCharset;
NSString *headerEncoding;
NSString *headerMimeType;
BOOL bodySetup;
NSData *bodyContent;
NSArray *bodyContent;
BOOL fetchedAttachments;
MAPIStoreAppointmentWrapper *appointmentWrapper;
@@ -50,31 +57,31 @@
- (NSString *) subject;
- (int) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagFlagStatus: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagFlagStatus: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagMessageFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagFollowupIcon: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagDisplayTo: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagDisplayCc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagDisplayBcc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagMessageFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagFollowupIcon: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagReceivedByEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSenderEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagDisplayTo: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagDisplayCc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagDisplayBcc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
/* batch-mode helpers */
- (NSString *) bodyContentPartKey;
- (void) setBodyContentFromRawData: (NSData *) rawContent;
- (void) setBodyContentFromRawData: (NSArray *) rawContent;
- (NSArray *) getBodyContent;
@end
File diff suppressed because it is too large. Load diff
+6 -6
View File
@@ -340,10 +340,10 @@ static Class MAPIStoreMailMessageK, NSDataK, NSStringK;
[self cleanupCaches];
}
- (int) getRow: (struct mapistore_property_data **) dataP
withRowID: (uint32_t) rowId
andQueryType: (enum mapistore_query_type) queryType
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getRow: (struct mapistore_property_data **) dataP
withRowID: (uint32_t) rowId
andQueryType: (enum mapistore_query_type) queryType
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!fetchedCoreInfos)
{
@@ -352,8 +352,8 @@ static Class MAPIStoreMailMessageK, NSDataK, NSStringK;
prefetchCoreInfosForMessageKeys: [self restrictedChildKeys]];
}
return [super getRow: dataP withRowID: rowId
andQueryType: queryType inMemCtx: memCtx];
return [super getRow: dataP withRowID: rowId
andQueryType: queryType inMemCtx: memCtx];
}
@end
+1 -1
View File
@@ -27,7 +27,7 @@
@interface MAPIStoreMailVolatileMessage : MAPIStoreMessage
- (int) submitWithFlags: (enum SubmitFlags) flags;
- (enum mapistore_error) submitWithFlags: (enum SubmitFlags) flags;
@end
+4 -4
View File
@@ -290,17 +290,17 @@ static NSString *recTypes[] = { @"orig", @"to", @"cc", @"bcc" };
: ULLONG_MAX);
}
- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagChangeKey: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagChangeKey: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
NSData *changeKey;
int rc;
enum mapistore_error rc;
changeKey = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)];
if (changeKey)
@@ -1051,7 +1051,7 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts, NS
return messageData;
}
- (int) submitWithFlags: (enum SubmitFlags) flags
- (enum mapistore_error) submitWithFlags: (enum SubmitFlags) flags
{
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSDictionary *recipients;
+2 -2
View File
@@ -258,7 +258,7 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr)
if (oldURL != NULL)
{
[self errorWithFormat:
@"url with idNbr already registered: (oldUrl='%@', newUrl='%@', id=x%.16"PRIx64")",
@"url with idNbr already registered: (oldUrl='%@', newUrl='%@', id=0x%.16"PRIx64")",
oldURL, urlString, idNbr];
return NO;
}
@@ -306,7 +306,7 @@ MAPIStoreMappingKeyFromId (uint64_t idNbr)
}
else
[NSException raise: NSInvalidArgumentException
format: @"number of urls and ids do not match"];
format: @"number of urls (%d) and ids (%d) do not match", max, [idNbrs count]];
}
- (void) unregisterURLWithID: (uint64_t) idNbr
+11 -9
View File
@@ -48,27 +48,28 @@
- (void) getMessageData: (struct mapistore_message **) dataPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) recipients
andCount: (NSUInteger) max
andColumns: (struct SPropTagArray *) columns;
- (enum mapistore_error) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) recipients
andCount: (NSUInteger) max
andColumns: (struct SPropTagArray *) columns;
- (NSArray *) attachmentKeys;
- (NSArray *) attachmentKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
- (id) lookupAttachment: (NSString *) childKey;
/* backend methods */
- (int) createAttachment: (MAPIStoreAttachment **) attachmentPtr
inAID: (uint32_t *) aidPtr;
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPtr
withAID: (uint32_t) aid;
- (int) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
andRowCount: (uint32_t *) countPtr;
- (enum mapistore_error) createAttachment: (MAPIStoreAttachment **) attachmentPtr
inAID: (uint32_t *) aidPtr;
- (enum mapistore_error) getAttachment: (MAPIStoreAttachment **) attachmentPtr
withAID: (uint32_t) aid;
- (enum mapistore_error) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
andRowCount: (uint32_t *) countPtr;
- (enum mapistore_error) setReadFlag: (uint8_t) flag;
- (enum mapistore_error) saveMessage: (TALLOC_CTX *) memCtx;
- (NSArray *) activeContainerMessageTables;
- (NSArray *) activeUserRoles;
- (NSArray *) expandRoles: (NSArray *) roles;
/* move & copy internal ops */
- (void) copyToMessage: (MAPIStoreMessage *) newMessage inMemCtx: (TALLOC_CTX *) memCtx;
@@ -82,6 +83,7 @@
- (BOOL) subscriberCanReadMessage;
- (BOOL) subscriberCanModifyMessage;
- (BOOL) subscriberCanDeleteMessage;
@end
+105 -87
View File
@@ -276,9 +276,9 @@ rtf2html (NSData *compressedRTF)
return recipientProperties;
}
- (int) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) newRecipients
andCount: (NSUInteger) max
andColumns: (struct SPropTagArray *) columns;
- (enum mapistore_error) modifyRecipientsWithRecipients: (struct mapistore_message_recipient *) newRecipients
andCount: (NSUInteger) max
andColumns: (struct SPropTagArray *) columns;
{
static NSString *recTypes[] = { @"orig", @"to", @"cc", @"bcc" };
NSDictionary *recipientProperties;
@@ -318,7 +318,7 @@ rtf2html (NSData *compressedRTF)
return MAPISTORE_SUCCESS;
}
- (int) addPropertiesFromRow: (struct SRow *) aRow
- (enum mapistore_error) addPropertiesFromRow: (struct SRow *) aRow
{
enum mapistore_error rc;
MAPIStoreContext *context;
@@ -397,11 +397,11 @@ rtf2html (NSData *compressedRTF)
return newAttachment;
}
- (int) createAttachment: (MAPIStoreAttachment **) attachmentPtr
inAID: (uint32_t *) aidPtr
- (enum mapistore_error) createAttachment: (MAPIStoreAttachment **) attachmentPtr
inAID: (uint32_t *) aidPtr
{
MAPIStoreAttachment *attachment;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
attachment = [self createAttachment];
if (attachment)
@@ -422,12 +422,12 @@ rtf2html (NSData *compressedRTF)
return nil;
}
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPtr
withAID: (uint32_t) aid
- (enum mapistore_error) getAttachment: (MAPIStoreAttachment **) attachmentPtr
withAID: (uint32_t) aid
{
MAPIStoreAttachment *attachment;
NSArray *keys;
int rc = MAPISTORE_ERR_NOT_FOUND;
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
keys = [self attachmentKeys];
if (aid < [keys count])
@@ -443,11 +443,11 @@ rtf2html (NSData *compressedRTF)
return rc;
}
- (int) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
andRowCount: (uint32_t *) countPtr
- (enum mapistore_error) getAttachmentTable: (MAPIStoreAttachmentTable **) tablePtr
andRowCount: (uint32_t *) countPtr
{
MAPIStoreAttachmentTable *attTable;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
attTable = [self attachmentTable];
if (attTable)
@@ -547,7 +547,8 @@ rtf2html (NSData *compressedRTF)
for (count = 0; count < max; count++)
[[containerTables objectAtIndex: count] restrictedChildKeys];
}
/* TODO: Check the save process succeeded */
[self save: memCtx];
/* We make sure that any change-related properties are removed from the
properties dictionary, to make sure that related methods will be
@@ -582,8 +583,8 @@ rtf2html (NSData *compressedRTF)
}
/* getters */
- (int) getPidTagInstID: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagInstID: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
{
/* we return a unique id based on the key */
*data = MAPILongLongValue (memCtx, [[sogoObject nameInContainer] hash]);
@@ -591,22 +592,22 @@ rtf2html (NSData *compressedRTF)
return MAPISTORE_SUCCESS;
}
- (int) getPidTagInstanceNum: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagInstanceNum: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagRowType: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagRowType: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, TBL_LEAF_ROW);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDepth: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDepth: (void **) data // TODO: DOUBT
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, 0);
@@ -623,8 +624,8 @@ rtf2html (NSData *compressedRTF)
0x00000010 Create Contents Table
0x00000020 Create Associated Contents Table
*/
- (int) getPidTagAccess: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAccess: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t access = 0;
BOOL userIsOwner;
@@ -649,8 +650,7 @@ rtf2html (NSData *compressedRTF)
if (userIsOwner
|| ([self isKindOfClass: MAPIStoreEmbeddedMessageK]
&& [mainMessage subscriberCanModifyMessage])
|| [(MAPIStoreFolder *)
[mainMessage container] subscriberCanDeleteMessages])
|| [mainMessage subscriberCanDeleteMessage])
access |= 0x04;
*data = MAPILongValue (memCtx, access);
@@ -664,8 +664,8 @@ rtf2html (NSData *compressedRTF)
0x00000000 Read-Only
0x00000001 Modify
*/
- (int) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t access = 0;
BOOL userIsOwner;
@@ -684,20 +684,20 @@ rtf2html (NSData *compressedRTF)
return MAPISTORE_SUCCESS;
}
- (int ) getPidTagHasNamedProperties: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHasNamedProperties: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidLidSideEffects: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSideEffects: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidLidCurrentVersion: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidCurrentVersion: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
// *data = MAPILongValue (memCtx, 115608); // Outlook 11.5608
*data = MAPILongValue (memCtx, 0x1ce3a); // Outlook 11.8330
@@ -705,34 +705,34 @@ rtf2html (NSData *compressedRTF)
return MAPISTORE_SUCCESS;
}
- (int) getPidLidCurrentVersionName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidCurrentVersionName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"11.0" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidLidAutoProcessState: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidAutoProcessState: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00000000);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, [container objectId]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
uint64_t obId;
obId = [self objectId];
@@ -747,24 +747,24 @@ rtf2html (NSData *compressedRTF)
return rc;
}
- (int) getPidTagMessageLocaleId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageLocaleId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x0409);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMessageFlags: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageFlags: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, MSGFLAG_FROMME | MSGFLAG_READ | MSGFLAG_UNMODIFIED);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMessageSize: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageSize: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
/* TODO: choose another name in SOGo for that method */
*data = MAPILongValue (memCtx, [[sogoObject davContentLength] intValue]);
@@ -772,30 +772,30 @@ rtf2html (NSData *compressedRTF)
return MAPISTORE_SUCCESS;
}
- (int) getPidTagImportance: (void **) data // TODO -> subclass?
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagImportance: (void **) data // TODO -> subclass?
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 1);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagPriority: (void **) data // TODO -> subclass?
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagPriority: (void **) data // TODO -> subclass?
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
TALLOC_CTX *localMemCtx;
char *prefix, *normalizedSubject;
@@ -816,71 +816,71 @@ rtf2html (NSData *compressedRTF)
return rc;
}
- (int) getPidTagNormalizedSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagOriginalSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagOriginalSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagSubject: data inMemCtx: memCtx];
}
- (int) getPidTagConversationTopic: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagConversationTopic: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagNormalizedSubject: data inMemCtx: memCtx];
}
- (int) getPidTagSubjectPrefix: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSubjectPrefix: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getEmptyString: data inMemCtx: memCtx];
}
- (int) getPidTagDeleteAfterSubmit: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDeleteAfterSubmit: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagDisplayTo: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayTo: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getEmptyString: data inMemCtx: memCtx];
}
- (int) getPidTagDisplayCc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayCc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getEmptyString: data inMemCtx: memCtx];
}
- (int) getPidTagDisplayBcc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayBcc: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getEmptyString: data inMemCtx: memCtx];
}
// - (int) getPidTagOriginalDisplayTo: (void **) data
// - (enum mapistore_error) getPidTagOriginalDisplayTo: (void **) data
// {
// return [self getPidTagDisplayTo: data];
// }
// - (int) getPidTagOriginalDisplayCc: (void **) data
// - (enum mapistore_error) getPidTagOriginalDisplayCc: (void **) data
// {
// return [self getPidTagDisplayCc: data];
// }
// - (int) getPidTagOriginalDisplayBcc: (void **) data
// - (enum mapistore_error) getPidTagOriginalDisplayBcc: (void **) data
// {
// return [self getPidTagDisplayBcc: data];
// }
- (int) getPidTagLastModifierName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagLastModifierName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSURL *contextUrl;
@@ -890,22 +890,22 @@ rtf2html (NSData *compressedRTF)
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
[self subclassResponsibility: _cmd];
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagOriginalMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagOriginalMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getProperty: data withTag: PidTagMessageClass inMemCtx: memCtx];
}
- (int) getPidTagHasAttachments: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHasAttachments: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPIBoolValue (memCtx,
[[self attachmentKeys] count] > 0);
@@ -913,8 +913,8 @@ rtf2html (NSData *compressedRTF)
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAssociated: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagAssociated: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];;
}
@@ -981,20 +981,38 @@ rtf2html (NSData *compressedRTF)
activeUserRoles = [[context activeUser]
rolesForObject: sogoObject
inContext: [userContext woContext]];
/* We use in this library the roles as flags, so we expand high
access rights with the lower ones */
activeUserRoles = [self expandRoles: activeUserRoles];
[activeUserRoles retain];
}
return activeUserRoles;
}
/* Expand current roles with lower access roles to transform them to
flags */
- (NSArray *) expandRoles: (NSArray *) roles
{
return roles;
}
/* Can the current active user read the message? */
- (BOOL) subscriberCanReadMessage
{
return NO;
}
/* Can the current active user modify the message? */
- (BOOL) subscriberCanModifyMessage
{
return NO;
}
/* Can the current active user delete the message? */
- (BOOL) subscriberCanDeleteMessage
{
return NO;
}
@end
+18
View File
@@ -1,6 +1,7 @@
/* MAPIStoreNotesContext.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
* Copyright (C) 2016 Enrique J. Hernandez
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
@@ -30,13 +31,30 @@
#undef DEBUG
#include <mapistore/mapistore.h>
static Class MAPIStoreNotesFolderK;
@implementation MAPIStoreNotesContext
+ (void) initialize
{
MAPIStoreNotesFolderK = [MAPIStoreNotesFolder class];
}
+ (NSString *) MAPIModuleName
{
return @"notes";
}
+ (enum mapistore_context_role) MAPIContextRole
{
return MAPISTORE_NOTES_ROLE;
}
- (Class) MAPIStoreFolderClass
{
return MAPIStoreNotesFolderK;
}
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx
+2 -2
View File
@@ -30,8 +30,8 @@
@implementation MAPIStoreNotesFolder
- (int) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.StickyNote" asUnicodeInMemCtx: memCtx];
+3 -3
View File
@@ -32,8 +32,8 @@
@implementation MAPIStoreNotesMessage
- (int) getPidTagIconIndex: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagIconIndex: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
// *longValue = 0x00000300 for blue
@@ -46,7 +46,7 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.StickyNote" asUnicodeInMemCtx: memCtx];
+15 -15
View File
@@ -68,27 +68,27 @@
- (NSMutableDictionary *) properties;
/* ops */
- (int) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) localMemCtx;
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) localMemCtx;
- (int) addPropertiesFromRow: (struct SRow *) aRow;
- (enum mapistore_error) addPropertiesFromRow: (struct SRow *) aRow;
- (int) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) localMemCtx;
- (enum mapistore_error) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) localMemCtx;
/* helper getters */
- (NSData *) getReplicaKeyFromGlobCnt: (uint64_t) objectCnt;
- (int) getReplicaKey: (void **) data
fromGlobCnt: (uint64_t) objectCnt
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getReplicaKey: (void **) data
fromGlobCnt: (uint64_t) objectCnt
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagCreationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagLastModificationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagCreationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagLastModificationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
/* move and copy operations */
- (void) copyPropertiesToObject: (MAPIStoreObject *) newObject inMemCtx: (TALLOC_CTX *) memCtx;
+16 -16
View File
@@ -150,15 +150,15 @@ static Class NSExceptionK, MAPIStoreFolderK;
return properties;
}
- (int) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStorePropertyGetter method = NULL;
uint16_t propValue;
SEL methodSel;
id value;
int rc = MAPISTORE_ERR_NOT_FOUND;
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
NSUInteger count, max;
value = [properties objectForKey: MAPIPropertyKey (propTag)];
@@ -186,16 +186,16 @@ static Class NSExceptionK, MAPIStoreFolderK;
return rc;
}
- (int) getPidTagCreationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagCreationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self creationTime] asFileTimeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagLastModificationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagLastModificationTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self lastModificationTime] asFileTimeInMemCtx: memCtx];
@@ -219,10 +219,10 @@ static Class NSExceptionK, MAPIStoreFolderK;
return canGetProperty;
}
- (int) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) memCtx
{
uint16_t count;
@@ -239,7 +239,7 @@ static Class NSExceptionK, MAPIStoreFolderK;
[proxies addObject: newProxy];
}
- (int) addPropertiesFromRow: (struct SRow *) aRow
- (enum mapistore_error) addPropertiesFromRow: (struct SRow *) aRow
{
struct SPropValue *cValue;
NSUInteger counter;
@@ -298,9 +298,9 @@ static Class NSExceptionK, MAPIStoreFolderK;
return replicaKey;
}
- (int) getReplicaKey: (void **) data
fromGlobCnt: (uint64_t) objectCnt
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getReplicaKey: (void **) data
fromGlobCnt: (uint64_t) objectCnt
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self getReplicaKeyFromGlobCnt: objectCnt] asBinaryInMemCtx: memCtx];
+1 -1
View File
@@ -51,7 +51,7 @@
MAPIStorePropertyGetter method;
uint16_t propValue;
SEL methodSel;
int rc;
enum mapistore_error rc;
propValue = (propTag & 0xffff0000) >> 16;
methodSel = MAPIStoreSelectorForPropertyGetter (propValue);
+9 -8
View File
@@ -84,16 +84,16 @@
return memberId;
}
- (int) getPidTagMemberId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMemberId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, memberId);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSData *entryId;
struct mapistore_connection_info *connInfo;
@@ -110,8 +110,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMemberName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMemberName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *displayName;
@@ -127,13 +127,14 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMemberRights: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMemberRights: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t rights;
NSArray *roles;
roles = [[(MAPIStoreFolder *) container aclFolder] aclsForUser: userId];
roles = [(MAPIStoreFolder *) container expandRoles: roles];
rights = [(MAPIStoreFolder *) container exchangeRightsForRoles: roles];
*data = MAPILongValue (memCtx, rights);
+68 -40
View File
@@ -146,6 +146,8 @@ sogo_backend_init (void)
NSUserDefaults *ud;
SoProductRegistry *registry;
char *argv[] = { SAMBA_PREFIX "/sbin/samba", NULL };
NSString *debugLevel;
uint8_t parentLogLevel;
GSRegisterCurrentThread();
@@ -170,6 +172,11 @@ sogo_backend_init (void)
/* We force the plugin to base its configuration on the SOGo tree. */
ud = [NSUserDefaults standardUserDefaults];
/* Ensure imap4Connection calls raise Exception if
IMAP connection is not established. See NGImap4Connection.m */
[ud setBool: YES forKey: @"SoIMAP4ExceptionsEnabled"];
if (!leakDebugging && [ud boolForKey: @"SOGoDebugLeaks"])
{
NSLog (@" leak debugging on");
@@ -178,6 +185,22 @@ sogo_backend_init (void)
leakDebugging = YES;
}
/* Set debug level according to samba */
parentLogLevel = DEBUGLEVEL_CLASS[DBGC_ALL]; // FIXME: samba logger specific code
if (parentLogLevel >= 4)
debugLevel = @"DEBUG";
else if (parentLogLevel >= 3)
debugLevel = @"INFO";
else if (parentLogLevel >= 2)
debugLevel = @"WARN";
else if (parentLogLevel >= 1)
debugLevel = @"ERROR";
else
debugLevel = @"FATAL";
OC_DEBUG(3, "[SOGo] Setting log level to %s", [debugLevel UTF8String]);
[ud setObject: debugLevel forKey: @"NGLogDefaultLogLevel"];
[ud synchronize];
registry = [SoProductRegistry sharedProductRegistry];
[registry scanForProductsInDirectory: SOGO_BUNDLES_DIR];
@@ -221,8 +244,13 @@ static void mapiapp_cleanup(void)
\details Create a connection context to the sogo backend
\param mem_ctx pointer to the memory context
\param conn_info pointer to the connection information available for this context
(database connection, connected user, replica server info)
\param indexing pointer to the indexing database connection
\param uri pointer to the sogo path
\param private_data pointer to the private backend context
\note the developer must free allocated private_data
*/
static enum mapistore_error
@@ -233,7 +261,7 @@ sogo_backend_create_context(TALLOC_CTX *mem_ctx,
{
NSAutoreleasePool *pool;
MAPIStoreContext *context;
int rc;
enum mapistore_error rc;
NS_CURRENT_THREAD_REGISTER();
pool = [NSAutoreleasePool new];
@@ -268,7 +296,7 @@ sogo_backend_create_root_folder (const char *username,
NSAutoreleasePool *pool;
NSString *userName, *folderName;
NSString *mapistoreUri;
int rc;
enum mapistore_error rc;
NS_CURRENT_THREAD_REGISTER();
pool = [NSAutoreleasePool new];
@@ -303,7 +331,7 @@ sogo_backend_list_contexts(const char *username, struct indexing_context *indexi
{
NSAutoreleasePool *pool;
NSString *userName;
int rc;
enum mapistore_error rc;
NS_CURRENT_THREAD_REGISTER();
pool = [NSAutoreleasePool new];
@@ -349,7 +377,7 @@ sogo_context_get_path(void *backend_object, TALLOC_CTX *mem_ctx,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreContext *context;
int rc;
enum mapistore_error rc;
if (backend_object)
{
@@ -381,7 +409,7 @@ sogo_context_get_root_folder(void *backend_object, TALLOC_CTX *mem_ctx,
NSAutoreleasePool *pool;
MAPIStoreContext *context;
MAPIStoreFolder *folder;
int rc;
enum mapistore_error rc;
if (backend_object)
{
@@ -422,7 +450,7 @@ sogo_folder_open_folder(void *folder_object, TALLOC_CTX *mem_ctx, uint64_t fid,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder, *childFolder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -464,7 +492,7 @@ sogo_folder_create_folder(void *folder_object, TALLOC_CTX *mem_ctx,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder, *childFolder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -505,7 +533,7 @@ sogo_folder_delete(void *folder_object)
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -535,7 +563,7 @@ sogo_folder_get_child_count(void *folder_object, enum mapistore_table_type table
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -569,7 +597,7 @@ sogo_folder_open_message(void *folder_object,
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
MAPIStoreMessage *message;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -609,7 +637,7 @@ sogo_folder_create_message(void *folder_object,
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
MAPIStoreMessage *message;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -643,7 +671,7 @@ sogo_folder_delete_message(void *folder_object, uint64_t mid, uint8_t flags)
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -680,7 +708,7 @@ sogo_folder_move_copy_messages(void *folder_object,
MAPIStoreFolder *sourceFolder, *targetFolder;
NSAutoreleasePool *pool;
struct MAPIStoreTallocWrapper *wrapper;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -723,7 +751,7 @@ sogo_folder_move_folder(void *folder_object, void *target_folder_object,
MAPIStoreFolder *moveFolder, *targetFolder;
NSString *newFolderName;
struct MAPIStoreTallocWrapper *wrapper;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -771,7 +799,7 @@ sogo_folder_copy_folder(void *folder_object, void *target_folder_object, TALLOC_
MAPIStoreFolder *copyFolder, *targetFolder;
NSString *newFolderName;
struct MAPIStoreTallocWrapper *wrapper;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -813,7 +841,7 @@ sogo_folder_get_deleted_fmids(void *folder_object, TALLOC_CTX *mem_ctx,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -850,7 +878,7 @@ sogo_folder_open_table(void *folder_object, TALLOC_CTX *mem_ctx,
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -887,7 +915,7 @@ sogo_folder_modify_permissions(void *folder_object, uint8_t flags,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -919,7 +947,7 @@ sogo_folder_preload_message_bodies(void *folder_object, enum mapistore_table_typ
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreFolder *folder;
int rc;
enum mapistore_error rc;
if (folder_object)
{
@@ -952,7 +980,7 @@ sogo_message_get_message_data(void *message_object,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreMessage *message;
int rc;
enum mapistore_error rc;
if (message_object)
{
@@ -985,7 +1013,7 @@ sogo_message_create_attachment (void *message_object, TALLOC_CTX *mem_ctx, void
NSAutoreleasePool *pool;
MAPIStoreMessage *message;
MAPIStoreAttachment *attachment;
int rc;
enum mapistore_error rc;
if (message_object)
{
@@ -1019,7 +1047,7 @@ sogo_message_open_attachment (void *message_object, TALLOC_CTX *mem_ctx,
NSAutoreleasePool *pool;
MAPIStoreMessage *message;
MAPIStoreAttachment *attachment;
int rc;
enum mapistore_error rc;
if (message_object)
{
@@ -1052,7 +1080,7 @@ sogo_message_get_attachment_table (void *message_object, TALLOC_CTX *mem_ctx, vo
NSAutoreleasePool *pool;
MAPIStoreMessage *message;
MAPIStoreAttachmentTable *table;
int rc;
enum mapistore_error rc;
if (message_object)
{
@@ -1088,7 +1116,7 @@ sogo_message_modify_recipients (void *message_object,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreMessage *message;
int rc;
enum mapistore_error rc;
if (message_object)
{
@@ -1150,7 +1178,7 @@ sogo_message_save (void *message_object, TALLOC_CTX *mem_ctx)
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreMessage *message;
int rc;
enum mapistore_error rc;
if (message_object)
{
@@ -1180,7 +1208,7 @@ sogo_message_submit (void *message_object, enum SubmitFlags flags)
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreMailVolatileMessage *message;
int rc;
enum mapistore_error rc;
if (message_object)
{
@@ -1215,7 +1243,7 @@ sogo_message_attachment_open_embedded_message (void *attachment_object,
NSAutoreleasePool *pool;
MAPIStoreAttachment *attachment;
MAPIStoreEmbeddedMessage *message;
int rc;
enum mapistore_error rc;
if (attachment_object)
{
@@ -1254,7 +1282,7 @@ sogo_message_attachment_create_embedded_message (void *attachment_object,
NSAutoreleasePool *pool;
MAPIStoreAttachment *attachment;
MAPIStoreEmbeddedMessage *message;
int rc;
enum mapistore_error rc;
if (attachment_object)
{
@@ -1288,7 +1316,7 @@ static enum mapistore_error sogo_table_get_available_properties(void *table_obje
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (table_object)
{
@@ -1318,7 +1346,7 @@ sogo_table_set_columns (void *table_object, uint16_t count, enum MAPITAGS *prope
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (table_object)
{
@@ -1349,7 +1377,7 @@ sogo_table_set_restrictions (void *table_object, struct mapi_SRestriction *restr
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (table_object)
{
@@ -1382,7 +1410,7 @@ sogo_table_set_sort_order (void *table_object, struct SSortOrderSet *sort_order,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (table_object)
{
@@ -1417,7 +1445,7 @@ sogo_table_get_row (void *table_object, TALLOC_CTX *mem_ctx,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (table_object)
{
@@ -1450,7 +1478,7 @@ sogo_table_get_row_count (void *table_object,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (table_object)
{
@@ -1481,7 +1509,7 @@ sogo_table_handle_destructor (void *table_object, uint32_t handle_id)
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreTable *table;
int rc;
enum mapistore_error rc;
if (table_object)
{
@@ -1513,7 +1541,7 @@ static enum mapistore_error sogo_properties_get_available_properties(void *objec
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreObject *propObject;
int rc;
enum mapistore_error rc;
if (object)
{
@@ -1546,7 +1574,7 @@ sogo_properties_get_properties (void *object,
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreObject *propObject;
int rc;
enum mapistore_error rc;
if (object)
{
@@ -1578,7 +1606,7 @@ sogo_properties_set_properties (void *object, struct SRow *aRow)
struct MAPIStoreTallocWrapper *wrapper;
NSAutoreleasePool *pool;
MAPIStoreObject *propObject;
int rc;
enum mapistore_error rc;
if (object)
{
@@ -1656,10 +1684,10 @@ sogo_manager_generate_uri (TALLOC_CTX *mem_ctx,
\return MAPISTORE_SUCCESS on success, otherwise MAPISTORE error
*/
int mapistore_init_backend(void)
enum mapistore_error mapistore_init_backend(void)
{
struct mapistore_backend backend;
int ret;
enum mapistore_error ret;
static BOOL registered = NO;
if (registered)
+12 -12
View File
@@ -65,18 +65,18 @@
- (uint64_t) objectId;
/* implemented getters */
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSearchKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSearchKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
/* subclasses */
- (uint64_t) objectVersion;
+16 -16
View File
@@ -136,16 +136,16 @@ static Class MAPIStoreFolderK;
}
/* getters */
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[sogoObject displayName] asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagSearchKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSearchKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *stringValue;
@@ -156,31 +156,31 @@ static Class MAPIStoreFolderK;
return MAPISTORE_SUCCESS;
}
- (int) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getReplicaKey: data fromGlobCnt: [container objectId] >> 16
inMemCtx: memCtx];
}
- (int) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getReplicaKey: data fromGlobCnt: [self objectId] >> 16
inMemCtx: memCtx];
}
/* helper getters */
- (int) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
uint64_t obVersion;
obVersion = [self objectVersion];
@@ -193,10 +193,10 @@ static Class MAPIStoreFolderK;
return rc;
}
- (int) getPidTagChangeNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagChangeNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc;
enum mapistore_error rc;
struct mapistore_connection_info *connInfo;
uint64_t obVersion;
+53 -53
View File
@@ -1,6 +1,6 @@
/* MAPIStoreSharingMessage.h - this file is part of SOGo-OpenChange
*
* Copyright (C) 2015 Enrique J. Hernández
* Copyright (C) 2015-2016 Enrique J. Hernández
*
* Author: Enrique J. Hernández <ejhernandez@zentyal.com>
*
@@ -39,58 +39,58 @@
fromMessage: (MAPIStoreMailMessage *) msg;
/* getters */
- (int) getPidLidSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingConfigurationUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingConfigUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingInitiatorEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingInitiatorName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingInitiatorSmtp: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameXSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTypeXSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingResponseTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidSharingResponseType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidNameContentClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingConfigurationUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingConfigUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingInitiatorEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingInitiatorName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingInitiatorSmtp: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameXSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTypeXSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingResponseTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidLidSharingResponseType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidNameContentClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
/* Save */
- (void) saveWithMessage: (MAPIStoreMailMessage *) msg
+57 -57
View File
@@ -1,6 +1,6 @@
/* MAPIStoreSharingMessage.m - this file is part of SOGo-OpenChange
*
* Copyright (C) 2015 Enrique J. Hernández
* Copyright (C) 2015-2016 Enrique J. Hernández
*
* Author: Enrique J. Hernández <ejhernandez@zentyal.com>
*
@@ -108,8 +108,8 @@
}
- (int) getPidLidSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
@@ -125,8 +125,8 @@
return rc;
}
- (int) getPidNameXSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingCapabilities: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
@@ -143,22 +143,22 @@
return rc;
}
- (int) getPidLidSharingConfigurationUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingConfigurationUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidNameXSharingConfigUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingConfigUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingConfigurationUrl: data inMemCtx: memCtx];
}
- (int) getPidLidSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
/* See [MS-OXSHARE] Section 2.2.2.5 for details */
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
@@ -206,8 +206,8 @@
return rc;
}
- (int) getPidNameXSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingFlavor: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
id value;
@@ -223,8 +223,8 @@
return rc;
}
- (int) getPidLidSharingInitiatorEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingInitiatorEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
id value;
@@ -244,38 +244,38 @@
return rc;
}
- (int) getPidLidSharingInitiatorName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingInitiatorName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-initiatorname"
inData: data
inMemCtx: memCtx];
}
- (int) getPidLidSharingInitiatorSmtp: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingInitiatorSmtp: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-initiatorsmtp"
inData: data
inMemCtx: memCtx];
}
- (int) getPidLidSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-localtype"
inData: data
inMemCtx: memCtx];
}
- (int) getPidNameXSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingLocalType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingLocalType: data inMemCtx: memCtx];
}
- (int) getPidLidSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
const unsigned char providerGuidBytes[] = {0xAE, 0xF0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46};
@@ -284,15 +284,15 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidNameXSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingProviderGuid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"AEF0060000000000C000000000000046" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidLidSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-providername"
@@ -300,84 +300,84 @@
inMemCtx: memCtx];
}
- (int) getPidNameXSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingProviderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingProviderName: data inMemCtx: memCtx];
}
- (int) getPidLidSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-providerurl"
inData: data
inMemCtx: memCtx];
}
- (int) getPidNameXSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingProviderUrl: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingProviderUrl: data inMemCtx: memCtx];
}
- (int) getPidLidSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-remotename"
inData: data
inMemCtx: memCtx];
}
- (int) getPidNameXSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingRemoteName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingRemoteName: data inMemCtx: memCtx];
}
- (int) getPidLidSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-remotestoreuid"
inData: data
inMemCtx: memCtx];
}
- (int) getPidNameXSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameXSharingRemoteStoreUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingRemoteStoreUid: data inMemCtx: memCtx];
}
- (int) getPidLidSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-remotetype"
inData: data
inMemCtx: memCtx];
}
- (int) getPidTypeXSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTypeXSharingRemoteType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingRemoteType: data inMemCtx: memCtx];
}
- (int) getPidLidSharingRemoteUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingRemoteUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self _getStringProperty: @"x-ms-sharing-remoteuid"
inData: data
inMemCtx: memCtx];
}
- (int) getPidUidXSharingRemoteUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidUidXSharingRemoteUid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidLidSharingRemoteUid: data inMemCtx: memCtx];
}
- (int) getPidLidSharingResponseTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingResponseTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
id value;
@@ -403,8 +403,8 @@
return rc;
}
- (int) getPidLidSharingResponseType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidSharingResponseType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
@@ -423,8 +423,8 @@
return rc;
}
- (int) getPidNameContentClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidNameContentClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = talloc_strdup (memCtx, "Sharing");
return MAPISTORE_SUCCESS;
+10 -10
View File
@@ -88,17 +88,17 @@ typedef enum {
- (void) cleanupCaches;
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) localMemCtx;
- (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) localMemCtx;
- (void) setRestrictions: (const struct mapi_SRestriction *) res;
- (int) setColumns: (enum MAPITAGS *) newColumns
withCount: (uint16_t) newColumCount;
- (int) getRow: (struct mapistore_property_data **) dataP
withRowID: (uint32_t) rowId
andQueryType: (enum mapistore_query_type) queryType
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getRowCount: (uint32_t *) countP
withQueryType: (enum mapistore_query_type) queryType;
- (enum mapistore_error) setColumns: (enum MAPITAGS *) newColumns
withCount: (uint16_t) newColumCount;
- (enum mapistore_error) getRow: (struct mapistore_property_data **) dataP
withRowID: (uint32_t) rowId
andQueryType: (enum mapistore_query_type) queryType
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getRowCount: (uint32_t *) countP
withQueryType: (enum mapistore_query_type) queryType;
/* helpers */
+11 -11
View File
@@ -366,8 +366,8 @@ static Class NSDataK, NSStringK;
currentRow = (uint32_t) -1;
}
- (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[isa childObjectClass] getAvailableProperties: propertiesP
inMemCtx: memCtx];
@@ -749,8 +749,8 @@ static Class NSDataK, NSStringK;
}
/* proof of concept */
- (int) setColumns: (enum MAPITAGS *) newColumns
withCount: (uint16_t) newColumnsCount
- (enum mapistore_error) setColumns: (enum MAPITAGS *) newColumns
withCount: (uint16_t) newColumnsCount
{
NSUInteger count;
@@ -831,15 +831,15 @@ static Class NSDataK, NSStringK;
return nil;
}
- (int) getRow: (struct mapistore_property_data **) dataP
withRowID: (uint32_t) rowId
andQueryType: (enum mapistore_query_type) queryType
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getRow: (struct mapistore_property_data **) dataP
withRowID: (uint32_t) rowId
andQueryType: (enum mapistore_query_type) queryType
inMemCtx: (TALLOC_CTX *) memCtx
{
NSUInteger count;
MAPIStoreObject *child;
struct mapistore_property_data *rowData;
int rc;
enum mapistore_error rc;
child = [self childAtRowID: rowId forQueryType: queryType];
if (child)
@@ -858,8 +858,8 @@ static Class NSDataK, NSStringK;
return rc;
}
- (int) getRowCount: (uint32_t *) countP
withQueryType: (enum mapistore_query_type) queryType
- (enum mapistore_error) getRowCount: (uint32_t *) countP
withQueryType: (enum mapistore_query_type) queryType
{
NSArray *children;
+2 -2
View File
@@ -23,9 +23,9 @@
#ifndef MAPISTORETASKSFOLDER_H
#define MAPISTORETASKSFOLDER_H
#import "MAPIStoreGCSFolder.h"
#import "MAPIStoreCalTaskFolder.h"
@interface MAPIStoreTasksFolder : MAPIStoreGCSFolder
@interface MAPIStoreTasksFolder : MAPIStoreCalTaskFolder
@end
+65 -3
View File
@@ -75,6 +75,10 @@
return newMessage;
}
// --------------------------------------------
// Permissions and sharing
// --------------------------------------------
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
{
NSMutableArray *roles;
@@ -82,21 +86,34 @@
roles = [NSMutableArray arrayWithCapacity: 6];
if (rights & RightsCreateItems)
[roles addObject: SOGoRole_ObjectCreator];
if (rights & RightsDeleteAll)
[roles addObject: SOGoRole_ObjectEraser];
if (rights & RightsDeleteOwn)
[roles addObject: MAPIStoreRightDeleteOwn];
if (rights & RightsEditAll)
{
[roles addObject: SOGoCalendarRole_PublicModifier];
[roles addObject: SOGoCalendarRole_PrivateModifier];
[roles addObject: SOGoCalendarRole_ConfidentialModifier];
}
else if (rights & RightsReadItems)
if (rights & RightsEditOwn)
[roles addObject: MAPIStoreRightEditOwn];
if (rights & RightsReadItems)
{
[roles addObject: SOGoCalendarRole_PublicViewer];
[roles addObject: SOGoCalendarRole_PrivateViewer];
[roles addObject: SOGoCalendarRole_ConfidentialViewer];
}
if (rights & RightsFolderOwner)
[roles addObject: MAPIStoreRightFolderOwner];
if (rights & RightsFolderContact)
[roles addObject: MAPIStoreRightFolderContact];
return roles;
}
@@ -116,20 +133,65 @@
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
rights |= RightsReadItems;
if ([roles containsObject: MAPIStoreRightEditOwn])
rights |= RightsEditOwn;
if ([roles containsObject: MAPIStoreRightDeleteOwn])
rights |= RightsDeleteOwn;
if (rights != 0)
rights |= RoleNone; /* actually "folder visible" */
if ([roles containsObject: MAPIStoreRightFolderOwner])
rights |= RightsFolderOwner | RoleNone;
if ([roles containsObject: MAPIStoreRightFolderContact])
rights |= RightsFolderContact;
return rights;
}
- (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);
}
- (BOOL) subscriberCanReadMessages
{
static NSArray *viewerRoles = nil;
if (!viewerRoles)
viewerRoles = [[NSArray alloc] initWithObjects:
SOGoCalendarRole_PublicViewer,
SOGoCalendarRole_PrivateViewer,
SOGoCalendarRole_ConfidentialViewer,
nil];
return ([[self activeUserRoles] firstObjectCommonWithArray: viewerRoles]
!= nil);
}
- (EOQualifier *) aclQualifier
{
return [EOQualifier qualifierWithQualifierFormat:
[(SOGoAppointmentFolder *) sogoObject aclSQLListingFilter]];
}
- (int) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
// --------------------------------------------
// Property getters
// --------------------------------------------
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Task" asUnicodeInMemCtx: memCtx];
+2 -2
View File
@@ -23,9 +23,9 @@
#ifndef MAPISTORETASKSMESSAGE_H
#define MAPISTORETASKSMESSAGE_H
#import "MAPIStoreGCSMessage.h"
#import "MAPIStoreCalTaskMessage.h"
@interface MAPIStoreTasksMessage : MAPIStoreGCSMessage
@interface MAPIStoreTasksMessage : MAPIStoreCalTaskMessage
@end
+107 -66
View File
@@ -68,8 +68,8 @@
@implementation MAPIStoreTasksMessage
- (int) getPidTagIconIndex: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagIconIndex: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
/* see http://msdn.microsoft.com/en-us/library/cc815472.aspx */
// Unassigned recurring task 0x00000501
@@ -83,16 +83,16 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = talloc_strdup(memCtx, "IPM.Task");
return MAPISTORE_SUCCESS;
}
- (int) getPidTagNormalizedSubject: (void **) data // SUMMARY
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data // SUMMARY
inMemCtx: (TALLOC_CTX *) memCtx
{
iCalToDo *task;
@@ -103,10 +103,10 @@
}
/* FIXME: Should be combined somehow with the code in MAPIStoreAppointmentWrapper.m */
- (int) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSString *stringValue;
iCalToDo *task;
@@ -122,21 +122,32 @@
}
/* FIXME: Should be combined somehow with the code in MAPIStoreAppointmentWrapper.m */
- (int) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
inMemCtx: (TALLOC_CTX *) memCtx
{
iCalToDo *task;
task = [sogoObject component: NO secure: YES];
if ([task symbolicAccessClass] == iCalAccessPublic)
if ([task isPublic])
return [self getNo: data inMemCtx: memCtx];
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t v;
v = (uint32_t) [self sensitivity];
*data = MAPILongValue (memCtx, v);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t v;
iCalToDo *task;
@@ -154,8 +165,11 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidLidTaskComplete: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
//------------------------------------
// Specific task related properties
//------------------------------------
- (enum mapistore_error) getPidLidTaskComplete: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
iCalToDo *task;
@@ -166,8 +180,8 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidLidPercentComplete: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidPercentComplete: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
double doubleValue;
iCalToDo *task;
@@ -180,10 +194,10 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidLidTaskDateCompleted: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskDateCompleted: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSCalendarDate *dateValue;
iCalToDo *task;
@@ -198,54 +212,54 @@
return rc;
}
- (int) getPidLidTaskState: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskState: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x1); // not assigned
return MAPISTORE_SUCCESS;
}
- (int) getPidLidTaskMode: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskMode: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidLidTaskFRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskFRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidLidTaskAccepted: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskAccepted: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidLidTaskActualEffort: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskActualEffort: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidLidTaskEstimatedEffort: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskEstimatedEffort: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagHasAttachments: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagHasAttachments: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidLidTaskDueDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskDueDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSCalendarDate *dateValue;
iCalToDo *task;
@@ -259,10 +273,10 @@
return rc;
}
- (int) getPidLidTaskStartDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskStartDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSCalendarDate *dateValue;
iCalToDo *task;
@@ -277,26 +291,26 @@
}
- (int) getPidTagMessageDeliveryTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidTagMessageDeliveryTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagLastModificationTime: data inMemCtx: memCtx];
}
- (int) getClientSubmitTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getClientSubmitTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagLastModificationTime: data inMemCtx: memCtx];
}
- (int) getLocalCommitTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getLocalCommitTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagLastModificationTime: data inMemCtx: memCtx];
}
- (int) getPidLidTaskStatus: (void **) data // status
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskStatus: (void **) data // status
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *status;
uint32_t longValue;
@@ -318,11 +332,12 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidLidTaskOwner: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskOwner: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *owner;
/* FIXME: This is wrong when setting task's request */
owner = [sogoObject ownerInContext: nil];
*data = [owner asUnicodeInMemCtx: memCtx];
@@ -330,31 +345,51 @@
return MAPISTORE_SUCCESS;
}
- (int) getPidLidTaskOwnership: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getPidLidTaskOwnership: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (BOOL) subscriberCanReadMessage
// ----------------------------------
// Sharing
// ----------------------------------
- (NSUInteger) sensitivity
{
return ([[self activeUserRoles]
containsObject: SOGoCalendarRole_ComponentViewer]
|| [self subscriberCanModifyMessage]);
iCalToDo *task;
NSUInteger v;
task = [sogoObject component: NO secure: YES];
/* FIXME: Use OpenChange constants names */
switch ([task symbolicAccessClass])
{
case iCalAccessPrivate:
v = 0x2;
break;
case iCalAccessConfidential:
v = 0x3;
break;
default:
v = 0x0;
break;
}
return v;
}
- (BOOL) subscriberCanModifyMessage
- (NSString *) creator
{
BOOL rc;
NSArray *roles = [self activeUserRoles];
iCalToDo *task;
if (isNew)
rc = [roles containsObject: SOGoRole_ObjectCreator];
else
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
task = [sogoObject component: NO secure: YES];
return [[task uniqueChildWithTag: @"x-sogo-component-created-by"]
flattenedValuesForKey: @""];
}
return rc;
- (NSString *) owner
{
/* This is not true but to allow a user edit its own tasks is required.
FIXME: When PidLidTaskOwner getter is properly implemented for Task Requests */
return [self creator];
}
- (void) save:(TALLOC_CTX *) memCtx
@@ -524,10 +559,16 @@
[vToDo setAccessClass: @"PUBLIC"];
}
/* Creation */
now = [NSCalendarDate date];
if ([sogoObject isNew])
{
[vToDo setCreated: now];
/* Creator is used for sharing purposes */
value = [properties objectForKey: MAPIPropertyKey (PidTagLastModifierName)];
if (value)
[[vToDo uniqueChildWithTag: @"x-sogo-component-created-by"] setSingleValue: value
forKey: @""];
}
[vToDo setTimeStampAsDate: now];
+8 -8
View File
@@ -41,16 +41,16 @@ struct MAPIStoreTallocWrapper
@interface NSObject (MAPIStoreDataTypes)
- (int) getValue: (void **) data
forTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getValue: (void **) data
forTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx;
/* getter helpers */
- (int) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
@end
+9 -9
View File
@@ -74,12 +74,12 @@ MAPIStoreTallocWrapperDestroy (void *data)
@implementation NSObject (MAPIStoreDataTypes)
- (int) getValue: (void **) data
forTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getValue: (void **) data
forTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
{
uint16_t valueType;
int rc = MAPISTORE_SUCCESS;
enum mapistore_error rc = MAPISTORE_SUCCESS;
// [self logWithFormat: @"property %.8x found", propTag];
valueType = (propTag & 0xffff);
@@ -139,35 +139,35 @@ MAPIStoreTallocWrapperDestroy (void *data)
}
/* helper getters */
- (int) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getEmptyString: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getLongZero: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0);
return MAPISTORE_SUCCESS;
}
- (int) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getYes: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPIBoolValue (memCtx, YES);
return MAPISTORE_SUCCESS;
}
- (int) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getNo: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPIBoolValue (memCtx, NO);
return MAPISTORE_SUCCESS;
}
- (int) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
- (enum mapistore_error) getSMTPAddrType: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"SMTP" asUnicodeInMemCtx: memCtx];
+30 -22
View File
@@ -32,7 +32,7 @@
#define DEFAULT_CHARSET 1
#define FONTNAME_LEN_MAX 100
#define UTF8_FIRST_BYTE_LAST_CODEPOINT 0x7F
//
// Charset definitions. See http://msdn.microsoft.com/en-us/goglobal/bb964654 for all details.
//
@@ -608,7 +608,6 @@ static void _init_fontCws_table()
word and is not part of the control word. */
end = _bytes;
*len = end-start-1;
return start+1;
@@ -1215,7 +1214,6 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
unsigned char c;
NSData *d;
NSString *s;
unichar uch;
stack = [[RTFStack alloc] init];
fontTable = nil;
@@ -1223,7 +1221,7 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
defaultCharset = ansicpg1252;
formattingOptions = nil;
_html = [[NSMutableData alloc] init];
_html = [[[NSMutableData alloc] init] autorelease];
[_html appendBytes: "<html><meta charset='utf-8'><body>" length: 34];
@@ -1251,10 +1249,10 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
{
// A hexadecimal value, based on the specified character set (may be used to identify 8-bit values).
const char *b1, *b2;
unsigned short index;
short index;
short tmp;
const unsigned short * active_charset;
if (formattingOptions && formattingOptions->charset)
active_charset = formattingOptions->charset;
else
@@ -1267,8 +1265,21 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
b1 = ADVANCE;
b2 = ADVANCE;
index = (isdigit(*b1) ? *b1 - 48 : toupper(*b1) - 55) * 16;
index += (isdigit(*b2) ? *b2 - 48 : toupper(*b2) - 55);
tmp = (isdigit(*b1) ? *b1 - 48 : toupper(*b1) - 55);
if (tmp < 0 || tmp > 16)
{
// Incorrect first hexadecimal character. Skipping.
continue;
}
index = tmp*16;
tmp = (isdigit(*b2) ? *b2 - 48 : toupper(*b2) - 55);
if (tmp < 0 || tmp > 16)
{
// Incorrect second hexadecimal character. Skipping.
continue;
}
index += tmp;
s = [NSString stringWithCharacters: &(active_charset[index]) length: 1];
d = [s dataUsingEncoding: NSUTF8StringEncoding];
@@ -1437,20 +1448,17 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
{
c = *_bytes;
// We avoid appending NULL bytes or endlines
if (c && (c != '\n'))
if (c && (c != '\n') && (c != '\r'))
{
if (c <= UTF8_FIRST_BYTE_LAST_CODEPOINT)
{
// in this case utf8 and ascii encoding are the same
[_html appendBytes: &c length: 1];
}
else
{
uch = c;
s = [NSString stringWithCharacters: &uch length: 1];
d = [s dataUsingEncoding: NSUTF8StringEncoding];
[_html appendData: d];
}
const unsigned short * active_charset;
if (formattingOptions && formattingOptions->charset)
active_charset = formattingOptions->charset;
else
active_charset = defaultCharset;
s = [NSString stringWithCharacters: &(active_charset[c]) length: 1];
d = [s dataUsingEncoding: NSUTF8StringEncoding];
[_html appendData: d];
}
ADVANCE;
}
@@ -1459,7 +1467,7 @@ inline static void parseUl(RTFHandler *self, BOOL hasArg, int arg, RTFFormatting
[_html appendBytes: "</body></html>" length: 14];
[stack release];
return [_html autorelease];
return _html;
}
/* This method is for ease of testing and should not be used in normal operations */
+2 -2
View File
@@ -20,8 +20,8 @@
* Boston, MA 02111-1307, USA.
*/
typedef int (*MAPIStorePropertyGetter) (id inst, SEL _cmd,
void **data, TALLOC_CTX *memCtx);
typedef enum mapistore_error (*MAPIStorePropertyGetter) (id inst, SEL _cmd,
void **data, TALLOC_CTX *memCtx);
const MAPIStorePropertyGetter *MAPIStorePropertyGettersForClass (Class klass);
SEL MAPIStoreSelectorForPropertyGetter (uint16_t propertyId);
+1 -1
View File
@@ -235,7 +235,7 @@ if __name__ == "__main__":
highest_prop_idx = prop_idx
getters.append(" @selector (get%s:inMemCtx:)" % name)
# preferred_types.append(" 0x%.4x" % (prop_tag & 0xffff))
prototypes.append("- (int) get%s: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;" % name)
prototypes.append("- (enum mapistore_error) get%s: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;" % name)
current_getter_idx = current_getter_idx + 1
# setters[prop_idx] = " @selector (set%s:)" % name
# prototypes.append("- (int) set%s: (void **) data;" % name)
+1
View File
@@ -37,6 +37,7 @@
- (void) updateFromMAPIProperties: (NSDictionary *) properties
inUserContext: (MAPIStoreUserContext *) userContext
withActiveUser: (SOGoUser *) activeUser
isNew: (BOOL) isNew
inMemCtx: (TALLOC_CTX *) memCtx;
@end
+9
View File
@@ -247,6 +247,7 @@
- (void) updateFromMAPIProperties: (NSDictionary *) properties
inUserContext: (MAPIStoreUserContext *) userContext
withActiveUser: (SOGoUser *) activeUser
isNew: (BOOL) isNew
inMemCtx: (TALLOC_CTX *) memCtx
{
BOOL isAllDay;
@@ -573,6 +574,14 @@
}
}
}
// Creator (with sharing purposes)
if (isNew)
{
value = [properties objectForKey: MAPIPropertyKey (PidTagLastModifierName)];
if (value)
[[self uniqueChildWithTag: @"x-sogo-component-created-by"] setSingleValue: value
forKey: @""];
}
}
@end
+36 -18
View File
@@ -186,29 +186,44 @@ static NSArray *knownTimeZones;
return [[self uniqueChildWithTag: @"tzid"] flattenedValuesForKey: @""];
}
- (NSCalendarDate *) _occurrenceForPeriodNamed: (NSString *) pName
- (NSDictionary *) _occurrenceForPeriodNamed: (NSString *) pName
forDate: (NSCalendarDate *) aDate
{
NSArray *periods;
NSEnumerator *periodsList;
iCalTimeZonePeriod *period;
NSCalendarDate *occurrence;
NSDictionary *periodDict;
occurrence = nil;
periodDict = nil;
periods = [[self childrenWithTag: pName]
sortedArrayUsingSelector: @selector (compare:)];
periodsList = [periods reverseObjectEnumerator];
while (!occurrence
&& (period = (iCalTimeZonePeriod *) [periodsList nextObject]))
occurrence = [period occurrenceForDate: aDate];
while ((period = (iCalTimeZonePeriod *) [periodsList nextObject]))
{
if ([periods count] > 1 && ([[period startDate] yearOfCommonEra] > [aDate yearOfCommonEra]))
continue;
return occurrence;
occurrence = [period occurrenceForDate: aDate];
if (occurrence && (!periodDict || [occurrence earlierDate: [periodDict objectForKey: @"occurrence"]] == [periodDict objectForKey: @"occurrence"]))
{
periodDict = [NSDictionary dictionaryWithObjectsAndKeys:
period, @"period",
occurrence, @"occurrence",nil];
occurrence = nil;
}
}
return periodDict;
}
- (iCalTimeZonePeriod *) periodForDate: (NSCalendarDate *) date
{
NSCalendarDate *daylightOccurence, *standardOccurence;
//NSCalendarDate *daylightOccurence, *standardOccurence;
NSDictionary *daylightOccurence, *standardOccurence;
iCalTimeZonePeriod *period;
/* FIXME, this could cause crashes when timezones are not properly
@@ -216,30 +231,33 @@ static NSArray *knownTimeZones;
daylightOccurence = [self _occurrenceForPeriodNamed: @"daylight"
forDate: date];
standardOccurence = [self _occurrenceForPeriodNamed: @"standard"
forDate: date];
if (!standardOccurence)
if (!standardOccurence && !daylightOccurence)
period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"];
else if (!standardOccurence)
period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"];
else if (!daylightOccurence)
period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"];
else if ([date earlierDate: daylightOccurence] == date)
else if ([date earlierDate: [daylightOccurence objectForKey: @"occurrence"]] == date)
{
if ([date earlierDate: standardOccurence] == date
&& ([standardOccurence earlierDate: daylightOccurence]
== standardOccurence))
period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"];
if ([date earlierDate: [standardOccurence objectForKey: @"occurrence"]] == date
&& ([[standardOccurence objectForKey: @"occurrence"] earlierDate: [daylightOccurence objectForKey: @"occurrence"]]
== [standardOccurence objectForKey: @"occurrence"]))
period = (iCalTimeZonePeriod *) [daylightOccurence objectForKey: @"period"];
else
period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"];
period = (iCalTimeZonePeriod *) [standardOccurence objectForKey: @"period"];
}
else
{
if ([standardOccurence earlierDate: date] == standardOccurence
&& ([daylightOccurence earlierDate: standardOccurence]
== daylightOccurence))
period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"standard"];
if ([[standardOccurence objectForKey: @"occurrence"] earlierDate: date] == [standardOccurence objectForKey: @"occurrence"]
&& ([[daylightOccurence objectForKey: @"occurrence"] earlierDate: [standardOccurence objectForKey: @"occurrence"]]
== [daylightOccurence objectForKey: @"occurrence"] ))
period = (iCalTimeZonePeriod *) [standardOccurence objectForKey: @"period"];
else
period = (iCalTimeZonePeriod *) [self uniqueChildWithTag: @"daylight"];
period = (iCalTimeZonePeriod *) [daylightOccurence objectForKey: @"period"];
}
return period;
+46
View File
@@ -38,6 +38,8 @@
if ([classTag isEqualToString: @"RRULE"])
tagClass = [iCalRecurrenceRule class];
else if ([classTag isEqualToString: @"RDATE"])
tagClass = [iCalDateTime class];
else if ([classTag isEqualToString: @"DTSTART"])
tagClass = [iCalDateTime class];
else if ([classTag isEqualToString: @"TZOFFSETFROM"]
@@ -64,6 +66,10 @@
offsetTo = [[self uniqueChildWithTag: offsetName]
flattenedValuesForKey: @""];
length = [offsetTo length];
if (!length)
return seconds;
negative = [offsetTo hasPrefix: @"-"];
if (negative)
{
@@ -244,19 +250,59 @@
return tmpDate;
}
- (NSCalendarDate *) _occurrenceFromRdate: (NSCalendarDate *) refDate
rDates: (NSArray *) rDatesIn;
{
NSArray *rDates;
NSEnumerator *dateList;
NSCalendarDate *rDateCur, *rDateOut;
NSString *dateString;
unsigned i;
rDateCur = nil;
rDateOut = nil;
dateList = [rDatesIn objectEnumerator];
while ((dateString = [dateList nextObject]))
{
rDates = [(iCalDateTime*) dateString dateTimes];
for (i = 0; i < [rDates count]; i++)
{
rDateCur = [rDates objectAtIndex: i];
if (!rDateOut || ([rDateCur yearOfCommonEra] > [rDateOut yearOfCommonEra] && [refDate yearOfCommonEra] >= [rDateCur yearOfCommonEra]))
rDateOut = rDateCur;
}
}
return rDateOut;
}
- (NSCalendarDate *) occurrenceForDate: (NSCalendarDate *) refDate;
{
NSCalendarDate *tmpDate;
iCalRecurrenceRule *rrule;
NSArray *rDates;
tmpDate = nil;
rrule = (iCalRecurrenceRule *) [self uniqueChildWithTag: @"rrule"];
rDates = (NSArray *) [self childrenWithTag: @"rdate"];
if ([rDates count])
{
tmpDate = [self _occurrenceFromRdate: refDate rDates: rDates];
return tmpDate;
}
if ([rrule isVoid])
tmpDate
= [(iCalDateTime *) [self uniqueChildWithTag: @"dtstart"] dateTime];
else if ([rrule untilDate] == nil || [refDate compare: [rrule untilDate]] == NSOrderedAscending)
tmpDate = [self _occurrenceForDate: refDate byRRule: rrule];
else if ([refDate compare: [rrule untilDate]] == NSOrderedDescending)
tmpDate = [rrule untilDate];
return tmpDate;
}
+1
View File
@@ -1,6 +1,7 @@
[Unit]
Description=SOGo is a groupware server
After=network.target
After=mariadb.service
[Service]
Environment="PREFORK=3"
@@ -1,16 +1,16 @@
"Inviting the following persons is prohibited:" = "Uitnodigen van de volgende personen is niet toegestaan:";
"Personal Calendar" = "Persoonlijke agenda";
vevent_class0 = "(Publieke afspraak)";
vevent_class1 = "(Privé-gebeurtenis)";
vevent_class2 = "(Vertrouwelijke gebeurtenis)";
vevent_class1 = "(Privé-afspraak)";
vevent_class2 = "(Vertrouwelijke afspraak)";
vtodo_class0 = "(Publieke taak)";
vtodo_class1 = "(Privétaak)";
vtodo_class2 = "(Vertrouwelijke taak)";
/* Receipts */
"The event \"%{Summary}\" was created" = "De gebeurtenis \"%{Summary}\" is aangemaakt";
"The event \"%{Summary}\" was deleted" = "De gebeurtenis \"%{Summary}\" is verwijderd";
"The event \"%{Summary}\" was updated" = "De gebeurtenis \"%{Summary}\" is gewijzigd";
"The event \"%{Summary}\" was created" = "De afspraak \"%{Summary}\" is aangemaakt";
"The event \"%{Summary}\" was deleted" = "De afspraak \"%{Summary}\" is verwijderd";
"The event \"%{Summary}\" was updated" = "De afspraak \"%{Summary}\" is gewijzigd";
"The following attendees(s) were notified" = "De volgende deelnemers zijn in kennis gesteld";
"The following attendees(s) were added" = "De volgende deelnemers zijn toegevoegd";
"The following attendees(s) were removed" = "De volgende deelnemers zijn verwijderd";
@@ -23,38 +23,38 @@ vtodo_class2 = "(Vertrouwelijke taak)";
"summary_label" = "Samenvatting:";
"comment_label" = "Commentaar:";
/* Invitation */
"Event Invitation: \"%{Summary}\"" = "Uitnodiging voor gebeurtenis: \"%{Summary}\"";
"Event Invitation: \"%{Summary}\"" = "Uitnodiging voor afspraak: \"%{Summary}\"";
"(sent by %{SentBy}) " = "(Verzonden door %{SentBy})";
"%{Organizer} %{SentByText}has invited you to %{Summary}.\n\nStart: %{StartDate}\nEnd: %{EndDate}\nDescription: %{Description}" = "%{Organizer} %{SentByText}heeft u uitgenodigd voor: %{Summary}.\n\nBegin: %{StartDate}\nEinde: %{EndDate}\nBeschrijving: %{Description}";
"%{Organizer} %{SentByText}has invited you to %{Summary}.\n\nStart: %{StartDate} at %{StartTime}\nEnd: %{EndDate} at %{EndTime}\nDescription: %{Description}" = "%{Organizer} %{SentByText}heeft u uitgenodigd voor %{Summary}.\n\nStart: %{StartDate} om %{StartTime}\nEinde: %{EndDate} om %{EndTime}\nOmschrijving: %{Description}";
/* Deletion */
"Event Cancelled: \"%{Summary}\"" = "Gebeurtenis geannuleerd: \"%{Summary}\"";
"Event Cancelled: \"%{Summary}\"" = "Afspraak geannuleerd: \"%{Summary}\"";
"%{Organizer} %{SentByText}has cancelled this event: %{Summary}.\n\nStart: %{StartDate}\nEnd: %{EndDate}\nDescription: %{Description}"
= "%{Organizer} %{SentByText}heeft deze gebeurtenis afgezegd: %{Summary}.\n\nBegin: %{StartDate}\nEinde: %{EndDate}\nBeschrijving: %{Description}";
= "%{Organizer} %{SentByText}heeft deze afspraak afgezegd: %{Summary}.\n\nBegin: %{StartDate}\nEinde: %{EndDate}\nBeschrijving: %{Description}";
"%{Organizer} %{SentByText}has cancelled this event: %{Summary}.\n\nStart: %{StartDate} at %{StartTime}\nEnd: %{EndDate} at %{EndTime}\nDescription: %{Description}"
= "%{Organizer} %{SentByText}heeft de gebeurtenis: %{Summary} geannuleerd.\n\nStart: %{StartDate} om %{StartTime}\nEinde: %{EndDate} om %{EndTime}\nOmschrijving: %{Description}";
= "%{Organizer} %{SentByText}heeft de afspraak: %{Summary} geannuleerd.\n\nStart: %{StartDate} om %{StartTime}\nEinde: %{EndDate} om %{EndTime}\nOmschrijving: %{Description}";
/* Update */
"The appointment \"%{Summary}\" for the %{OldStartDate} has changed"
= "De gebeurtenis \"%{Summary}\" op %{OldStartDate} is veranderd.";
= "De afspraak \"%{Summary}\" op %{OldStartDate} is veranderd.";
"The appointment \"%{Summary}\" for the %{OldStartDate} at %{OldStartTime} has changed"
= "De gebeurtenis \"%{Summary}\" op %{OldStartDate} om %{OldStartTime} is gewijzigd";
= "De afspraak \"%{Summary}\" op %{OldStartDate} om %{OldStartTime} is gewijzigd";
"The following parameters have changed in the \"%{Summary}\" meeting:"
= "De volgende parameters zijn veranderd in de \"%{Summary}\" vergadering:";
"Please accept or decline those changes."
= "Accepteer deze wijzigingen of wijs ze af.";
/* Reply */
"Accepted invitation: \"%{Summary}\"" = "Uitnodiging aanvaard: \"%{Summary}\"";
"Accepted invitation: \"%{Summary}\"" = "Uitnodiging geaccepteerd: \"%{Summary}\"";
"Declined invitation: \"%{Summary}\"" = "Uitnodiging afgewezen: \"%{Summary}\"";
"Delegated invitation: \"%{Summary}\"" = "Uitnodiging gedelegeerd: \"%{Summary}\"";
"Not yet decided on invitation: \"%{Summary}\"" = "Nog niet besloten over uitnodiging: \"%{Summary}\"";
"%{Attendee} %{SentByText}has accepted your event invitation."
= "%{Attendee} %{SentByText}heeft uw uitnodiging voor de gebeurtenis geaccepteerd.";
= "%{Attendee} %{SentByText}heeft uw uitnodiging voor de afspraak geaccepteerd.";
"%{Attendee} %{SentByText}has declined your event invitation."
= "%{Attendee} %{SentByText}heeft uw uitnodiging voor de gebeurtenis geweigerd.";
= "%{Attendee} %{SentByText}heeft uw uitnodiging voor de afspraak geweigerd.";
"%{Attendee} %{SentByText}has delegated the invitation to %{Delegate}."
= "%{Attendee} %{SentByText}heeft de uitnodiging gedelegeerd aan %{Delegate}.";
"%{Attendee} %{SentByText}has not yet decided upon your event invitation."
= "%{Attendee} %{SentByText}heeft nog niet gereageerd op uw uitnodiging.";
/* Resources */
"Cannot access resource: \"%{Cn} %{SystemEmail}\"" = "Kan bron \"%{Cn} %{SystemEmail}\" niet benaderen";
"Maximum number of simultaneous bookings (%{NumberOfSimultaneousBookings}) reached for resource \"%{Cn} %{SystemEmail}\". The conflicting event is \"%{EventTitle}\", and starts on %{StartDate}." = "Het maximale aantal gelijktijdige reserveringen (%{NumberOfSimultaneousBookings}) voor \"%{Cn} %{SystemEmail}\" is bereikt. De conflicterende gebeurtenis is \"%{EventTitle}\" en begint op %{StartDate}.";
"Maximum number of simultaneous bookings (%{NumberOfSimultaneousBookings}) reached for resource \"%{Cn} %{SystemEmail}\". The conflicting event is \"%{EventTitle}\", and starts on %{StartDate}." = "Het maximale aantal gelijktijdige reserveringen (%{NumberOfSimultaneousBookings}) voor \"%{Cn} %{SystemEmail}\" is bereikt. De conflicterende afspraak is \"%{EventTitle}\" en begint op %{StartDate}.";
+1 -1
View File
@@ -54,7 +54,7 @@ Appointments_RESOURCE_FILES += \
MSExchangeFreeBusySOAPResponseMap.plist \
MSExchangeFreeBusySOAPRequest.wo
Appointments_LANGUAGES = Arabic Basque BrazilianPortuguese Catalan ChineseTaiwan Croatian Czech Danish Dutch English Finnish French German Hungarian Icelandic Italian Lithuanian Macedonian NorwegianBokmal NorwegianNynorsk Polish Portuguese Russian Slovak Slovenian SpanishSpain SpanishArgentina Swedish Ukrainian Welsh
Appointments_LANGUAGES = $(SOGO_LANGUAGES)
Appointments_LOCALIZED_RESOURCE_FILES = Localizable.strings
@@ -1,4 +1,4 @@
"Inviting the following persons is prohibited:" = "Convidando as seguintes pessoas é proibido:";
"Inviting the following persons is prohibited:" = "Convidar as seguintes pessoas é proibido:";
"Personal Calendar" = "Calendário Pessoal";
vevent_class0 = "(Evento Público)";
vevent_class1 = "(Evento Privado)";
@@ -11,9 +11,9 @@ vtodo_class2 = "(Tarefa Confidencial)";
"The event \"%{Summary}\" was created" = "O evento \"%{Summary}\" foi criado";
"The event \"%{Summary}\" was deleted" = "O evento \"%{Summary}\" foi removido";
"The event \"%{Summary}\" was updated" = "O evento \"%{Summary}\" foi atualizado";
"The following attendees(s) were notified:" = "Os seguintes participantes foram notificados:";
"The following attendees(s) were added:" = "Os seguintes participantes foram adicionados:";
"The following attendees(s) were removed:" = "Os seguintes participantes foram removidos:";
"The following attendees(s) were notified" = "Os seguintes participantes foram notificados:";
"The following attendees(s) were added" = "Os seguintes participantes foram adicionados:";
"The following attendees(s) were removed" = "Os seguintes participantes foram removidos:";
/* IMIP messages */
"calendar_label" = "Calendário:";
"startDate_label" = "Início:";
+70 -47
View File
@@ -766,7 +766,7 @@ static Class iCalEventK = nil;
NSCalendarDate *date;
NSNumber *dateValue;
BOOL isAllDay;
unsigned int offset;
NSInteger offset;
isAllDay = [[theRecord objectForKey: @"c_isallday"] boolValue];
record = [[theRecord mutableCopy] autorelease];
@@ -979,12 +979,16 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
withTimeZone: (NSTimeZone *) tz
toArray: (NSMutableArray *) ma
{
NGCalendarDateRange *recurrenceIdRange;
NSCalendarDate *recurrenceId;
NSMutableDictionary *newRecord;
NGCalendarDateRange *newRecordRange;
NSComparisonResult compare;
int recordIndex, secondsOffsetFromGMT;
NSNumber *dateSecs;
id master;
int recordIndex, secondsOffsetFromGMT;
NSTimeInterval delta;
newRecord = nil;
recurrenceId = [component recurrenceId];
@@ -1006,17 +1010,20 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
[recurrenceId setTimeZone: tz];
}
compare = [[dateRange startDate] compare: recurrenceId];
if ((compare == NSOrderedAscending || compare == NSOrderedSame) &&
[[dateRange endDate] compare: recurrenceId] == NSOrderedDescending)
master = [[[component parent] events] objectAtIndex: 0];
delta = [[master endDate] timeIntervalSinceDate: [master startDate]];
recurrenceIdRange = [NGCalendarDateRange calendarDateRangeWithStartDate: recurrenceId
endDate: [recurrenceId dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds: delta]];
if ([dateRange doesIntersectWithDateRange: recurrenceIdRange])
{
// The recurrence exception intersects with the date range;
// find the occurence and replace it with the new record
recordIndex = [self _indexOfRecordMatchingDate: recurrenceId inArray: ma];
if (recordIndex > -1)
{
if ([dateRange containsDate: [component startDate]])
{
if ([dateRange containsDate: [component startDate]] ||
[dateRange containsDate: [component endDate]])
{
// We must pass nil to :container here in order to avoid re-entrancy issues.
newRecord = [self _fixupRecord: [component quickRecordFromContent: nil container: nil]];
[ma replaceObjectAtIndex: recordIndex withObject: newRecord];
@@ -2131,7 +2138,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
[content addObject: davElementWithContent (@"request-status", XMLNS_CALDAV,
@"2.0;Success")];
[content addObject: davElementWithContent (@"calendar-data", XMLNS_CALDAV,
[calendarData stringByEscapingXMLString])];
[calendarData safeStringByEscapingXMLString])];
}
else
[content addObject:
@@ -3300,12 +3307,60 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
}
/* acls */
/* Compare two permissions to set first the highest access right, if unknown, then
do nothing */
static NSComparisonResult _comparePermissions (id perm1, id perm2, void *context)
{
static NSDictionary *permMap = nil;
NSNumber *num_1, *num_2;
if (!permMap)
{
NSMutableArray *numberObjs;
NSUInteger i, max = 16;
numberObjs = [NSMutableArray arrayWithCapacity: max];
for (i = 0; i < max; i++)
[numberObjs addObject: [NSNumber numberWithInteger: i]];
/* Build the map to compare easily */
permMap = [[NSDictionary alloc] initWithObjects: numberObjs
forKeys: [NSArray arrayWithObjects:
SOGoRole_ObjectEraser,
SOGoRole_ObjectCreator,
SOGoRole_ObjectEditor,
SOGoCalendarRole_ConfidentialModifier,
SOGoCalendarRole_ConfidentialResponder,
SOGoCalendarRole_ConfidentialViewer,
SOGoCalendarRole_ConfidentialDAndTViewer,
SOGoCalendarRole_PrivateModifier,
SOGoCalendarRole_PrivateResponder,
SOGoCalendarRole_PrivateViewer,
SOGoCalendarRole_PrivateDAndTViewer,
SOGoCalendarRole_PublicModifier,
SOGoCalendarRole_PublicResponder,
SOGoCalendarRole_PublicViewer,
SOGoCalendarRole_PublicDAndTViewer,
SOGoCalendarRole_FreeBusyReader, nil]];
[permMap retain];
}
num_1 = [permMap objectForKey: perm1];
if (!num_1)
num_1 = [NSNumber numberWithInteger: 255];
num_2 = [permMap objectForKey: perm2];
if (!num_2)
num_2 = [NSNumber numberWithInteger: 255];
return [num_1 compare: num_2];
}
- (NSArray *) aclsForUser: (NSString *) uid
forObjectAtPath: (NSArray *) objectPathArray
{
NSMutableArray *aclsForUser;
NSArray *superAcls;
static NSArray *rolesClassifications = nil;
superAcls = [super aclsForUser: uid forObjectAtPath: objectPathArray];
if ([uid isEqualToString: [self defaultUserID]])
@@ -3321,44 +3376,12 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
}
else
{
aclsForUser = [NSMutableArray array];
if (!rolesClassifications)
{
rolesClassifications =
[NSArray arrayWithObjects:
[NSArray arrayWithObjects:
SOGoCalendarRole_PublicModifier,
SOGoCalendarRole_PublicResponder,
SOGoCalendarRole_PublicViewer,
SOGoCalendarRole_PublicDAndTViewer,
nil],
[NSArray arrayWithObjects:
SOGoCalendarRole_ConfidentialModifier,
SOGoCalendarRole_ConfidentialResponder,
SOGoCalendarRole_ConfidentialViewer,
SOGoCalendarRole_ConfidentialDAndTViewer,
nil],
[NSArray arrayWithObjects:
SOGoCalendarRole_PrivateModifier,
SOGoCalendarRole_PrivateResponder,
SOGoCalendarRole_PrivateViewer,
SOGoCalendarRole_PrivateDAndTViewer,
nil],
[NSArray arrayWithObject: SOGoRole_ObjectCreator],
[NSArray arrayWithObject: SOGoRole_ObjectEraser],
nil];
[rolesClassifications retain];
}
// When a user is a member of many groups for which there are access rights, multiple access rights
// can be returned for each classification. In this case, we only keep the highest access right.
int i, count = [rolesClassifications count];
NSString *role;
for (i = 0; i < count; i++)
{
role = [[rolesClassifications objectAtIndex: i] firstObjectCommonWithArray: superAcls];
if (role)
[aclsForUser addObject: role];
}
/* Sort setting the highest access right first, so in the case
of a user member of several groups, the highest access right
is checked first, for instance, in
[SOGoAppointmentFolder:roleForComponentsWithAccessClass:forUser] */
aclsForUser = (NSMutableArray *) [superAcls sortedArrayUsingFunction: _comparePermissions
context: NULL];
}
return aclsForUser;
@@ -1,7 +1,7 @@
/* SOGoAppointmentFolders.m - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2016 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -740,9 +740,14 @@ static SoSecurityManager *sm = nil;
aclUser = [aclUsers objectAtIndex: userCount];
if (![subscribers containsObject: aclUser])
{
currentUser = [SOGoUser userWithLogin: aclUser];
if ([currentUser hasSubscribedToCalendar: currentFolder])
[subscribers addObject: aclUser];
if ([aclUser hasPrefix: @"@"])
[subscribers addObject: aclUser];
else
{
currentUser = [SOGoUser userWithLogin: aclUser];
if ([currentUser hasSubscribedToCalendar: currentFolder])
[subscribers addObject: aclUser];
}
}
}
}
+31 -42
View File
@@ -138,7 +138,7 @@
}
- (SOGoAppointmentObject *) _lookupEvent: (NSString *) eventUID
forUID: (NSString *) uid
forUID: (NSString *) uid
{
SOGoAppointmentFolder *folder;
SOGoAppointmentObject *object;
@@ -567,9 +567,9 @@
values = [NSDictionary dictionaryWithObjectsAndKeys:
[user cn], @"Cn",
[user systemEmail], @"SystemEmail"];
[user systemEmail], @"SystemEmail"], nil;
reason = [values keysWithFormat: [self labelForKey: @"Cannot access resource: \"%{Cn} %{SystemEmail}\""]];
return [NSException exceptionWithHTTPStatus:403 reason: reason];
return [NSException exceptionWithHTTPStatus:409 reason: reason];
}
fbInfo = [NSMutableArray arrayWithArray: [folder fetchFreeBusyInfosFrom: start
@@ -676,7 +676,7 @@
reason = [values keysWithFormat: [self labelForKey: @"Maximum number of simultaneous bookings (%{NumberOfSimultaneousBookings}) reached for resource \"%{Cn} %{SystemEmail}\". The conflicting event is \"%{EventTitle}\", and starts on %{StartDate}."]];
return [NSException exceptionWithHTTPStatus: 403
return [NSException exceptionWithHTTPStatus: 409
reason: reason];
}
}
@@ -1469,14 +1469,14 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
if (delegatedUid)
delegatedUser = [SOGoUser userWithLogin: delegatedUid];
if (delegatedUser != nil && [event userIsOrganizer: delegatedUser])
ex = [NSException exceptionWithHTTPStatus: 403
ex = [NSException exceptionWithHTTPStatus: 409
reason: @"delegate is organizer"];
if ([event isAttendee: [[delegate email] rfc822Email]])
ex = [NSException exceptionWithHTTPStatus: 403
ex = [NSException exceptionWithHTTPStatus: 409
reason: @"delegate is a participant"];
else if ([SOGoGroup groupWithEmail: [[delegate email] rfc822Email]
inDomain: [ownerUser domain]])
ex = [NSException exceptionWithHTTPStatus: 403
ex = [NSException exceptionWithHTTPStatus: 409
reason: @"delegate is a group"];
}
if (ex == nil)
@@ -1722,37 +1722,6 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
}
}
- (void) _adjustClassificationInRequestCalendar: (iCalCalendar *) rqCalendar
{
SOGoUserDefaults *userDefaults;
NSString *accessClass;
NSArray *allObjects;
id entity;
int i;
userDefaults = [[context activeUser] userDefaults];
allObjects = [rqCalendar allObjects];
for (i = 0; i < [allObjects count]; i++)
{
entity = [allObjects objectAtIndex: i];
if ([entity respondsToSelector: @selector(accessClass)])
{
accessClass = [entity accessClass];
if (!accessClass || [accessClass length] == 0)
{
if ([entity isKindOfClass: [iCalEvent class]])
[entity setAccessClass: [userDefaults calendarEventsDefaultClassification]];
else if ([entity isKindOfClass: [iCalToDo class]])
[entity setAccessClass: [userDefaults calendarTasksDefaultClassification]];
}
}
}
}
//
// iOS devices (and potentially others) send event invitations with no PARTSTAT defined.
// This confuses DAV clients like Thunderbird, or event SOGo web. The RFC says:
@@ -1969,7 +1938,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
}
[self _adjustEventsInRequestCalendar: calendar];
[self _adjustClassificationInRequestCalendar: calendar];
[self adjustClassificationInRequestCalendar: calendar];
[self _adjustPartStatInRequestCalendar: calendar];
}
@@ -1993,7 +1962,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
// TODO: send out a no-uid-conflict (DAV:href) xml element (rfc4791 section 5.3.2.1)
if ([container resourceNameForEventUID: eventUID])
{
return [NSException exceptionWithHTTPStatus: 403
return [NSException exceptionWithHTTPStatus: 409
reason: [NSString stringWithFormat: @"Event UID already in use. (%@)", eventUID]];
}
@@ -2153,6 +2122,26 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
if (userIsOrganizer)
{
// We check ACLs of the 'organizer' - in case someone forges the SENT-BY
NSString *uid;
uid = [[oldEvent organizer] uidInContext: context];
if (uid && [[[context activeUser] login] caseInsensitiveCompare: uid] != NSOrderedSame)
{
SOGoAppointmentObject *organizerObject;
organizerObject = [self _lookupEvent: [oldEvent uid] forUID: uid];
roles = [[context activeUser] rolesForObject: organizerObject
inContext: context];
if (![roles containsObject: @"ComponentModifier"])
{
return [NSException exceptionWithHTTPStatus: 409
reason: @"Not allowed to perform this action. Wrong SENT-BY being used regarding access rights on organizer's calendar."];
}
}
// A RECCURENCE-ID was removed
if (!newEvent && oldEvent)
[self prepareDeleteOccurence: oldEvent];
@@ -2201,9 +2190,9 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
}
// We first check of the sequences are alright. We don't accept attendees
// accepting "old" invitations. If that's the case, we return a 403
// accepting "old" invitations. If that's the case, we return a 409
if ([[newEvent sequence] intValue] < [[oldEvent sequence] intValue])
return [NSException exceptionWithHTTPStatus: 403
return [NSException exceptionWithHTTPStatus: 409
reason: @"sequences don't match"];
// Remove the RSVP attribute, as an action from the attendee
@@ -93,6 +93,8 @@
- (void) snoozeAlarm: (unsigned int) minutes;
- (void) adjustClassificationInRequestCalendar: (iCalCalendar *) rqCalendar;
@end
#endif /* SOGOCALENDARCOMPONENT_H */
+73 -15
View File
@@ -47,6 +47,7 @@
#import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/NSObject+DAV.h>
#import <SOGo/NSObject+Utilities.h>
#import <SOGo/NSString+Crypto.h>
#import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoBuild.h>
#import <SOGo/SOGoDomainDefaults.h>
@@ -55,6 +56,7 @@
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import <SOGo/SOGoUserSettings.h>
#import <SOGo/SOGoSystemDefaults.h>
#import <SOGo/SOGoUserManager.h>
#import <SOGo/SOGoWebDAVAclManager.h>
@@ -202,12 +204,21 @@
- (void) _filterComponent: (iCalEntityObject *) component
{
NSString *type, *summary;
NSString *type, *summary, *tag, *uid;
SOGoUserSettings *settings;
SOGoUser *calendarOwner;
NSEnumerator *children;
CardElement *element;
NSArray *tags;
int classification;
type = @"vtodo";
classification = 0;
calendarOwner = [SOGoUser userWithLogin: [self ownerInContext: context]];
settings = [calendarOwner userSettings];
if ([component isKindOfClass: [iCalEvent class]])
type = @"vevent";
@@ -219,14 +230,23 @@
summary = [self labelForKey: [NSString stringWithFormat: @"%@_class%d",
type, classification]
inContext: context];
tags = [NSArray arrayWithObjects: @"DTSTAMP", @"DTSTART", @"DTEND", @"DUE", @"EXDATE", @"EXRULE", @"RRULE", nil];
uid = [[component uid] asCryptedPassUsingScheme: @"ssha256"
withSalt: [[settings userSalt] dataUsingEncoding: NSASCIIStringEncoding]
andEncoding: encHex];
children = [[[[component children] copy] autorelease] objectEnumerator];
while ((element = [children nextObject]))
{
tag = [element tag];
if (![tags containsObject: [tag uppercaseString]])
[component removeChild: element];
}
[component setSummary: summary];
[component setComment: @""];
[component setUserComment: @""];
[component setLocation: @""];
[component setCategories: [NSArray array]];
[component setUrl: @""];
[component removeAllAttendees];
[component removeAllAlarms];
[component setUid: uid];
}
- (NSString *) secureContentAsString
@@ -915,6 +935,14 @@
NSData *bodyData;
SOGoDomainDefaults *dd;
// We never send IMIP reply when the "initiator" is Outlook 2013/2016 over
// the EAS protocol. That is because Outlook will always issue a SendMail command
// with the meeting's response (ie., IMIP message with METHOD:REPLY) so there's
// no need to send it twice. Moreover, Outlook users can also choose to NOT send
// the IMIP messsage at all, so SOGo won't send one without user's consent
if ([[context objectForKey: @"DeviceType"] isEqualToString: @"WindowsOutlook15"])
return;
dd = [from domainDefaults];
if ([dd appointmentSendEMailNotifications] && [event isStillRelevant])
{
@@ -1360,19 +1388,17 @@
- (id) PUTAction: (WOContext *) localContext
{
WORequest *rq;
iCalCalendar *putCalendar;
rq = [localContext request];
putCalendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]];
if ([[SOGoSystemDefaults sharedSystemDefaults] enableEMailAlarms])
{
SOGoEMailAlarmsManager *eaMgr;
iCalCalendar *putCalendar;
WORequest *rq;
rq = [localContext request];
putCalendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]];
eaMgr = [SOGoEMailAlarmsManager sharedEMailAlarmsManager];
[eaMgr handleAlarmsInCalendar: putCalendar
fromComponent: self];
fromComponent: self];
}
return [super PUTAction: localContext];
@@ -1394,4 +1420,36 @@
// return values;
// }
- (void) adjustClassificationInRequestCalendar: (iCalCalendar *) rqCalendar
{
SOGoUserDefaults *userDefaults;
NSString *accessClass;
NSArray *allObjects;
id entity;
int i;
userDefaults = [[context activeUser] userDefaults];
allObjects = [rqCalendar allObjects];
for (i = 0; i < [allObjects count]; i++)
{
entity = [allObjects objectAtIndex: i];
if ([entity respondsToSelector: @selector(accessClass)])
{
accessClass = [entity accessClass];
if (!accessClass || [accessClass length] == 0)
{
if ([entity isKindOfClass: [iCalEvent class]])
[entity setAccessClass: [userDefaults calendarEventsDefaultClassification]];
else if ([entity isKindOfClass: [iCalToDo class]])
[entity setAccessClass: [userDefaults calendarTasksDefaultClassification]];
}
}
}
}
@end
+1 -3
View File
@@ -1,8 +1,6 @@
/* SOGoCalendarProxy.h - this file is part of SOGo
*
* Copyright (C) 2009 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2009-2016 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+1 -3
View File
@@ -1,8 +1,6 @@
/* SOGoCalendarProxy.m - this file is part of SOGo
*
* Copyright (C) 2009 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Copyright (C) 2009-2016 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Loaded 100 of 459 files, more files were not shown because too many files have changed in this diff. Show more