Compare commits

...
906 Commits
Author SHA1 Message Date
smizrahi 6338ca19c2 chore(release): 5.8.2 2023-03-28 21:43:35 +02:00
smizrahi 95cb615e92 chore(release): 5.8.2 2023-03-28 21:34:01 +02:00
smizrahi 5e11702d88 Update ChangeLog 2023-03-28 21:28:35 +02:00
smizrahi f813b78c3c fix(calendar): Impossible to create a new event after creating a new one. Closes #5718 2023-03-28 21:26:21 +02:00
smizrahi 5a825881d9 chore(release): 5.8.1 2023-03-28 09:50:02 +02:00
smizrahi 072ff5ac85 chore(timezones): Update to version 2023b 2023-03-28 09:11:31 +02:00
smizrahi b2873bf5f1 i18n(cy): Update Welsh translations 2023-03-27 19:46:49 +02:00
smizrahi 90b174bda1 i18n(uk): Update Ukrainian translations 2023-03-27 19:46:49 +02:00
smizrahi f87a8557bd i18n(tr_TR): Update TurkishTurkey translations 2023-03-27 19:46:49 +02:00
smizrahi a0d047ad07 i18n(sv): Update Swedish translations 2023-03-27 19:46:49 +02:00
smizrahi 43d925b4ef i18n(es_ES): Update SpanishSpain translations 2023-03-27 19:46:49 +02:00
smizrahi d6a63bd7bf i18n(es_AR): Update SpanishArgentina translations 2023-03-27 19:46:49 +02:00
smizrahi 5a67603816 i18n(sl_SI): Update Slovenian translations 2023-03-27 19:46:49 +02:00
smizrahi d18581514e i18n(sk): Update Slovak translations 2023-03-27 19:46:48 +02:00
smizrahi 1489b7d219 i18n(sr): Update Serbian translations 2023-03-27 19:46:09 +02:00
smizrahi 0d21123def i18n(ro_RO): Update Romanian translations 2023-03-27 19:46:08 +02:00
smizrahi d2a5fd0b2d i18n(pt_BR): Update Portuguese translations 2023-03-27 19:46:08 +02:00
smizrahi 62edb09b9c i18n(pl): Update Polish translations 2023-03-27 19:46:08 +02:00
smizrahi 7d60dbb2c6 i18n(nn_NO): Update NorwegianNynorsk translations 2023-03-27 19:46:08 +02:00
smizrahi f66992cef4 i18n(sr_ME@latin): Update Montenegrin translations 2023-03-27 19:46:08 +02:00
smizrahi deef331029 i18n(mk_MK): Update Macedonian translations 2023-03-27 19:46:08 +02:00
smizrahi dd0d9bd5fe i18n(lt): Update Lithuanian translations 2023-03-27 19:46:08 +02:00
smizrahi b9eacdbe49 i18n(lv): Update Latvian translations 2023-03-27 19:46:08 +02:00
smizrahi d860a3c016 i18n(kk): Update Kazakh translations 2023-03-27 19:46:08 +02:00
smizrahi 44ea7a684e i18n(ja): Update Japanese translations 2023-03-27 19:46:07 +02:00
smizrahi 561ab7e866 i18n(it): Update Italian translations 2023-03-27 19:46:07 +02:00
smizrahi 12c32ef1d2 i18n(id_ID): Update Indonesian translations 2023-03-27 19:46:07 +02:00
smizrahi 7cbef4bdd4 i18n(is): Update Icelandic translations 2023-03-27 19:46:07 +02:00
smizrahi 38ebd5a38f i18n(he): Update Hebrew translations 2023-03-27 19:46:07 +02:00
smizrahi 7b66aa9dad i18n(fi): Update Finnish translations 2023-03-27 19:46:07 +02:00
smizrahi 6c816cba6b i18n(nl): Update Dutch translations 2023-03-27 19:46:07 +02:00
smizrahi 4f7e04d5b4 i18n(cs): Update Czech translations 2023-03-27 19:46:07 +02:00
smizrahi e16f5fa0f9 i18n(hr_HR): Update Croatian translations 2023-03-27 19:46:07 +02:00
smizrahi 245ede949e i18n(zh_TW): Update ChineseTaiwan translations 2023-03-27 19:46:07 +02:00
smizrahi 1344f2a7dd i18n(zh_CN): Update ChineseChina translations 2023-03-27 19:46:06 +02:00
smizrahi 485f40cca4 i18n(ca): Update Catalan translations 2023-03-27 19:46:06 +02:00
smizrahi 982b1ec1f6 i18n(bg_BG): Update Bulgarian translations 2023-03-27 17:53:30 +02:00
smizrahi 28784836c8 i18n(pt_BR): Update Portuguese (Brazil) translations 2023-03-27 17:51:11 +02:00
smizrahi ddf55270a6 i18n(bs_BA): Update Bosnian translations 2023-03-27 17:49:55 +02:00
smizrahi 9192f2b76d i18n(eu): Update Basque translations 2023-03-27 17:49:04 +02:00
smizrahi 3714b147ed i18n(ar): Update Arabic translations 2023-03-27 17:47:21 +02:00
smizrahi ac8aeec83f i18n(ru): Update Russian translations 2023-03-27 17:46:43 +02:00
smizrahi a3c9044b7e i18n(de): Update German translations 2023-03-27 17:42:08 +02:00
smizrahi ecd1344065 i18n(da_DK): Update Danish translations 2023-03-27 17:41:34 +02:00
smizrahi e4534c0bfd i18n(nb_NO): Update Norwegian Bokmål translations 2023-03-27 17:36:33 +02:00
smizrahi cdbe91decf i18n(hu): Update Hungarian translations 2023-03-27 17:34:38 +02:00
smizrahi 3f01de6c8f chore(npm): Update CKEditor to version 4.21.0 2023-03-27 11:27:35 +02:00
smizrahi 65d4c5c480 fix(calendar): Add confirmation box when dismissing calendar event edition with background click, only if the event is in edition. Fixes #5585 2023-03-27 09:38:56 +02:00
smizrahi bb4a88b6df fix(calendar): Add confirmation box when dismissing calendar event edition with background click, only if the event is in edition. Fixes #5585 2023-03-22 19:39:44 +01:00
smizrahi f5ed10b00c fix(mail): Fix images not displayed when forward / reply to a mail. Fixes #3981. Fixes #5715 2023-03-22 16:17:58 +01:00
smizrahi 7ad7f5efa6 fix(ui): Add error message on UI when too many mails are sent in short time. Fix fr translation. Fix documentation 2023-03-21 17:35:45 +01:00
smizrahi e12583eb4e feat(mail): Add punycode (RFC 3492) to encode domain with special characters 2023-03-21 10:27:43 +01:00
smizrahi 39032ac80f feat(mail): Add punycode (RFC 3492) to encode domain with special characters 2023-03-21 10:23:56 +01:00
smizrahi 13178a16f2 feat(mail): Add punycode (RFC 3492) to encode domain with special characters 2023-03-21 10:22:43 +01:00
smizrahi 0a9b3d6adf feat(mail): Add punycode (RFC 3492) to encode domain with special characters 2023-03-21 10:19:32 +01:00
smizrahi abd7fdd385 chore(js/css): update generated files 2023-03-15 17:44:01 +01:00
smizrahi 66c728ca84 fix(packaging): Add MFA to Ubuntu Jammy 2023-03-15 09:55:42 +01:00
smizrahi 64d817ab0d fix(calendar): Add confirmation box when dismissing calendar event edition with background click, only if the event is in edition. Fixes #5585. 2023-03-14 16:20:31 +01:00
WoodySlum 8bd97d1464 Merge pull request #343 from jkanefendt/fix-move-messages-across-mailboxes
Fix moving mails across mailboxes
2023-03-14 08:35:05 +01:00
Johannes Kanefendt 49488efab9 Refactored variable declaration 2023-03-14 08:26:23 +01:00
Johannes Kanefendt a556e742fb fix(mail): Store the Deleted flag in the correct (source) mailbox when moving mails across mailboxes 2023-03-10 15:57:53 +01:00
smizrahi 4dc8ef946d fix(mail): Fix images not displayed when forward / reply to a mail. Fixes #3981 2023-03-07 10:17:02 +01:00
smizrahi 0d2f6d8c2a fix(packaging): Check if there are sh files in usr/share/doc/sogo before applying chmod. Fixes partially #5698 2023-02-27 22:53:25 +01:00
smizrahi 63548a84cf fix(packaging): Specify compression format for dpkg-deb 2023-02-27 22:02:17 +01:00
smizrahi 189144c531 fix(packaging): Specify compression format for dpkg-deb 2023-02-27 18:38:33 +01:00
smizrahi 5049423113 fix(packaging): Specify compression format for dpkg-deb 2023-02-27 18:33:20 +01:00
smizrahi 7ea7572766 fix(packaging): Add usr/share/doc/sogo/ for packaging. Fixes partially #5698 2023-02-27 11:22:39 +01:00
smizrahi 114c98c32d fix(packaging): Add usr/share/doc/sogo/ for packaging. Fixes partially #5698 2023-02-27 10:38:46 +01:00
smizrahi 754f3aa230 test(js): Increase test timeout for CI 2023-02-27 10:29:49 +01:00
smizrahi 02f855059b fix(mail): Fix segfault when TNEF does not get any data. Fixes #4190 2023-02-23 11:58:58 +01:00
smizrahi 53f9449a51 feat(alarms): Add possibility to use SMTP master account for system alarms. Fixes #5565. 2023-02-20 18:53:08 +01:00
smizrahi 7faf4eb2f4 feat(alarms): Add possibility to use SMTP master account for system alarms. Fixes #5565. 2023-02-20 17:23:17 +01:00
smizrahi 1964ef0358 fix(dav): Improve logging. Closes #4190 2023-02-20 10:15:42 +01:00
smizrahi 8001e3f6ab feat(alarms): Add possibility to use SMTP master account for system alarms. Fixes #5565. 2023-02-16 18:51:28 +01:00
smizrahi 2c6f5225d4 i18n(de): Update German translations 2023-02-14 16:43:00 +01:00
smizrahi ffcaf6c433 18n(transifex): Update transifex for new apis 2023-02-14 09:48:41 +01:00
smizrahi b51b695999 18n(transifex): Update transifex for new apis 2023-02-14 09:46:34 +01:00
smizrahi f7b416fac2 18n(fr_FR): Update aboutbox 2023-02-13 11:12:59 +01:00
smizrahi 959a4107d4 18n(en_EN): Update aboutbox 2023-02-13 11:12:59 +01:00
WoodySlum 406bd35875 Merge pull request #341 from Fulguritus/master
fix(UI): Make the login page honor the color theme Fixes #5687
2023-02-13 10:52:41 +01:00
smizrahi ef53f6c809 fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2023-02-01 09:25:39 +01:00
Alex Vogt 607bc08c92 fix(UI): Make the login page honor the color theme
partial solution by specifying the theme and accent color manually

Fixes #5687 (partially)
2023-01-31 19:43:42 +01:00
smizrahi ba0d4a51c0 fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2023-01-31 17:39:00 +01:00
smizrahi 7e357f1bc9 fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2023-01-26 17:12:08 +01:00
smizrahi f15840217b fix(calendar): Fix duplicate event on Apple Calendar when creating a new reccurent event, inviting attendee and changing an occurence 2023-01-18 17:20:30 +01:00
smizrahi a5347c70aa fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2023-01-17 16:32:53 +01:00
smizrahi 4d7a425428 fix(js): Change grunt-contrib-uglify from 5.0.0 to 5.2.2 2023-01-16 17:23:21 +01:00
smizrahi 04e15b5695 feat(eas): Add SOGoEASDisableUI system parameter to remove EAS options in UI when ActiveSync is not used 2023-01-16 15:31:27 +01:00
WoodySlum c178963bfc Merge pull request #339 from helsinki-systems/fix/too-many-vars
fix(configure): Prevent pulling in unnecessary vars
2023-01-13 08:56:21 +01:00
Janne Heß b223fe0b86 fix(configure): Prevent pulling in unnecessary vars 2023-01-11 18:12:12 +01:00
smizrahi 842fa97d37 fix(authentication): Reduce Cookie user key len to avoid exceeding 4096 bytes. Users in chrome <= 75 could not login due to cookie of 4099 bytes 2023-01-05 15:59:14 +01:00
smizrahi 0bd530ab64 feat(preferences): Improve TOTP - add validation code in preferences before saving to ensure user add qr code in totp application 2023-01-04 17:37:46 +01:00
smizrahi 7d72fe1281 fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2023-01-03 23:33:28 +01:00
smizrahi 86805369a3 fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2023-01-03 15:24:30 +01:00
smizrahi a7f3daa33f fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2022-12-13 12:33:58 +01:00
smizrahi 6ee8f764e9 fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2022-12-13 11:08:43 +01:00
smizrahi 435495f007 feat(core): Add SOGoDisableSharing option to disable sharing for mail, contacts and calendar 2022-12-12 12:03:59 +01:00
smizrahi 5d6b40c8cf fix(core(js)): Removed es6 'const' for build issues with grunt 2022-12-12 09:14:23 +01:00
smizrahi 03e6d0012b fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 2022-12-07 17:57:00 +01:00
smizrahi fe9ae12e46 fix(security): Security fix for WSTG-INPV-02. Fix NSException where tried to modify NSDictionary. Closes #5651. 2022-12-05 11:45:45 +01:00
smizrahi ed9d247f3e chore(release): 5.8.0 2022-11-30 15:50:43 +01:00
smizrahi a010f629f0 fix(security): Security fix for WSTG-INPV-02. Fix NSException where mailIdentities is invalid on init. Closes #5651. 2022-11-30 12:40:52 +01:00
smizrahi 6971ebd2d1 fix(security): Security fix for WSTG-INPV-02. Fix assertion on NSRange 2022-11-29 17:34:34 +01:00
smizrahi b3e43454f9 Update changelog and version 2022-11-29 16:02:54 +01:00
smizrahi 59d4c08950 chore(timezones): Update to version 2022f 2022-11-29 13:37:19 +01:00
smizrahi 0cd7a170a0 i18n(nb_NO): Update Norwegian Bokmål translations 2022-11-29 13:19:39 +01:00
smizrahi 67cf3c0017 chore(npm): Update CKEditor to version 4.20.0 2022-11-29 10:58:38 +01:00
smizrahi 49879efbc6 fix(ui): Change active user name on top left with primary identity 2022-11-23 14:44:07 +01:00
smizrahi 27860648c1 fix(core): Fix NSException when c_content is NULL. Closes #5644. Original fix by @jvdsn. 2022-11-23 14:25:15 +01:00
smizrahi 26b9429396 fix(ui): Change active user name on top left with primary identity 2022-11-23 13:33:59 +01:00
smizrahi d3634747d5 feat(password-recovery): Change secondary email obfuscation 2022-11-23 10:06:43 +01:00
smizrahi b1f84891b0 fix(security): Security fix for WSTG-INPV-02. Add unit test. 2022-11-23 09:34:54 +01:00
smizrahi 48c7375544 perf(mail): Improve IMAP fetch sorting using NSDictionary keys instead of indexOfObject. Code refactoring 2022-11-22 17:48:45 +01:00
smizrahi f5c6fcc350 fix(security): Security fix for WSTG-INPV-02. Fix build issue in ubuntu trusty 2022-11-22 17:37:15 +01:00
smizrahi 58540f15e2 feat(password-recovery): Change when secret question answer is wrong, go back to secret question instead of login 2022-11-22 17:31:59 +01:00
smizrahi c62b043e26 fix(addressbook): Fix NSException on address book where uppercaseString is called on data 2022-11-22 15:12:58 +01:00
smizrahi 96cd1880da i18n(nb_NO): Update Norwegian Bokmål translations 2022-11-22 14:10:50 +01:00
smizrahi 37291facc7 i18n(da_DK): Update Danish translations 2022-11-22 14:10:50 +01:00
WoodySlum (Le Programmeur) c378ffdbba Merge pull request #334 from tfux/5330
fix(eas): ensure correct encoding of attachments(fixes #5330)
2022-11-22 12:19:46 +01:00
smizrahi efac49ae91 fix(security): Security fix for WSTG-INPV-02. Add XSS protection on identity fullName. Fixes #5642. 2022-11-22 10:54:06 +01:00
smizrahi 1e0f5f0089 fix(security): Security fix for WSTG-INPV-02. Add XSS protection on folders and mail title / content 2022-11-22 10:09:41 +01:00
root dff907a158 fix(eas) ensure correct encoding of attachments(fixes #5330) 2022-11-21 11:05:33 +01:00
smizrahi dcbfd830d4 fix(security): Security fix for WSTG-INPV-02. Add XSS protection on folders and mail title / content. Fix build issue in ubuntu trusty. 2022-11-18 09:16:40 +01:00
smizrahi 60ec3152e8 perf(mail): Improve IMAP fetch sorting using NSDictionary keys instead of indexOfObject. Code refactoring 2022-11-18 08:58:10 +01:00
smizrahi 38e886a3e0 perf(mail): Improve IMAP fetch sorting using NSDictionary keys instead of indexOfObject. Fix build issue. 2022-11-16 21:59:11 +01:00
smizrahi 40b5c0918a perf(mail): Improve IMAP fetch sorting using NSDictionary keys instead of indexOfObject 2022-11-16 21:08:48 +01:00
smizrahi 714acfc838 fix(security): Security fix for WSTG-INPV-02. Add XSS protection on folders and mail title / content 2022-11-14 14:36:46 +01:00
WoodySlum (Le Programmeur) 967479335c Merge pull request #333 from tfux/5640
fix(eas) improvement for bug #5612 (fixes #5640)
2022-11-14 09:03:46 +01:00
root e1c7e32f84 fix(eas) improvement for bug #5612 (fixes #5640) 2022-11-12 22:37:15 +01:00
smizrahi 7bfa900ae1 feat(login): Add button to discover password 2022-11-09 15:40:29 +01:00
WoodySlum (Le Programmeur) 8bfc3e4205 Merge pull request #332 from ichdasich/adjust_imap_authenticate_documentation
Adjust imap authenticate documentation
2022-11-08 17:09:47 +01:00
Tobias Fiebig 14608b168a docs(core): extend documentation for NGImap4AuthMechanism in sogo.conf
update documentation for NGImap4AuthMechanism to highlight that using
`AUTHENTICATE` is necessary to allow users to have UTF-8 characters in their
passwords, i.e., especially 'umlauts'.
2022-11-08 13:45:04 +01:00
Tobias Fiebig a846edee1c docs(core): add NGImap4AuthMechanism = "plain"; to sample config file
forcing `AUTHENTICATE` using Add NGImap4AuthMechanism = "plain"; is necessary
for setups where users have UTF-8 characters in their password
2022-11-08 13:41:08 +01:00
WoodySlum (Le Programmeur) 2d4a700700 Merge pull request #330 from tfux/5612
fix(eas) use bare email address (fixes #5612)
2022-11-08 08:19:24 +01:00
WoodySlum (Le Programmeur) b4633bdbf3 Merge pull request #329 from tfux/5626
fix(eas) ensure Templates and Junk folder exits (fixes #5626)
2022-10-31 17:48:56 +01:00
root 2d9a70944b fix(eas) use bare email address (fixes #5612) 2022-10-30 16:55:54 +01:00
root 2ffe3d79d2 fix(eas) ensure Templates and Junk folder exits (fixes #5626) 2022-10-30 16:11:42 +01:00
smizrahi 18c92dac31 feat(password-recovery): Add loader for password recovery - when requests are slow, the UI does not display anything. 2022-10-26 16:23:55 +02:00
smizrahi 7444865544 Removed useless comment in code 2022-10-26 14:39:20 +02:00
smizrahi 549d6a8463 fix(calendar): Update c_startdate field when updating event. Fixes #4376 2022-10-26 14:30:10 +02:00
smizrahi 9b023f43d5 feat(password-recovery): Avoid removing XSRF token cookie on passwordRecoveryCheck request 2022-10-25 14:50:12 +02:00
Le Programmeur 43b81bf9fd Merge pull request #327 from helsinki-systems/fix/duplicated-recurrence-rules
Fix OOM when having a lot of recurrence rules
2022-10-24 14:50:05 +02:00
Le Programmeur b672b0acc3 Merge pull request #328 from helsinki-systems/fix/mail-validation
fix(mail(js)): fix validation of email addresses
2022-10-24 13:50:17 +02:00
smizrahi 440a15ba98 feat(password-recovery): Clean session cookies on password change 2022-10-24 13:49:13 +02:00
Max Hausch d194b1e921 fix(mail(js)): fix validation of email addresses
This fixes a js error that was introduced by
67ccf748ed If applied, this fix allows
users to copy and paste multiple email addresses into the recipient
fields, e.g., from a excel file.
2022-10-20 10:52:28 +02:00
smizrahi e269df8c6e feat(password-recovery): Improve documentation 2022-10-19 15:53:47 +02:00
smizrahi b7531bc59b feat(password-recovery): Fix undefined in URL when click on back button 2022-10-19 15:41:39 +02:00
smizrahi 119e3870cf i18n(nb_NO): Update Norwegian Bokmål translations 2022-10-19 14:47:30 +02:00
smizrahi 0409ee37be i18n(da_DK): Update Danish translations 2022-10-18 21:40:08 +02:00
smizrahi 4c01ea210e i18n(fr): Update French translations 2022-10-18 21:37:16 +02:00
smizrahi e51aee8ce0 i18n(sr): Update Serbian translations 2022-10-18 21:35:15 +02:00
smizrahi 57fb62244d i18n(nb_NO): Update Norwegian Bokmål translations 2022-10-18 21:30:10 +02:00
smizrahi 33940b14ea feat(password-recovery): Improve password lost link style 2022-10-18 16:19:20 +02:00
Janne Heß 20e4dced40 Fix OOM when having a lot of recurrence rules
We had a broken client that created calendar entries with a lot of
recurrence rule (all of them FREQ=WEEKLY) and a lot of alarms. This led
to SOGo going out of memory.

This patch works around that by filtering out duplicated rules as they
yield the same date ranges and we only need to have them once.
2022-10-18 13:42:13 +02:00
smizrahi 5fb82fe414 feat(calendar): Refresh data when clicking on 'today' 2022-10-17 18:55:32 +02:00
smizrahi 77062befc5 feat(password-recovery): Update documentation 2022-10-17 11:56:17 +02:00
smizrahi d50080ea5b feat(password-recovery): Add LDAP password recovery 2022-10-16 14:46:19 +02:00
smizrahi cddfdb90f9 feat(calendar): Add SOGoDisableOrganizerEventCheck parameter - this parameter is used to avoid checking calendar event's organizer 2022-10-05 22:12:14 +02:00
smizrahi 88950c5b97 Update README 2022-10-05 10:58:39 +02:00
smizrahi c4dd695b12 feat(password-recovery): Fix dictionary with nil value issue. Changed parameter to SOGoPasswordRecoveryEnabled 2022-10-04 18:22:57 +02:00
Le Programmeur d5ad0ddf5d Merge pull request #324 from the-nic/fix-5416
(fix) NSString+Utilities: Fix safeStringByEscapingXMLString on gnuste…
2022-10-04 09:45:45 +02:00
smizrahi 04dd78d738 fix(addressbook): Fix invalid template 2022-10-03 14:57:28 +02:00
smizrahi 1ea8b9fb1f feat(password-recovery): Fix build issue. Restored previously removed used var. 2022-10-03 14:18:59 +02:00
smizrahi 2e1b22cb23 feat(password-recovery): Fix build issue 2022-10-03 13:45:10 +02:00
smizrahi fb51911936 Merge branch 'master' into password-recovery 2022-10-03 10:59:16 +02:00
smizrahi 14a10136ca style(mail): Fix unscrollable multiple delegated mailboxes issue 2022-10-03 09:04:43 +02:00
smizrahi 656807b77d feat(password-recovery): Add password recovery with secret question or secondary email 2022-10-03 08:56:41 +02:00
smizrahi 6931186bba chore(js/css): update generated files. Fix https://bugs.sogo.nu/view.php?id=5581. 2022-09-14 11:19:46 +02:00
Francis Lachapelle 3eeebbc83b fix(calendar(js)): destination calendars of new components
Fixes #5581
2022-08-19 10:07:14 -04:00
Francis Lachapelle 1e4c134591 style: remove debugging output 2022-08-18 23:02:36 -04:00
smizrahi e5dae36bb5 Update authors in documentation 2022-08-17 16:21:44 +02:00
smizrahi bf82d2b599 Update authors in documentation 2022-08-17 16:20:58 +02:00
smizrahi 62ba2968cb Update changelog for version 5.7.1 2022-08-17 16:00:56 +02:00
smizrahi f9e975af21 Set back Inverse copyrights 2022-08-17 10:06:28 +02:00
smizrahi b8a010f3ba Set back Inverse copyrights 2022-08-17 09:45:00 +02:00
Francis Lachapelle 928435704c chore(js/css): update generated files 2022-08-16 08:57:09 -04:00
Francis Lachapelle 16459c7b3d fix(calendar(js)): conditional display of edit and delete buttons 2022-08-15 15:31:19 -04:00
Francis Lachapelle 3f7fef0788 fix(calendar): remove time from until date of rrule of all-day event
See RFC 5545, section 3.3.10 Recurrence Rule.
2022-08-15 13:25:35 -04:00
Nicolas Höft 3b3e0195b1 (fix) NSString+Utilities: Fix safeStringByEscapingXMLString on gnustep-base-1.28
Newer gnustep version would add a byte-order-mark on
NSString:dataUsingEncoding:NSUTF32StringEncoding, use NSUTF32LittleEndianStringEncoding
instead to skip the BOM.

Fixes #5416
2022-08-15 17:06:00 +02:00
smizrahi ea06fa7cbf docs: Removed Inverse logo 2022-08-12 18:16:39 +02:00
smizrahi dc45d0ed24 docs: Change references to Alinto 2022-08-12 18:15:35 +02:00
smizrahi 1ec6fd1679 chore(release): 5.7.1 2022-08-12 17:38:22 +02:00
smizrahi a54115c96a Update URL for bts 2022-08-12 17:28:46 +02:00
smizrahi f92e292547 chore(timezones): Update to version 2022b 2022-08-12 17:23:36 +02:00
smizrahi abc2df0da0 i18n(hu): Update Hungarian translations 2022-08-12 15:58:21 +02:00
smizrahi a418baa276 i18n(fr): Update French translations 2022-08-12 15:58:03 +02:00
smizrahi c00ab0d7a7 Update gitignore 2022-08-12 15:21:51 +02:00
smizrahi cbf6e06964 chore(js/css): update generated files 2022-08-11 18:02:41 +02:00
smizrahi 5b84d083b8 chore(fonts): Update Fira font to commit fd8c8c0 2022-08-11 17:52:39 +02:00
smizrahi a2bed5f76f chore(npm): Update CKEditor to version 4.19.1 and update gitignore 2022-08-11 17:29:22 +02:00
smizrahi 7a985f8eff Removed i18n mailing list from README 2022-08-10 20:47:28 +02:00
smizrahi 1ebb6a11f4 Update URL documentation for Alinto migration 2022-08-10 09:27:47 +02:00
Francis Lachapelle 95eecc402a fix(dav): return 405 when collection already exists
See https://datatracker.ietf.org/doc/html/rfc4918#section-9.3.1
2022-08-09 12:17:55 -04:00
Francis Lachapelle efe78c5179 fix(mail(js)): handle paste action from contextual menu
Fixes #5488
2022-08-08 17:38:10 -04:00
Francis Lachapelle 4e79a1e995 test: we now encode everything in XML documents 2022-08-04 16:15:45 -04:00
Francis Lachapelle 4f7981b1c3 test: improve TestNGMimeHeaderFieldGenerator 2022-08-04 16:09:33 -04:00
Francis Lachapelle ac602dd58c test: improve error message in localhost test 2022-08-04 16:06:06 -04:00
Francis Lachapelle 931fc8d6ef chore(js/css): update generated files 2022-07-28 12:10:05 -04:00
Francis Lachapelle 67ccf748ed fix(web(js)): improve validation of email addresses
Overwrite the AngularJS validation and transformation of email inputs in
order to support umlauts and eszett.
2022-07-28 10:46:40 -04:00
Le Programmeur 5e6ad77d4c fix(i18n): new localized strings for SQL-based password policies 2022-07-26 12:22:53 -04:00
Francis Lachapelle a667c69f3c i18n(kk): add Kazakh translation 2022-07-25 09:13:24 -04:00
adetk d1971b76e2 i18n(kk): Add Kazakh translation by Nazym Idrissova 2022-07-25 07:39:28 -04:00
InverseBot 0d720b7c63 chore(js/css): update generated files 2022-07-23 00:17:39 -04:00
Francis Lachapelle adfd175681 fix(preferences): regex in Sieve scripts are now case sensitive
Fixes #5561
2022-07-22 16:45:47 -04:00
Francis Lachapelle 407bc538df fix(mail(js)): resolve sub mailboxes in global search
Fixes #5559
2022-07-22 15:34:44 -04:00
InverseBot 82747746c6 chore(js/css): update generated files 2022-07-17 00:17:21 -04:00
Francis Lachapelle 2ae03d5095 fix(preferences(js)): don't filter vacation start date 2022-07-15 11:14:22 -04:00
Francis Lachapelle 0720dc44fd fix(addressbook(dav)): improve handling of addressbook-query 2022-07-13 16:46:00 -04:00
Francis Lachapelle e18dc2cd5a fix(mail(js)): add CKEditor plugins emoji and bidi 2022-07-08 10:57:57 -04:00
Francis Lachapelle a6f7c1ea61 fix(calendar): update all quick fields when updating event
Fixes #5546
2022-07-08 10:31:59 -04:00
Nicolas Höft edd64a396e fix(core): adjustments for IPv6 2022-07-06 08:49:48 -04:00
Francis Lachapelle 2f9f610210 fix(core): handle argon2i password scheme
Fixes #5531
2022-07-05 12:42:57 -04:00
Francis Lachapelle 27d45b6d76 fix(mail): use encoding from MIME part 2022-07-05 08:59:48 -04:00
Francis Lachapelle 6bed6c0e20 fix(core): don't remove double quotes when parsing versit strings
Fixes #3530
Fixes #3930
2022-06-29 16:58:28 -04:00
Francis Lachapelle ebf032ee6b fix(core): don't remove double quotes when parsing versit strings
Fixes #3530
2022-06-29 08:31:08 -04:00
Francis Lachapelle d99aa82a31 fix(core): don't remove double quotes when parsing versit strings
Fixes #3530
2022-06-28 16:54:41 -04:00
Francis Lachapelle 9fb3705005 chore(release): 5.7.0 2022-06-10 15:21:57 -04:00
Francis Lachapelle 3aea397af9 i18n(tr_TR): update Turkish (Turkey) translation 2022-06-10 15:14:15 -04:00
Francis Lachapelle b272e2dee6 i18n(hu): update Hungarian translation 2022-06-10 15:14:02 -04:00
Francis Lachapelle 1684c234a3 i18n(bg_BG): update Bulgarian translation 2022-06-10 15:13:47 -04:00
Francis Lachapelle fa39e2a19a i18n(it): update Italian translation 2022-06-10 15:13:34 -04:00
Francis Lachapelle 825d341f8d i18n(de): update German translation 2022-06-10 15:13:16 -04:00
Francis Lachapelle 515d03080e i18n(uk): update Ukrainian translation 2022-06-10 15:12:46 -04:00
Francis Lachapelle 2ae6b46c55 i18n(ru): update Russian translation 2022-06-10 15:12:18 -04:00
Francis Lachapelle 5b960759d2 i18n(nl): update Dutch translation 2022-06-10 15:11:36 -04:00
Francis Lachapelle 15a381d1fd chore(npm): update CKEditor to version 4.19.0 2022-06-10 15:04:43 -04:00
Francis Lachapelle 580a73c857 fix(mail): add default label & color for $forwarded flag
Fixes #5534
2022-06-10 08:25:54 -04:00
Francis Lachapelle bd40b95f70 fix(calendar): disable wrapping of labels in mail templates 2022-06-09 11:46:25 -04:00
Francis Lachapelle 123964d079 style(calendar): untabify, indentation 2022-06-07 10:24:28 -04:00
Francis Lachapelle 5c331d3451 docs: improve syntax 2022-06-06 17:00:21 -04:00
Francis Lachapelle 2ef849ca65 feat(preferences): password constraints for SQL sources
Initial implementation of some password policy support for SQL sources.
2022-06-06 16:39:26 -04:00
InverseBot 03cdc4f3b1 chore(js/css): update generated files 2022-06-03 00:16:37 -04:00
Francis Lachapelle 51f6536d16 docs: update CONTRIBUTING file
Fixes #5527
2022-06-01 09:19:02 -04:00
Francis Lachapelle 2aaad3de22 perf(tool): cache IMAP delimiters when updating sieve filters 2022-05-27 10:16:22 -04:00
Francis Lachapelle c87ce46d29 perf(tool): cache IMAP delimiters when updating sieve filters 2022-05-26 09:25:42 -04:00
InverseBot be7ca731b3 chore(js/css): update generated files 2022-05-26 00:16:53 -04:00
Francis Lachapelle f67e304caf chore(tool): respect start time of auto reply when start date is today 2022-05-25 17:00:02 -04:00
Muhammed Yalçınkaya 2df931bc3a i18n(tr_TR): update README file with new Turkish translation contributor 2022-05-25 15:30:31 -04:00
Francis Lachapelle cddd016e53 fix(administration(js)): add rgba colors to theme preview 2022-05-25 13:35:27 -04:00
Francis Lachapelle 36303bef9d fix(preferences): keep mail identities when none is provided when saving 2022-05-25 13:31:03 -04:00
Francis Lachapelle 9337915890 fix(preferences(js)): prohibit deleting the last editable mail identity 2022-05-25 13:27:57 -04:00
Francis Lachapelle 5452cd7396 fix(calendar): filter by matching property values
Added test for calendar-query DAV request
2022-05-24 17:29:56 -04:00
Francis Lachapelle dec49c2154 i18n(tr_TR): update Turkish (Turkey) translation 2022-05-20 17:40:42 -04:00
Francis Lachapelle 51dc929d0c feat(addressbook(web)): import vList from versit file 2022-05-18 16:25:04 -04:00
InverseBot e020a514a1 chore(js/css): update generated files 2022-05-18 00:16:28 -04:00
Francis Lachapelle a40d3b6296 fix(mail): remove unused directive in mail editor 2022-05-17 21:13:50 -04:00
Francis Lachapelle 412d73b166 fix(mail(js)): transition to a message using the router 2022-05-17 21:12:54 -04:00
Francis Lachapelle 715cf71ba3 fix(mail(js)): refresh of parent window when saving draft/template 2022-05-17 15:33:43 -04:00
Francis Lachapelle 35f9f35ef0 refactor(js): improve defintion of some controllers 2022-05-17 15:33:43 -04:00
InverseBot 6242546797 chore(js/css): update generated files 2022-05-17 00:19:59 -04:00
Francis Lachapelle 47c629f13c chore(mail): remove UIxMailFolderMenu.wox 2022-05-16 17:43:35 -04:00
Francis Lachapelle 0130803cd4 chore(core): remove UIxModuleAccessDenied 2022-05-16 17:43:35 -04:00
Francis Lachapelle 1328a2566b fix(admininistration(js)): improve handling of unauthorized access 2022-05-16 17:43:35 -04:00
Francis Lachapelle dd0730947f web: update window title depending on active module
Fixes #4982
2022-05-16 17:43:35 -04:00
Francis Lachapelle 0cf025b0af refactor(js): improve defintion of some controllers 2022-05-16 17:43:35 -04:00
InverseBot 5c0d8c11da chore(js/css): update generated files 2022-05-13 00:21:37 -04:00
Francis Lachapelle 33217456fc fix(administration): add theme preview 2022-05-12 16:59:25 -04:00
Francis Lachapelle 1e9ae3184b fix(administration(js)): fix toast when saving ACLs 2022-05-12 15:54:53 -04:00
Francis Lachapelle 373ac51e62 fix(core): don't auto-remove a subscription if any source is in error 2022-05-11 16:29:49 -04:00
Francis Lachapelle ab5f5abc80 i18n(ja): fix mail reply and forward templates 2022-05-10 21:35:34 -04:00
InverseBot 58a9c56897 chore(js/css): update generated files 2022-05-10 00:22:03 -04:00
abma 09ac2dfda3 fix(mail(js)): fix url for protocol Handler registration
Fixes #5513
2022-05-09 14:49:51 -04:00
Francis Lachapelle 5dce4d0cc9 chore(release): 5.6.0 2022-05-04 09:23:10 -04:00
Francis Lachapelle 709c8da56a chore(timezones): update to version 2022a 2022-05-03 16:37:41 -04:00
Francis Lachapelle 048858ba0f feat(calendar): optionally remove attendees that can't be invited
If some attendees have prevented others to invite them, offer the
organizer to remove them when saving the invitation.
2022-05-03 09:16:44 -04:00
InverseBot 1e87e294a7 chore(js/css): update generated files 2022-05-03 00:21:31 -04:00
Francis Lachapelle 6eaa362543 i18n(de): update German translation 2022-05-02 17:24:54 -04:00
Francis Lachapelle 485371f41b chore(Apache): minor improvements to Apache configuration
Add Cache-Control header for dynamic content.
2022-05-02 17:04:27 -04:00
Francis Lachapelle 4657f5617d i18n(pl): update Polish translation 2022-05-02 16:45:18 -04:00
Francis Lachapelle 7fccfb2f8e i18n(it): update Italian translation 2022-05-02 16:44:44 -04:00
Francis Lachapelle 0211153877 i18n(fr): update French translation 2022-05-02 16:43:26 -04:00
Francis Lachapelle 1b3b9c253c fix(calendar(js)): adjust line of the current time to user's timezone
Fixes #5512
2022-05-02 12:37:58 -04:00
Francis Lachapelle 700d726511 fix(addressbook): allow search on name fields in personal addressbooks 2022-04-29 13:50:22 -04:00
Francis Lachapelle 2f725a3f2d feat(calendar): search for past events and tasks
Fixes #5441
2022-04-28 13:47:02 -04:00
Francis Lachapelle 8fccd23227 fix(calendar): fix yearly recurrence calculator with a finite rule
Fixes #5506
2022-04-28 11:46:59 -04:00
InverseBot aee7393b2d chore(js/css): update generated files 2022-04-28 00:22:04 -04:00
Francis Lachapelle c2eed7844a fix(mail(js)): use different email separator keys depending on locale
Fixes #3513
Fixes #4042
Fixes #5308
Fixes #5309
2022-04-27 15:38:51 -04:00
Francis Lachapelle a5b85d72bc fix(addressbook): close DB connection after LDIF import
Fixes #5507
2022-04-27 13:56:56 -04:00
Francis Lachapelle 8a0c46ded2 chore: update 9-table model migration script to match latest schema 2022-04-26 14:11:41 -04:00
Francis Lachapelle b35a10a280 fix(web): update parameters of meta tag for robots
Fixes #4930
2022-04-25 17:24:10 -04:00
Francis Lachapelle 090c1ea9e7 fix(mail): mark deleted messages as seen
The STATUS command will now report the proper unseen messages count.
2022-04-25 10:28:00 -04:00
InverseBot 73954ef63e chore(js/css): update generated files 2022-04-23 00:22:28 -04:00
Francis Lachapelle b198c84b42 fix(mail(js)): improve scrolling of list when moving with arrows keys 2022-04-22 17:27:35 -04:00
Francis Lachapelle c8ce3f10d6 fix(mail(js)): perform a full fetch when in unseen/flagged mode 2022-04-22 15:26:22 -04:00
Francis Lachapelle f32c3d78e5 fix(mail): add subject and date to file names of exported messages 2022-04-22 14:58:27 -04:00
Francis Lachapelle 2676aa9539 fix(calendar): set missing RSVP parameter to TRUE for attendees
This is not the expected behaviour defined in the RFC, but it's more
convenient for users.
2022-04-19 15:30:39 -04:00
Francis Lachapelle a0f6842267 fix(eas): improve error logging 2022-04-19 15:15:01 -04:00
Francis Lachapelle 5cd006286e i18n(hu): update Hungarian translation 2022-04-17 22:13:40 -04:00
Francis Lachapelle 4e5c865a3f feat(calendar): optionally remove attendees that can't be invited
If some attendees have prevented others to invite them, offer the
organizer to remove them when saving the invitation.
2022-04-14 20:39:36 -04:00
Francis Lachapelle 59eda2f1b8 i18n(bg): update Bulgarian translation 2022-04-14 09:05:43 -04:00
InverseBot 0a48821100 chore(js/css): update generated files 2022-04-12 00:20:56 -04:00
Francis Lachapelle 2c76f177a3 i18n(de): update German translation 2022-04-11 16:52:09 -04:00
Francis Lachapelle dae6d6d521 fix(calendar): update calendar of all attendees when active user is not owner 2022-04-11 16:42:34 -04:00
Francis Lachapelle 1509090dc1 i18n(it): update Italian translation 2022-04-11 14:37:39 -04:00
Francis Lachapelle 30ab725b71 i18n(pt_BR): update Brazilian Portuguese translation 2022-04-11 13:53:00 -04:00
Francis Lachapelle 969cfd362c fix(addressbook): handle LDIF file with a single contact when importing 2022-04-11 09:09:37 -04:00
Francis Lachapelle 2cf77b6145 fix(mail): force TNEF body parts to be decoded in UTF-8 2022-04-08 11:21:48 -04:00
Francis Lachapelle dcc2ebcd4a i18n(fr): update French translation 2022-04-08 10:14:53 -04:00
Francis Lachapelle c6a41d31ce fix(mail): avoid exception when accessing signed/encrypted body parts 2022-04-08 10:02:54 -04:00
InverseBot 1228cc5213 chore(js/css): update generated files 2022-04-07 00:20:59 -04:00
Francis Lachapelle 8ed4fc88b5 feat(mail): always forward incoming messages, before all filters
This new "Always forward" checkbox allows the user to forward incoming
messages before evaluating the other filters, if any. When unchecked,
the "redirect" directive is executed after all filters; if a filter
stops evaluating the remaining rules, the message won't be forwarded.
2022-04-06 15:43:07 -04:00
Francis Lachapelle 44afac0715 fix(addressbook): preload cards when creating list from selection 2022-04-06 13:24:47 -04:00
Francis Lachapelle 4b9564139b fix(mail): improve error loging when encrypting/decrypting a msg 2022-04-05 15:33:54 -04:00
Francis Lachapelle 32e0479bf1 i18n(sl_SI): update Slovenian translation 2022-03-30 19:43:59 -04:00
Francis Lachapelle 53354c5db2 fix(mail): improve error loging when signing a message 2022-03-29 10:53:23 -04:00
Francis Lachapelle 6d50dee063 fix(core): encode reserved HTML characters in RTF parser
Fixes #5388
2022-03-29 10:44:35 -04:00
Francis Lachapelle a5d18bfced fix(core): improve escaping of double-quotes
Fixes #5351
2022-03-29 10:39:09 -04:00
Francis Lachapelle 3140a9dc1d fix(acls): fix SQL conversion for LIKE operator to find groups
Fixes #5492
2022-03-28 13:50:03 -04:00
InverseBot 97e8f082c2 chore(js/css): update generated files 2022-03-28 00:20:58 -04:00
Francis Lachapelle 3e11e0a62a chore: SQL update script for v5.6.0
Fixes #5491
2022-03-25 11:22:51 -04:00
Francis Lachapelle c348ca2b85 fix(calendar(dav)): prevent duplicates in PUT 2022-03-25 07:11:02 -04:00
Francis Lachapelle fbd2eb8294 fix(calendar): rely on organizer's event state before updating attendee
When an attendee is adding a new event for which the organizer is local
but doesn't have the event anymore, return a 412 error code.

Fixes #5496
2022-03-24 15:31:39 -04:00
Francis Lachapelle 5d2877cf0a test: add plus sign to timezone in Sieve script 2022-03-24 15:26:37 -04:00
Francis Lachapelle ec7199e00f fix(addressbook): keep folders order in matching contacts
This will ensure sources (LDAP/SQL) entries are returned first.
2022-03-23 12:00:52 -04:00
Francis Lachapelle b37e68b8ee fix(dav): use utf-8 as charset name instead of utf8
Fixes #5495
2022-03-22 10:41:31 -04:00
InverseBot 38ace5ec75 chore(js/css): update generated files 2022-03-22 00:20:57 -04:00
Francis Lachapelle 7c0592e03e fix(mail(js)): map the NSLocale to the proper CKEditor locale 2022-03-21 15:57:51 -04:00
Francis Lachapelle 06497a729c chore(npm): update CKEditor to version 4.18.0 2022-03-21 13:44:24 -04:00
Francis Lachapelle c7ee4d8c19 fix(addressbook(web)): update card on save when certificate is removed 2022-03-21 10:12:21 -04:00
Francis Lachapelle 547d26af19 fix(addressbook(js)): unselect current card on delete 2022-03-21 09:22:52 -04:00
Francis Lachapelle 896fe27c61 test: handle DST change in CalDAVSchedulingSpec.js 2022-03-11 10:28:44 -05:00
Francis Lachapelle 55baeb107f fix(mail): check return value of "setacl" IMAP command 2022-03-09 14:57:32 -05:00
Francis Lachapelle 1545bcdbba fix(addressbook(dav)): improve handling of addressbook-query 2022-03-09 11:15:38 -05:00
Francis Lachapelle a965f276c8 fix(web): support passwords up to 2048 characters
Fixes #5485
2022-03-08 16:34:38 -05:00
redgloboli 17f1df3904 doc: add ytnef to exclude section in epel.repo 2022-03-07 11:07:14 -05:00
Francis Lachapelle 96d00b744e fix(mail(web)): display emails extracted from smime certificate
Fixes #5440
2022-03-07 11:03:04 -05:00
Francis Lachapelle 31da2d9f59 fix(mail): case insensitve check of sender address with certificate 2022-03-07 10:27:48 -05:00
Francis Lachapelle e417c0b201 fix(calendar(dav)): prevent duplicates in PUT 2022-03-04 09:34:45 -05:00
Francis Lachapelle 8409c3cbb5 fix(addressbook(dav)): add support for mail property in addressbook-query
Fixes #5489
2022-03-04 08:29:03 -05:00
InverseBot 74a73638cf chore(js/css): update generated files 2022-03-04 00:52:19 -05:00
Francis Lachapelle 87b1c8e239 fix(web(js)): show toast when fetching a folder ACLs fails 2022-03-03 14:00:29 -05:00
InverseBot 580391406f chore(js/css): update generated files 2022-03-02 00:20:17 -05:00
Francis Lachapelle 04ffc01768 test: temporary fix for CardDAVSpec.js 2022-03-01 17:48:29 -05:00
Francis Lachapelle d15e3b949f test: fix CardDAVSpec.js 2022-03-01 16:38:30 -05:00
Francis Lachapelle d90e29ed63 fix(mail(js)): improve signature replacement when switching identities 2022-03-01 13:16:19 -05:00
Francis Lachapelle 7f31686bc5 test: fix CardDAVSpec.js 2022-03-01 07:52:53 -05:00
Francis Lachapelle 7faab9117a fix(addressbook(dav)): improve handling of addressbook-query 2022-02-28 17:07:39 -05:00
Francis Lachapelle 3f93e6ebc4 fix(calendar): update quick table when removing all categories of task 2022-02-21 11:11:26 -05:00
Francis Lachapelle 8a3cb76f0a fix(calendar): send modification notifications for tasks 2022-02-21 10:44:49 -05:00
InverseBot 4f9601edb2 chore(js/css): update generated files 2022-02-19 00:20:21 -05:00
Francis Lachapelle c476503d4a feat(mail(web)): forward multiple messages as attachments
Fixes #33
2022-02-18 17:05:25 -05:00
Francis Lachapelle a98b404551 fix(imap): use proxy authentication to detect IMAP delimiter
Fixes #5479
2022-02-17 10:09:37 -05:00
Francis Lachapelle 557ff59ea5 fix(mail): identify junk mailbox in lookup
Fixes #5482
2022-02-16 08:35:07 -05:00
Francis Lachapelle 401a80078c fix(preferences): don't save Sieve script if Mail module disabled 2022-02-15 10:49:39 -05:00
Francis Lachapelle 0e20bbc28e perf(mail): perform IMAP STATUS command to fetch unseen msgs count 2022-02-15 10:25:46 -05:00
Francis Lachapelle b2438873fe i18n(pl): update Polish translation 2022-02-15 08:28:38 -05:00
Francis Lachapelle f69fe5bea1 i18n(de): update German translation 2022-02-15 08:28:22 -05:00
Francis Lachapelle 1b408a6ade i18n(fr): update French translation 2022-02-15 08:28:06 -05:00
InverseBot 8ad34a1630 chore(js/css): update generated files 2022-02-15 00:53:25 -05:00
Francis Lachapelle 10282ae3a4 style(obj-c): remove unused code 2022-02-14 14:23:44 -05:00
Francis Lachapelle 63ad7aac9f fix(mail): identify junk mailbox in lookup
Fixes #5482
2022-02-14 13:35:06 -05:00
Francis Lachapelle 6c420861d4 fix(mail(js)): handle new message from template in popup window 2022-02-14 12:56:08 -05:00
Francis Lachapelle 21dc73df56 feat(mail(web)): Templates folder for pre-defined drafts
To create a template, the user needs to:

- define a mailbox as the Templates folder;
- move a draft to this special folder.

Fixes #4320
Fixes #5363
2022-02-14 09:33:53 -05:00
Francis Lachapelle d097193904 fix(preferences): don't save Sieve script if Mail module disabled 2022-02-14 09:04:26 -05:00
InverseBot 5e9260303c chore(js/css): update generated files 2022-02-12 00:20:54 -05:00
Francis Lachapelle a74cf05af8 fix(preferences): fix compilation warning 2022-02-11 14:12:11 -05:00
Francis Lachapelle 1e52e18f89 fix(preferences): fix compilation warning 2022-02-11 10:06:57 -05:00
Francis Lachapelle b252aeb29b fix(mail(js)): expect the recipient to become a string when saving a message 2022-02-11 10:06:57 -05:00
Francis Lachapelle 10076bea09 fix(mail(js)): show the recipient when in the Drafts mailbox 2022-02-11 10:06:57 -05:00
Francis Lachapelle bd5a5e3049 fix(mail): remove signature prior to sign the message 2022-02-11 10:06:57 -05:00
Francis Lachapelle c986422a3d feat(mail(web)): Templates folder for pre-defined drafts
To create a template, the user needs to:

 - define a mailbox as the Templates folder;
 - move a draft to this special folder.

Fixes #4320
Fixes #5363
2022-02-11 10:06:57 -05:00
Slavi Pantaleev 02b0a41567 i18n(bg): update Bulgarian translation 2022-02-11 09:33:56 -05:00
Francis Lachapelle fe038bb2ef fix(mail): identify junk mailbox in lookup
Fixes #5482
2022-02-11 08:04:11 -05:00
InverseBot d9cb5785c6 chore(js/css): update generated files 2022-02-11 00:20:51 -05:00
Francis Lachapelle d63fd6c3a2 fix(mail): don't add signature unless a default identity is forced 2022-02-10 15:56:19 -05:00
Francis Lachapelle b1a6487744 i18n(de): update German translation 2022-02-10 13:51:43 -05:00
Francis Lachapelle 80b0d99687 fix(preferences(js)): don't check Sieve capabilities if Mail module disabled 2022-02-10 10:03:16 -05:00
Francis Lachapelle 3847b57855 fix(mail): fix type of SOGoMailComposeFontSize defaults 2022-02-09 22:26:11 -05:00
Francis Lachapelle 150fe7086e chore(npm): update CKEditor to version 4.17.2 2022-02-09 22:20:36 -05:00
InverseBot 2dbf206b1b chore(js/css): update generated files 2022-02-09 00:20:33 -05:00
Francis Lachapelle fa598e83ee fix(mail(js)): parse all parameters of mailto: link
Fixes #5478
2022-02-08 13:10:27 -05:00
InverseBot 3ef9002894 chore(js/css): update generated files 2022-02-08 00:20:44 -05:00
Francis Lachapelle a09cf58915 fix(mail): ensure </html> is at the end of the document prior parsing
Fixes #5477
2022-02-07 15:00:22 -05:00
Francis Lachapelle a1d74a8910 fix(preferences(js)): don't check Sieve script if Mail module disabled 2022-02-07 10:26:48 -05:00
Francis Lachapelle 0f77c1cbed chore(release): 5.5.1 2022-02-04 10:13:16 -05:00
Francis Lachapelle 2220e517fd i18n(pl): update Polish translation 2022-02-04 09:07:07 -05:00
Francis Lachapelle f4d875edac i18n(de): update German translation 2022-02-04 09:06:44 -05:00
Francis Lachapelle 76f04e0058 i18n(fr): update French translation 2022-02-04 09:02:53 -05:00
Francis Lachapelle 1b31e4b694 i18n(bg): update Bulgarian translation 2022-02-04 09:02:33 -05:00
Francis Lachapelle e3a2f5a1ff chore(tool): don't disable auto-reply for temporary constraints
Fixes #5475
2022-02-03 10:17:23 -05:00
Francis Lachapelle e54631becf chore(addressbook): remove UIxContactView.wox and UIxListView.wox 2022-02-02 10:59:53 -05:00
Francis Lachapelle 4f255ac9d5 fix(mail): use body as first part when msg has no parts
Fixes #5472
2022-02-02 10:26:01 -05:00
Francis Lachapelle e3b71bc23b fix(core): fix compilation in NSData+SMIME.m 2022-02-02 10:11:59 -05:00
Francis Lachapelle f5f1594972 fix(web): add missing image for desktop notifications
Fixes #5474
2022-02-02 09:15:44 -05:00
Francis Lachapelle 0c5a2691b0 fix(calendar): handle DST change for all-day events 2022-02-01 17:30:26 -05:00
Francis Lachapelle 96bb8b4cc2 fix(dav): render DAV exceptions as XML 2022-02-01 14:20:32 -05:00
Francis Lachapelle 348a79c795 fix(addressbook): close DB connection after DAV query 2022-02-01 10:14:37 -05:00
Francis Lachapelle 7c81e3acec fix(core): only escape "%" with the SQL LIKE operator 2022-01-31 14:53:58 -05:00
InverseBot 88b0b6a00b chore(js/css): update generated files 2022-01-28 00:54:59 -05:00
Francis Lachapelle d65b5a8418 fix(preferences(js)): fix validation of enabled days for vacation
Fixes #5469
2022-01-27 16:44:17 -05:00
Francis Lachapelle aca7fc53a5 fix(calendar): send notification on move and copy operations
Fixes #3792
2022-01-27 15:10:20 -05:00
Francis Lachapelle 2e58ddfae3 fix(dav): render DAV exceptions as XML 2022-01-27 13:05:24 -05:00
InverseBot 28634b96ab chore(js/css): update generated files 2022-01-27 00:21:32 -05:00
Francis Lachapelle 663915b12f fix(calendar): display start & end dates in mail notifications 2022-01-26 20:38:09 -05:00
Francis Lachapelle 8dda30e4ec fix(mail(js)): restore threads state upon initialization 2022-01-26 14:58:03 -05:00
Francis Lachapelle 929c6b1c0c fix(mail): improve reply and forward templates
Fixes #5415
2022-01-26 09:02:03 -05:00
Francis Lachapelle 3eec819984 fix(mail): improve parsing of S/MIME certificate
Fixes #5215
2022-01-25 08:43:33 -05:00
Francis Lachapelle c12dd56362 fix(mail): improve parsing of S/MIME certificate
Fixes #5215
2022-01-24 14:53:03 -05:00
Francis Lachapelle e513a7242a test: fix DAVCalendarSuperUserAclTest 2022-01-24 08:29:59 -05:00
Francis Lachapelle bf36279e0e test: improve functions names related to sync-collection 2022-01-21 16:56:54 -05:00
Francis Lachapelle 54b163da2d fix(mail): S/MIME improvements
Fixes #4891
Fixes #5450
2022-01-21 16:24:13 -05:00
Francis Lachapelle b061046992 fix(calendar(dav)): add DAV:status to DAV:response only when deleted
Fixes #5163
2022-01-21 14:47:32 -05:00
Francis Lachapelle 969d68dbb6 fix(core): remove trailing closing angle bracket from detected URLs
Fixes #5465
2022-01-21 11:07:00 -05:00
Francis Lachapelle 940394d435 fix(addressbook(dav)): return all value of all properties
Fixes #5462
2022-01-20 17:06:39 -05:00
Francis Lachapelle ca9d2d1cdc fix(mail): don't allow XML inline attachments 2022-01-20 14:47:23 -05:00
Francis Lachapelle 5575a4c3c8 fix(calendar): swap dates when event start date is after end date 2022-01-20 11:03:55 -05:00
Francis Lachapelle 54d3f33397 fix(mail(js)): remove WebSpellChecker Dialog plugin from CKEditor
This module has reached its End-Of-Life (2021-12-31).

See https://ckeditor.com/cke4/addon/wsc
2022-01-19 09:44:12 -05:00
Francis Lachapelle 75bf551db9 chore(release): 5.5.0 2022-01-18 11:10:09 -05:00
Francis Lachapelle 06bf9149d6 fix(addressbook): remove debugging output 2022-01-18 09:47:41 -05:00
Francis Lachapelle e8d7faf6f4 chore(cron): run update-autoreply every 5 minutes
We need to run this cronjob more frequently as an auto-reply can be
enabled or disabled during the day.
2022-01-18 09:43:51 -05:00
Francis Lachapelle d1c089c957 docs: update README with new translation contributor 2022-01-18 09:13:08 -05:00
Francis Lachapelle b9a765730f docs: improve syntax, update year 2022-01-18 09:12:17 -05:00
InverseBot 3a8856ac34 chore(js/css): update generated files 2022-01-18 00:20:29 -05:00
Francis Lachapelle 9eb38a1f6c i18n(uk): update Ukrainian translation 2022-01-17 17:11:57 -05:00
Francis Lachapelle a7c991683a i18n(ru): update Russian translation 2022-01-17 17:08:30 -05:00
Francis Lachapelle 7c016332f0 i18n(bg): update Bulgarian translation 2022-01-17 17:06:11 -05:00
Francis Lachapelle 2a25cfbffb i18n(pt_BR): update Brazilian Portuguese translation 2022-01-17 17:05:01 -05:00
Francis Lachapelle 29d7fe468f i18n(sr_SR): update Montenegrin translation 2022-01-17 17:04:14 -05:00
Francis Lachapelle b967eac1f3 fix(core): remove trailing closing angle bracket from detected URLs
Fixes #5465
2022-01-17 16:43:11 -05:00
Francis Lachapelle 9d7c6a2ca8 fix(mail(css)): restrict the viewport of the message body viewer 2022-01-17 15:23:35 -05:00
tfux c75ac6c321 fix(core): fix compilation warning in SOGoCacheGCSObject 2022-01-17 07:58:15 -05:00
Francis Lachapelle 1ab21b041e fix(mail): make sure QRESYNC is enabled in getChangesAction 2022-01-14 10:21:58 -05:00
Francis Lachapelle 2c6cd53ea7 fix(mail): improve handling of QRESYNC responses 2022-01-14 10:13:20 -05:00
Francis Lachapelle 3c26e04c52 fix(mail(html)): remove "rel" attribute from sanitized HTML mails
We already add the rel="noopener" to external links, so it's probably
safe to remove it from all tags.
2022-01-13 17:03:57 -05:00
Francis Lachapelle 68608c4e7f fix(mail(js)): remove double quotes prior checking attributes values 2022-01-13 15:01:43 -05:00
Francis Lachapelle 45db044a63 style(obj-c): replace tabs by spaces 2022-01-13 08:46:25 -05:00
Francis Lachapelle 39e1ef5319 fix(eas): handle module constraints
Fixes #5456
2022-01-13 08:42:07 -05:00
InverseBot b7171be1da chore(js/css): update generated files 2022-01-13 00:20:29 -05:00
Francis Lachapelle 7a776cd0b8 fix(mail(css)): highligh flagged/starred messages 2022-01-12 17:16:48 -05:00
Francis Lachapelle 10c69ae165 fix(mail(css)): highligh flagged/starred messages 2022-01-12 17:15:17 -05:00
Francis Lachapelle 73edd45a96 fix(eas): handle module constraints
Fixes #5456
2022-01-12 16:01:07 -05:00
Francis Lachapelle ecc1dee87a fix(mail): support very large HIGHESTMODSEQ values 2022-01-12 14:16:43 -05:00
Francis Lachapelle 368360bb95 fix(addressbook): respect visible domains when fetching contact
Fixes #4896
2022-01-11 16:40:53 -05:00
Francis Lachapelle cf341822ee fix(eas): handle module constraints
Fixes #5456
2022-01-11 13:41:49 -05:00
Francis Lachapelle 179992c092 fix(mail): use .eml extension for message/global body parts
See RFC 6532
2022-01-10 15:23:14 -05:00
Francis Lachapelle b0c5adf525 fix(mail): handle empty "Mail.Note" in ms-tnef body part
Fixes #5388
2022-01-07 16:02:55 -05:00
Francis Lachapelle 81c19976e3 fix(mail): handle case where the msg is of content type application 2022-01-07 14:44:58 -05:00
Francis Lachapelle 66bac18558 fix(core): avoid SQL aggregate function when testing table existence 2022-01-07 11:39:13 -05:00
Francis Lachapelle b81704860a fix(calendar): ensure alarms have a DESCRIPTION property 2022-01-06 15:13:58 -05:00
Francis Lachapelle cabba35ac3 fix(mail): limit number of headers in getChangesAction response 2022-01-06 11:42:40 -05:00
Francis Lachapelle fad52dd1b8 fix(addressbook): handle LDIF file with headers when importing contacts 2022-01-06 10:50:15 -05:00
Francis Lachapelle 91e1aec6eb i18n(bs_BA): update Bosnian translation 2022-01-06 10:50:14 -05:00
InverseBot 95b2afa0f6 chore(js/css): update generated files 2022-01-06 00:52:42 -05:00
Francis Lachapelle 07b4ad6c72 i18n(bs_BA): add Bosnian translation 2022-01-05 17:33:55 -05:00
Francis Lachapelle 9eba2f125e fix(mail(js)): update unseen count when it's zero 2022-01-04 12:45:53 -05:00
Francis Lachapelle edcf03e179 fix(mail(js)): save "mark as read" delay when changing mode 2022-01-04 12:23:38 -05:00
Francis Lachapelle d3ede8ce73 chore(npm): update md to v1.2.4
Fixed sass deprecation warnings.
2022-01-04 11:43:52 -05:00
tfux f8b4187d1d feat(eas): implement replyTo element 2022-01-04 07:51:18 -05:00
InverseBot 22756f1397 chore(js/css): update generated files 2021-12-23 00:20:31 -05:00
Francis Lachapelle 4681d2f5d7 chore(release): 5.4.0 2021-12-22 07:12:53 -05:00
Francis Lachapelle 84038033ba chore(js/css): update generated files 2021-12-22 07:12:53 -05:00
InverseBot 5300bb71b7 chore(js/css): update generated files 2021-12-17 00:25:13 -05:00
Francis Lachapelle f1912310db fix(preferences): add plus sign to timezone in Sieve script
Fixes #5448
2021-12-16 09:40:52 -05:00
Francis Lachapelle 2daeab3dd7 fix(preferences): add plus sign to timezone in Sieve script
Fixes #5448
2021-12-16 09:14:37 -05:00
Francis Lachapelle bdfe1be770 fix(preferences(js)): don't alter the list of default email addresses
Fixes #5443
2021-12-16 08:10:01 -05:00
InverseBot 2754737453 chore(js/css): update generated files 2021-12-16 00:20:34 -05:00
Francis Lachapelle 3e9b8db78c i18n(pl): update Polish translation 2021-12-15 17:31:39 -05:00
Francis Lachapelle b665f7e1c6 i18n(de): update German translation 2021-12-15 17:31:07 -05:00
Francis Lachapelle 6084fcd435 i18n(fr): update French translation 2021-12-15 17:30:49 -05:00
Francis Lachapelle 635b8c68db fix(mail(js)): update unseen count when it's zero 2021-12-15 17:14:11 -05:00
Francis Lachapelle 78855be162 fix(mail(js)): expose all account identities in popup window
Fixes #5442
2021-12-15 17:12:37 -05:00
Francis Lachapelle 46971d47b9 fix(preferences(js)): improve initialization of dates/times constraints
Fixes #5443
2021-12-15 16:39:14 -05:00
InverseBot 72d417dd32 chore(js/css): update generated files 2021-12-14 00:20:28 -05:00
Francis Lachapelle 25c69aaef4 fix(mail(js)): resolve draft mailbox from popup window
Fixes #5442
2021-12-13 14:30:39 -05:00
InverseBot 254121052d chore(js/css): update generated files 2021-12-11 00:20:32 -05:00
Francis Lachapelle 748fd8fa9a i18n(fr): update French translation 2021-12-10 16:57:53 -05:00
Francis Lachapelle 070f1a6094 i18n(pl): update Polish translation 2021-12-10 16:46:42 -05:00
Francis Lachapelle 6684784769 i18n(de): update German translation 2021-12-10 16:46:13 -05:00
Francis Lachapelle 07f2c2606d i18n(hu): update Hungarian translation 2021-12-10 16:45:23 -05:00
Francis Lachapelle 93dff697e7 fix(mail(web)): display emails extracted from smime certificate
Fixes #5440
2021-12-10 14:33:10 -05:00
Francis Lachapelle cb4d555e4a fix(preferences(js)): set default auto mark as read delay to 5
Fixes #5443
2021-12-10 11:08:39 -05:00
InverseBot a89d3a4fa1 chore(js/css): update generated files 2021-12-10 00:20:22 -05:00
Francis Lachapelle 1786ec4d59 fix(mail(js)): ignore return key in input fields of editor
Fixes #4666
2021-12-09 17:31:56 -05:00
Francis Lachapelle 153c1eeb80 fix(core): avoid exception when the user's cn is null 2021-12-09 10:03:59 -05:00
InverseBot e3ef4e2c78 chore(js/css): update generated files 2021-12-08 00:21:11 -05:00
Francis Lachapelle 56a6f246d6 fix(login(js)): input focus on TOTP field 2021-12-07 16:31:28 -05:00
Francis Lachapelle 4eed98d58d feat(mail): delay or disable automatic mark message as read
Fixes #1585
2021-12-07 09:55:13 -05:00
Francis Lachapelle 30040ba590 chore(debian): enable MFA on Debian 11/Bullseye
Fixes #5438
2021-12-06 13:04:51 -05:00
InverseBot 6e73148ae2 chore(js/css): update generated files 2021-12-04 00:20:26 -05:00
Francis Lachapelle 1febace837 fix(web): add missing tooltips for expand/reduce buttons 2021-12-03 18:25:47 -05:00
Francis Lachapelle e064e9af44 fix(web(js)): position notifications to the bottom right
Fixes #5127
Fixes #5423
2021-12-03 17:40:21 -05:00
Francis Lachapelle f9ed6391e6 fix(mail): allow to directly empty junk folder
Fixes #5224
2021-12-03 16:56:57 -05:00
Francis Lachapelle 4ad2105543 fix(mail): sign and send only if smime certificate matches sender address
Fixes #5407
2021-12-03 16:54:27 -05:00
Francis Lachapelle 201458954b fix(preferences(css)): align timepicker inside input container 2021-12-03 13:20:24 -05:00
InverseBot 02f541c43c chore(js/css): update generated files 2021-12-03 00:20:35 -05:00
Francis Lachapelle e0df54838e fix(mail): delete msgs once moved to an external account 2021-12-02 17:11:13 -05:00
Francis Lachapelle 8724f90dd1 fix(mail(js)): don't poll server from popup windows 2021-12-02 14:50:44 -05:00
Francis Lachapelle 2ecd441f32 feat(mail): enable autoreply on specific days or at a specific time
Fixes #5328
2021-12-02 14:20:47 -05:00
InverseBot 6807d1df8b chore(js/css): update generated files 2021-12-02 00:20:27 -05:00
Francis Lachapelle c17165d85d fix(calendar(js)): improve bi-weekly event description
Fixes #5261
2021-12-01 15:08:09 -05:00
Francis Lachapelle c3c9432cc2 fix(mail(js)): don't allow to rename special mailboxes 2021-12-01 14:31:17 -05:00
Francis Lachapelle 8afc80d82e fix(mail(html)): ban "javascript:" prefix in href, action and formaction 2021-12-01 11:35:05 -05:00
InverseBot 426b28eda7 chore(js/css): update generated files 2021-12-01 00:20:25 -05:00
InverseBot 65620c24b1 chore(js/css): update generated files 2021-11-30 00:20:44 -05:00
Francis Lachapelle 8cb5ef363a fix(mail): only apply IMAP host constraint when SSO is enabled
Fixes #5433
2021-11-29 14:38:05 -05:00
Francis Lachapelle e62dd42d2b test: simplify MailDAV test of mailboxes creation 2021-11-29 13:51:40 -05:00
Francis Lachapelle d70486f983 test: print response when MKCOL fails for a mailbox 2021-11-26 11:08:52 -05:00
Francis Lachapelle c4bb0de11e fix(mail): don't lowercase href/action/formaction attribute value
Fixes #5434
2021-11-26 08:34:45 -05:00
InverseBot d484c2b8bd chore(js/css): update generated files 2021-11-26 00:20:55 -05:00
Francis Lachapelle 9c025f6871 fix(calendar): update email alarm of yearly events
We now compute the next alarms of a yrealy recurrent event for a period
of two years in order to make sure to pickup the next occurrence and
update the email alarms table, otherwise sogo-ealarms-notify was sending
email alarms every minute until the next alarm was properly computed.

Fixes #4991
2021-11-25 17:51:18 -05:00
Simon Hauser fc121acff3 fix(addressbook(js)): custom field creation
availableKeys will always be an array containing ["1", "2", "3", "4"]
because currently the wrong customFields is not accessed correctly.

This leads to the removal of CUSTOM1 if you wanna add a second custom
field.
2021-11-25 13:17:33 -05:00
InverseBot 841dc683b5 chore(js/css): update generated files 2021-11-25 00:20:46 -05:00
Francis Lachapelle 6ef99a5ec4 fix(mail(js)): save draft after having removed an attachment
Fixes #5432
2021-11-24 17:07:02 -05:00
Francis Lachapelle a98b46a7a7 fix(mail(js)): create new object instances in popup from parent's data 2021-11-24 16:35:17 -05:00
Francis Lachapelle cb6b729c58 fix(mail(js)): don't load mailboxes list from popup editor 2021-11-24 11:03:23 -05:00
Francis Lachapelle 11eb6c29d4 fix(mail(js)): don't poll server from popup windows 2021-11-24 11:03:23 -05:00
InverseBot a08c4c9f47 chore(js/css): update generated files 2021-11-24 00:20:49 -05:00
Francis Lachapelle addf3c1c76 fix(mail(js)): open one distinct popup for each action
Fixes #5431
2021-11-23 17:37:49 -05:00
Francis Lachapelle ff1eecaf5a fix(mail): show comment attribute of iTIP replies
Fixes #5410
2021-11-22 16:20:56 -05:00
Francis Lachapelle e85576cbb7 fix(mail): check if smime certificate matches sender address
Fixes #5407
2021-11-22 15:31:39 -05:00
Francis Lachapelle 28b9224de4 chore(release): 5.3.0 2021-11-18 15:37:57 -05:00
Francis Lachapelle 7072319ddf i18n(pt_BR): update Brazilian Portuguese translation 2021-11-17 20:41:46 -05:00
tfux 33b2406bf1 fix(eas): handle attachments of type message/rfc822 when sanitize emails (fixes #5427) (#304) 2021-11-18 12:44:13 -05:00
Francis Lachapelle 16de167524 chore(npm): update CKEditor to version 4.17.1 2021-11-17 19:18:53 -05:00
Francis Lachapelle 1a7ba3d4ef test: migration from Python to JavaScript 2021-11-17 19:13:36 -05:00
Francis Lachapelle 8cec92ea87 fix(calendar): truncate long UIDs to avoid SQL insert error 2021-11-17 16:59:51 -05:00
Francis Lachapelle 71b67259c6 test: migration from Python to JavaScript 2021-11-16 21:51:13 -05:00
Francis Lachapelle a3e21cbf9d test: migration from Python to JavaScript 2021-11-16 17:14:36 -05:00
Francis Lachapelle 0622093a37 test: assign array counts to variables in SOGoAppointmentObject 2021-11-16 15:45:48 -05:00
Francis Lachapelle 8eb255ad61 test: migration from Python to JavaScript 2021-11-16 15:23:55 -05:00
Francis Lachapelle e99090b6b3 fix(mail(html)): ban "javascript:" prefix in href, action and formaction 2021-11-15 17:22:18 -05:00
Francis Lachapelle 92820db3bb test: migration from Python to JavaScript 2021-11-10 06:31:25 -05:00
Francis Lachapelle 152058774f chore(deb): fix installation under Ubuntu Xenial/16.04 2021-11-10 06:19:38 -05:00
Francis Lachapelle ae637c49d5 test: migration from Python to JavaScript 2021-11-10 02:27:09 -05:00
Francis Lachapelle 7474967c4f test: migration from Python to JavaScript 2021-11-10 01:54:35 -05:00
Francis Lachapelle 54dae3bc28 test: migration from Python to JavaScript 2021-11-09 22:38:50 -05:00
Francis Lachapelle 8d294467ef test: migration from Python to JavaScript 2021-11-09 22:35:05 -05:00
Francis Lachapelle c860bf4f58 test: migration from Python to JavaScript 2021-11-09 21:56:11 -05:00
Francis Lachapelle d7fde6d2bb test: migration from Python to JavaScript 2021-11-09 17:13:18 -05:00
Francis Lachapelle 9c2b3bd473 fix(mail(dav)): add support for property {DAV:}getcontentlength 2021-11-09 17:11:09 -05:00
Francis Lachapelle 4df5e4b8fc fix(mail(dav)): fix mail-query response 2021-11-09 17:09:25 -05:00
Francis Lachapelle 563f1d2842 fix(mail(dav)): restore support for filtering by sent-date 2021-11-09 16:52:02 -05:00
Francis Lachapelle 620d8a0a2a test: migration from Python to JavaScript 2021-11-09 13:35:50 -05:00
Francis Lachapelle 78d0410400 test: migration from Python to JavaScript 2021-11-09 12:56:47 -05:00
Francis Lachapelle 5afb659dc0 test: migration from Python to JavaScript 2021-11-09 11:13:23 -05:00
Francis Lachapelle 2f739fdc21 test: migration from Python to JavaScript 2021-11-08 16:49:23 -05:00
Francis Lachapelle a5c315fd17 fix(mail(js)): ban all "on*" events attributes from HTML tags 2021-11-08 13:06:02 -05:00
Francis Lachapelle d43b28ca73 test: migration from Python to JavaScript 2021-11-05 16:47:31 -04:00
Francis Lachapelle 262400a92e test: migration from Python to JavaScript 2021-11-04 16:43:35 -04:00
InverseBot b622665359 chore(js/css): update generated files 2021-11-03 00:18:26 -04:00
Francis Lachapelle 6c56340ba5 feat(mail): allow to directly empty junk folder
Fixes #5224
2021-11-02 16:54:36 -04:00
Francis Lachapelle ab67e7d279 fix(mail): check if smime certificate matches sender address
Fixes #5407
2021-11-02 11:04:02 -04:00
Francis Lachapelle 9622a1ea07 fix(mail(js)): reset messages list after emptying trash
Fixes #5421
2021-11-02 08:52:48 -04:00
Francis Lachapelle d6c3c4b1a3 test: migration from Python to JavaScript 2021-11-01 16:46:48 -04:00
Francis Lachapelle d54dca9a1b fix(mail): don't open XML attachments in browser 2021-11-01 10:06:49 -04:00
Francis Lachapelle 6eb5e97154 fix(mail): check if smime certificate matches sender address
Fixes #5407
2021-10-29 16:34:36 -04:00
Francis Lachapelle 5e7c9a8890 i18n(de): update German translation
Fixes #5417
2021-10-28 08:02:42 -04:00
tfux bfcb0b9234 fix(eas): use base64 encoding for attachments when sanitize emails + content-length
Fixes #5408
2021-10-27 08:34:14 -04:00
Francis Lachapelle d751ad99d6 fix(web): use a distinct salt for TOTP authentication 2021-10-26 16:30:55 -04:00
jkellerer f70d60004d fix(eas): proxy authentication in _sendMail 2021-10-26 16:08:35 -04:00
Francis Lachapelle 4c679f1f7b fix(calendar): send modification notifications for tasks 2021-10-25 16:05:57 -04:00
Francis Lachapelle 1ccfa865bb fix(calendar): send modification notifications for tasks 2021-10-25 15:27:01 -04:00
InverseBot c07aeeffec chore(js/css): update generated files 2021-10-23 00:18:23 -04:00
Francis Lachapelle 37d06c6f21 fix(mail(js)): update list of labels when adding one to a message 2021-10-22 15:20:49 -04:00
Francis Lachapelle fbb76722e3 feat(mail): filter messages by tags (labels) 2021-10-22 14:34:45 -04:00
Francis Lachapelle 7c7df9b47c fix(mail(web)): improve identification of mailboxes 2021-10-22 14:34:45 -04:00
InverseBot 33535d3d79 chore(js/css): update generated files 2021-10-22 00:46:59 -04:00
Francis Lachapelle 800e21b05d feat(mail): filter messages by tags (labels)
Fixes #3323
Fixes #3835
Fixes #5338
2021-10-21 17:33:39 -04:00
Francis Lachapelle 175e3802b7 fix(mail): new action to fetch the flags of a mailbox 2021-10-21 17:17:28 -04:00
Francis Lachapelle 642db852c7 fix(mail(js)): reset mailboxes state when leaving global search 2021-10-21 17:11:43 -04:00
InverseBot ab38b1d6c4 chore(js/css): update generated files 2021-10-20 00:18:10 -04:00
Francis Lachapelle c2f95dc56a feat(mail): filter mailbox by flagged messages
Fixes #1417
2021-10-19 16:25:47 -04:00
Francis Lachapelle 270bc2ed2e fix(mail(css)): add bold font to mailboxes with positive unseen count
Fixes #4277
2021-10-19 15:49:44 -04:00
Francis Lachapelle e5dbebb100 feat(mail): filter mailbox by unread messages
Fixes #1146
Fixes #3156
Fixes #4752
2021-10-19 14:49:50 -04:00
InverseBot 248516e947 chore(js/css): update generated files 2021-10-19 00:18:20 -04:00
Francis Lachapelle 80650919b8 feat(mail): prioritize personnal address books in autocompletion 2021-10-18 16:36:47 -04:00
Francis Lachapelle e79b01ebd1 fix(calendar): fix weekly calculator when event has no duration 2021-10-18 14:09:43 -04:00
Francis Lachapelle ecbdf450e3 chore(Apache): pass the URL path "raw" to sogod
Fixes #5303
2021-10-18 10:10:11 -04:00
InverseBot 3832b47b8b chore(js/css): update generated files 2021-10-16 00:19:42 -04:00
Francis Lachapelle d4da1facf9 fix(web): use a distinct salt for TOTP authentication
If TOTP is enabled for a user, it will be disabled until the user
configure it again, which will generate a new private salt.
2021-10-15 16:18:23 -04:00
InverseBot ba86b0fd11 chore(js/css): update generated files 2021-10-15 00:18:22 -04:00
Francis Lachapelle 0eb452c412 fix(mail(js)): force search when restoring mailbox during navigation 2021-10-14 14:32:16 -04:00
Francis Lachapelle fa68c864f1 test: migration from Python to JavaScript 2021-10-12 16:24:47 -04:00
Francis Lachapelle f6a50bb963 fix(doc): add theme for asciidoctor-pdf 2021-10-12 15:12:38 -04:00
Francis Lachapelle cae51dc4d6 fix(mail): use pool to lower memory usage 2021-10-12 11:30:23 -04:00
InverseBot ddfbb98546 chore(js/css): update generated files 2021-10-08 00:18:19 -04:00
Francis Lachapelle fb22c0abaf fix(i18n(sr_RS): fix HTML templates
Fixes #5339
2021-10-07 15:58:34 -04:00
Francis Lachapelle 0b0c8847ba fix(addressbook(js)): sanitize fullname when using HTML
Fixes #5400
2021-10-07 15:31:19 -04:00
Francis Lachapelle 138ee065a2 fix(preferences(js)): review order of mail filter actions
Fixes #5325
2021-10-07 12:57:17 -04:00
Francis Lachapelle 710fd2f492 i18n(ru): update Russian translation 2021-10-07 10:41:55 -04:00
Francis Lachapelle b2b12375db i18n(pl): update Polish translation 2021-10-07 10:41:55 -04:00
Francis Lachapelle a33cf3cd67 i18n(de): update German translation 2021-10-07 10:41:55 -04:00
Francis Lachapelle f10e13b725 i18n(cs): update Czech translation 2021-10-07 10:41:54 -04:00
Francis Lachapelle f669b76435 i18n(bg_BG): update Bulgarian translation 2021-10-07 10:41:54 -04:00
Francis Lachapelle e77d228b58 i18n(uk): update Ukrainian translation 2021-10-07 10:41:54 -04:00
InverseBot daa5438b19 chore(js/css): update generated files 2021-10-07 00:18:15 -04:00
Francis Lachapelle f017c42608 perf(calendar(web)): initiate Web calendars reload from the frontend
The Web calendars subsciptions marked to be reloaded on login are no
longer reloaded from the backend; the sync operation is now activated
from the frontend in XHR calls to avoid blocking the Web interface.

Fixes #4939
2021-10-06 14:16:48 -04:00
InverseBot ef64c13410 chore(js/css): update generated files 2021-10-06 00:18:15 -04:00
Francis Lachapelle ffed88c069 fix(addressbook(js)): sanitize fullname when using HTML 2021-10-05 08:33:29 -04:00
InverseBot 7885932485 chore(js/css): update generated files 2021-10-05 00:18:14 -04:00
Francis Lachapelle 2b101a87b8 test: migration from Python to JavaScript 2021-10-04 13:47:02 -04:00
Francis Lachapelle a14c456800 feat(addressbook): warn when similar contacts are found
When creating a new contact, we now search for similar contacts in the
current addressbook, based on the firstname, lastname, email address,
and telephone number. We return a 409 when such a card is found.
2021-10-04 10:14:14 -04:00
InverseBot d0c91d75f0 chore(js/css): update generated files 2021-10-02 00:19:45 -04:00
Francis Lachapelle 451989ac9c style(obj-c): improve formatting 2021-10-01 11:35:48 -04:00
Francis Lachapelle 38b95af9fd fix(web(js)): reset cached users when closing subscription dialog 2021-10-01 11:18:52 -04:00
Francis Lachapelle a073241e0f fix(addressbook): use pool to lower memory usage 2021-10-01 11:11:34 -04:00
InverseBot 4e6a7f5705 chore(js/css): update generated files 2021-10-01 00:47:46 -04:00
Francis Lachapelle 8f999652cc fix(web): contextualize title in subscription dialog 2021-09-30 14:07:53 -04:00
Francis Lachapelle dec4f24aa4 fix(addressbook): use pool to lower memory usage 2021-09-30 09:13:28 -04:00
Francis Lachapelle 4884cb3978 fix(addressbook): properly handle unknown properties in DAV report 2021-09-29 16:02:52 -04:00
Francis Lachapelle 3da633aebf fix(addressbook): reuse LDAP connection in CardDAV report
Fixes #5355
2021-09-29 16:00:10 -04:00
Francis Lachapelle d181cc4d06 fix(mail): decode ms-tnef (winmail.dat) inside message/rfc822 part
Fixes #5388
2021-09-28 14:57:44 -04:00
Francis Lachapelle 0716656cd4 fix(core): don't log error when deleting an invalid key in memcached 2021-09-24 13:13:10 -04:00
InverseBot 434531cc96 chore(js/css): update generated files 2021-09-23 00:48:00 -04:00
Francis Lachapelle 60dabb7787 calendar: fix weekly/monthly calculators when event has no duration 2021-09-22 13:33:38 -04:00
Francis Lachapelle 4397e6a2e1 core(dav): improve SQL queries of multiget and sync-collection 2021-09-22 10:51:47 -04:00
InverseBot cfe8decd21 chore(js/css): update generated files 2021-09-22 00:18:39 -04:00
Francis Lachapelle c6d6dc3e66 fix(addressbook(js)): load selected cards prior to display mail editor 2021-09-21 14:42:05 -04:00
InverseBot 9c493e004b chore(js/css): update generated files 2021-09-21 00:18:35 -04:00
Francis Lachapelle 2c62aafe70 fix(mail): don't encode calendar mime part twice
SOPE will take care of encoding all text parts in quoted-printable if
necessary.

Fixes #5391
Fixes #5393
2021-09-15 11:36:58 -04:00
InverseBot 1c7200c90d chore(js/css): update generated files 2021-09-15 00:18:37 -04:00
InverseBot 76f6bb0f3f chore(js/css): update generated files 2021-09-14 00:18:34 -04:00
Francis Lachapelle f0368d028b fix(core): handle null values in modules constraints of SQL sources 2021-09-13 09:49:14 -04:00
Francis Lachapelle 0765c72616 fix(mail): replace STATUS by LIST command when copying/moving msgs
Fixes #4983
2021-09-10 16:59:26 -04:00
Francis Lachapelle 08581eefab fix(mail): split "l" and "r" ACL attributes for IMAP mailboxes
Fixes #4983
2021-09-10 16:57:15 -04:00
Francis Lachapelle d1fc15b3a4 feat(mail): add support for UID MOVE operation 2021-09-10 14:16:03 -04:00
Francis Lachapelle 534bea674b fix(mail): properly sort partial fetch results (modseq)
Fixes #5385
2021-09-08 16:54:42 -04:00
Francis Lachapelle 2a8d64d891 fix(mail(js)): reload UIDs when changing sort order
Fixes #5385
2021-09-08 16:48:39 -04:00
Francis Lachapelle e714a3f42b fix(mail(css)): improve CSS sanitization of at-rules
Fixes #5387
2021-09-08 11:38:53 -04:00
InverseBot b86852a1a6 chore(js/css): update generated files 2021-09-08 00:18:27 -04:00
Francis Lachapelle ef5820b49b fix(mail): fix end date of all-day event in mail notifications
Fixes #5384
2021-09-07 16:51:11 -04:00
Francis Lachapelle ea6b699094 fix(web(css)): print more than one page in Firefox
Fixes #5375
2021-09-07 15:44:26 -04:00
Francis Lachapelle 2d25e180f6 fix(mail(js)): update unseen count when reaching zero
Fixes #5381
2021-09-07 14:57:40 -04:00
Francis Lachapelle e43a721f77 fix(calendar): generate missing UID when importing calendar 2021-09-07 14:25:17 -04:00
Francis Lachapelle 9f38201b6c fix(addressbook): fix compilation warnings in UIxContactFoldersView.m 2021-09-07 13:43:15 -04:00
Francis Lachapelle 7b5cddcf2d fix(addressbook): generate UID when importing cards if missing
Fixes #5386
2021-09-07 13:35:48 -04:00
Francis Lachapelle a6a3f2fb88 chore(sogo-ealarms-notify): don't encode the MIME part twice 2021-09-03 15:49:00 -04:00
Francis Lachapelle 2feee5f3a2 test: migration from Python to JavaScript 2021-09-02 10:29:27 -04:00
Francis Lachapelle 6ae787c4a4 test: migration from Python to JavaScript 2021-09-01 11:09:16 -04:00
iRedMail b8f0e39c40 doc: value of SQL column used in ModulesConstraints must be a string 2021-09-01 09:49:50 -04:00
Francis Lachapelle 5622eda04b test: migration from Python to JavaScript 2021-08-26 17:33:50 -04:00
InverseBot b81c4eac1c chore(js/css): update generated files 2021-08-26 00:47:27 -04:00
Francis Lachapelle 56f9e3e398 fix(mail(js)): allow to add any event invitation 2021-08-25 16:53:40 -04:00
Francis Lachapelle 9e364c647f fix(mail): encode text MIME parts in quoted-printable
This reverts commit 6cf3d99125.

Fixes #5378
2021-08-25 14:59:24 -04:00
InverseBot 124b4f8f73 chore(js/css): update generated files 2021-08-24 00:19:02 -04:00
Francis Lachapelle 6cf3d99125 fix(mail): encode text MIME parts in quoted-printable
This will limit each line to a maximum of 70 characters.

Fixes #5376
2021-08-23 11:08:25 -04:00
Francis Lachapelle 145f221552 fix(mail(js)): fix height of mailboxes list items 2021-08-23 10:30:37 -04:00
Francis Lachapelle 792d96b361 fix(mail(js)): use message subject as filename of .eml 2021-08-23 09:57:15 -04:00
Francis Lachapelle 05ad7a8d6d test: migration from Python to JavaScript 2021-08-20 17:36:05 -04:00
Francis Lachapelle 96aa444051 test: migration from Python to JavaScript 2021-08-20 15:15:46 -04:00
InverseBot 097ee65751 chore(js/css): update generated files 2021-08-20 00:18:34 -04:00
Francis Lachapelle 86f08a2380 fix(mail(js)): show "Download all attachments" menu option 2021-08-19 17:15:12 -04:00
Francis Lachapelle 595b93eafc test: migration from Python to JavaScript 2021-08-19 15:37:49 -04:00
Francis Lachapelle c8855b708b chore(release): 5.2.0 2021-08-18 15:35:57 -04:00
Francis Lachapelle 0e19e1e4a3 chore(js/css): update generated files 2021-08-18 15:20:56 -04:00
Francis Lachapelle 00846c463c style(addressbook(obj-c)): add comments 2021-08-18 13:32:33 -04:00
Francis Lachapelle fef5003d92 style(obj-c): remove unused variable 2021-08-18 13:21:28 -04:00
Francis Lachapelle 6b6b7334c2 i18n(pl): update Polish translation 2021-08-18 08:55:31 -04:00
Francis Lachapelle 8bdae88ec3 i18n(de): update German translation 2021-08-18 08:55:31 -04:00
Francis Lachapelle 1246469ee1 i18n(fr): update French translation 2021-08-18 08:55:31 -04:00
InverseBot 354baf34f6 chore(js/css): update generated files 2021-08-18 00:18:21 -04:00
Francis Lachapelle aa59aa9c47 fix(core): improve logged error when module is invalid 2021-08-17 15:59:33 -04:00
Francis Lachapelle a370aa70f2 fix(core): properly validate domain using "domains" keys
Instead of checking if the domain match a source ID, we now check if the
domain match a key of the "domains" configuration parameter.
2021-08-17 15:59:33 -04:00
Francis Lachapelle 7e63452141 fix(login(js)): fix domain in redirect URL 2021-08-17 15:59:33 -04:00
InverseBot a60f79a8e3 chore(js/css): update generated files 2021-08-17 00:18:32 -04:00
Francis Lachapelle ebf2a80654 i18n(bg): add Bulgarian translation 2021-08-16 14:03:13 -04:00
Francis Lachapelle eb18249d2b i18n(bg): add Bulgarian translation 2021-08-16 13:57:34 -04:00
InverseBot 8a2e6ca9fe chore(js/css): update generated files 2021-08-13 11:17:50 -04:00
Francis Lachapelle 045f134321 feat(mail): initial support for ms-tnef (winmail.dat) body part
Fixes #2242
Fixes #4503
2021-08-13 11:12:37 -04:00
InverseBot 98dad1d2dc chore(js/css): update generated files 2021-08-13 00:18:24 -04:00
Francis Lachapelle 81aed5e6e1 style(addressbook): add comment about Mac OS 10.15 2021-08-12 15:51:51 -04:00
Francis Lachapelle cf40a23b43 chore(sogo-ealarms-notify): properly close all DB channels
This prevent MySQL from logging an error (Aborted connection to db).
2021-08-12 15:39:12 -04:00
Francis Lachapelle 7d07ddaffd fix(web(js)): get filename from content-disposition header 2021-08-12 13:43:40 -04:00
Francis Lachapelle eb46415711 fix(mail(js)): hide sign and encrypt options if not usable
When composing a message, don't offer to sign nor encrypt the message
if user has not uploaded a certificate or if S/MIME is disabled.
2021-08-12 13:40:47 -04:00
Francis Lachapelle 3388c18466 chore(sogo-ealarms-notify): fix handling of alarms on tasks
Fixes #5158
2021-08-12 11:59:41 -04:00
Francis Lachapelle 462b9ad99f chore(npm): update CKEditor to version 4.16.2 2021-08-12 09:49:09 -04:00
InverseBot bc44db9220 chore(js/css): update generated files 2021-08-12 00:18:27 -04:00
Francis Lachapelle 545cfe58c6 feat(mail): new parameter to disable S/MIME certificates 2021-08-11 18:18:29 -04:00
Francis Lachapelle 90752c4382 fix(core): remove CR, diacritical marks, variation selectors 2021-08-11 16:33:18 -04:00
Francis Lachapelle ef5e7775cd feat(mail): download message as .eml file 2021-08-11 13:44:48 -04:00
Francis Lachapelle 36100b0419 i18n(sr_SR): use sr_ME instead of cnr for Montenegrin locale 2021-08-10 14:24:56 -04:00
InverseBot bfebc6af1a chore(js/css): update generated files 2021-08-10 00:18:24 -04:00
Francis Lachapelle e140bd0379 fix(preferences(js)): don't save locale definition 2021-08-09 12:44:20 -04:00
Francis Lachapelle 3cc29b4018 i18n(sr_SR): add Montenegrin translation 2021-08-09 11:30:36 -04:00
InverseBot 7654db431d chore(js/css): update generated files 2021-08-05 08:04:32 -04:00
Francis Lachapelle 7747048cff chore(npm): update md to v1.2.3 2021-08-04 13:10:26 -04:00
Francis Lachapelle 5f6cacc859 fix(saml): add XSRF-TOKEN cookie in valid SAML login 2021-08-04 12:54:38 -04:00
Francis Lachapelle a1273f1097 fix(mail): add support for messages quota
Fixes #5365
2021-08-04 10:02:39 -04:00
InverseBot 510eb97860 chore(js/css): update generated files 2021-08-04 00:18:26 -04:00
Francis Lachapelle 40b570cc12 fix(mail): don't render SVG attachments
Fix #5371
2021-08-03 16:26:49 -04:00
InverseBot a23fef66ba chore(js/css): update generated files 2021-08-03 00:18:28 -04:00
Francis Lachapelle 69972f725c fix(mail): remove media event handlers from HTML messages
Fixes #5369
2021-08-02 17:42:02 -04:00
Francis Lachapelle 8947f29c09 fix(mail(js)): avoid using the DOM when sanitizing incoming html
Fixes #5369
2021-08-02 17:33:45 -04:00
Francis Lachapelle 54dff23682 test: migration from Python to JavaScript 2021-07-16 14:42:15 -04:00
Francis Lachapelle 946419f434 chore(tool): fix rename-user in single store mode 2021-07-13 12:29:54 -04:00
Francis Lachapelle 694ffa74ba fix(mail): fix end date of all-day event in mail notifications
Fixes #4145
2021-07-09 11:52:16 -04:00
Francis Lachapelle f8f4de6020 docs: add notice regarding the HttpOnly flag and XSRF
Fixes #5342
2021-07-05 11:34:12 -04:00
InverseBot db46b4ae09 chore(js/css): update generated files 2021-07-01 00:18:52 -04:00
Francis Lachapelle 0599922016 fix(mail(js)): update visible msgs list when adding new msgs 2021-06-30 11:20:29 -04:00
Francis Lachapelle a8c684cdad docs: remove reference to Blackberry in installation guide 2021-06-30 10:03:48 -04:00
InverseBot 9e1eb0b459 chore(js/css): update generated files 2021-06-30 00:15:29 -04:00
Francis Lachapelle d13e1534a8 fix(mail(css)): always show tag dots in messages list 2021-06-29 17:16:35 -04:00
Francis Lachapelle a35225631a fix(mail): return unseen count of mailbox in msgs operations 2021-06-29 17:05:48 -04:00
Francis Lachapelle 09d300ec65 chore(tool): fix typos 2021-06-29 10:32:51 -04:00
InverseBot eb89b03e6b chore(js/css): update generated files 2021-06-22 00:18:54 -04:00
Francis Lachapelle 2771fe180e fix(mail(html)): format links in comment of Calendar invitations 2021-06-21 12:16:17 -04:00
Francis Lachapelle 688b8c1b28 docs: update Installation guide for CAS/SAML2 authentication 2021-06-21 10:58:24 -04:00
InverseBot aa70c47efc chore(js/css): update generated files 2021-06-19 00:18:55 -04:00
Francis Lachapelle a3ae2b8ea5 Revert "fix(core): don't bind a DN to LDAP sources with a different search base"
This reverts commit e0b6e22fa2.

This change was causing issues with LDAP virtual list views.
2021-06-18 17:22:02 -04:00
Francis Lachapelle 2d16456bb5 fix(mail(js)): respect thread level while loading headers
Going from the skeleton view to the populated view is smoother if we
respet the thread indentation.
2021-06-18 17:06:58 -04:00
Francis Lachapelle b969ca4b49 fix(mail(js)): force reload of UIDs when cancelling search 2021-06-18 17:06:58 -04:00
InverseBot 34c3ddef87 chore(js/css): update generated files 2021-06-18 00:19:05 -04:00
Francis Lachapelle d285411ef3 perf(mail(js)): improvements for md-virtual-repeat 2021-06-17 17:39:49 -04:00
Francis Lachapelle 976579356d docs: update MySQL recommendations for unicode compliance
Fixes #5151
2021-06-17 14:12:40 -04:00
Francis Lachapelle 134502223e refactor(doc): replace xsltproc/fop by asciidoctor-pdf 2021-06-17 12:20:20 -04:00
InverseBot 4a32a5e11c chore(js/css): update generated files 2021-06-17 00:18:52 -04:00
Francis Lachapelle 20b2fd5e45 refactor(web): replace SOGoGoogleAuthenticatorEnabled with
SOGoTOTPEnabled

Fixes #5294
2021-06-16 14:59:02 -04:00
Francis Lachapelle 34184aa3fc chore: fix syntax of localizable file 2021-06-16 12:38:07 -04:00
olivierperes 9ae9fa094e refactor(mail): replace "Google Authenticator" with more general vocabulary
The 2FA feature is not specific to one application, rewording makes this more clear.

Fixes #5294
2021-06-16 09:49:30 -04:00
InverseBot 71a648a7d4 chore(js/css): update generated files 2021-06-16 00:48:37 -04:00
Francis Lachapelle a9c6f09273 perf(mail(js)): various optimizations
We now use IMAP QRESYNC to synchronize mailbox.
2021-06-15 17:16:10 -04:00
InverseBot b4ccafd546 chore(js/css): update generated files 2021-06-15 00:19:03 -04:00
Francis Lachapelle bc58bd1cb0 perf(mail(js)): delay instantiation of Message objects on load 2021-06-14 17:27:09 -04:00
Francis Lachapelle e66ad698fd chore: remove scss/components/_utils.scss 2021-06-14 11:52:28 -04:00
Francis Lachapelle 09235104a4 chore: remove Templates/UIxWinClose.wox 2021-06-14 11:39:52 -04:00
Francis Lachapelle 9dbb77047e chore: remove SOGoUI/UIxJSClose 2021-06-14 11:38:43 -04:00
Francis Lachapelle 89c31d8ee2 chore: remove MainUI/UIxLoading 2021-06-14 11:08:36 -04:00
Francis Lachapelle 0aabd45c04 fix(calendar(web)): search in all user's calendars for iMIP reply 2021-06-08 13:42:00 -04:00
InverseBot 82a004f397 chore(js/css): update generated files 2021-06-08 00:19:03 -04:00
Francis Lachapelle 322226bd81 fix(css): improve display of category colors (Calendar & Mail)
In the list view, we now use color dots instead of stripes.

Fixes #5337
2021-06-07 15:03:39 -04:00
Francis Lachapelle 54548c550f fix(mail): improve performance of listing all mailboxes 2021-06-04 16:50:49 -04:00
Francis Lachapelle 9cf67d0b5c fix(mail(web)): don't try to fetch headers if mailbox is empty 2021-06-04 16:49:14 -04:00
Francis Lachapelle e08be0d006 fix(calendar(dav)): add method attribute to content-type of iTIP reply
Fixes #5320
2021-06-03 16:13:22 -04:00
Francis Lachapelle a42749facd chore(release): 5.1.1 2021-06-01 08:38:12 -04:00
Francis Lachapelle 5f5c875577 Merge branch 'fix/saml' 2021-05-31 16:56:24 -04:00
Francis Lachapelle 88db6a533b chore(logrotate): fix ownership of log file
Fixes #5327
2021-05-27 21:55:41 -04:00
Francis Lachapelle 3b4ded63f5 chore(npm): update CKEditor to version 4.16.1 2021-05-27 21:50:48 -04:00
Francis Lachapelle 7bebc71f67 i18n(fr): update French translation 2021-05-27 18:46:21 -04:00
Francis Lachapelle 376c473a5a i18n(sk): update Slovak translation 2021-05-27 18:46:00 -04:00
Francis Lachapelle 243b63c33c chore(rhel): drop support for RHEL 6 2021-05-27 14:42:25 -04:00
Francis Lachapelle b600452696 chore(rhel): drop support for RHEL 6 2021-05-27 14:24:41 -04:00
Francis Lachapelle f9963e86af chore(rhel): drop support for RHEL 6 2021-05-27 12:16:08 -04:00
Francis Lachapelle e1d8d70e28 fix(addressbook): import contact lists from LDIF file
Fixes #3260
2021-05-26 17:47:15 -04:00
InverseBot 562e3796f8 chore(js/css): update generated files 2021-05-26 00:28:03 -04:00
Francis Lachapelle dc81f70928 fix(mail): use default signature when forcing default identity 2021-05-25 14:17:12 -04:00
Francis Lachapelle d4a0b25c06 fix(calendar(js)): fix URL for snoozing alarms
Fixes #5324
2021-05-25 12:23:25 -04:00
InverseBot 8655dd29ab chore(js/css): update generated files 2021-05-19 00:28:29 -04:00
Francis Lachapelle 657f00f92b fix(mail): handle folders that end with a question mark
We now avoid using NSURL.

Fixes #5303
2021-05-18 13:34:46 -04:00
Francis Lachapelle 5c88bd4f6c chore(debian): enable SAML support for all Debian/Ubuntu distros
Fixes #5292
2021-05-17 11:06:47 -04:00
Francis Lachapelle 1d88d36ded fix(saml): fix profile initialization, improve error handling
Fixes #5153
Fixes #5270
2021-05-17 10:56:43 -04:00
Francis Lachapelle e536365646 fix(saml): don't ignore the signature of messages 2021-05-17 10:10:01 -04:00
Francis Lachapelle d0056d3b27 perf(core): cache the schema of LDAP user sources 2021-05-14 11:56:13 -04:00
Francis Lachapelle debcbd16db fix(core): avoid appending an empty domain to uid in cache 2021-05-14 10:43:07 -04:00
Francis Lachapelle 517b8887b4 fix(mail(js)): add CKEditor plugin pastefromgdocs
Fixes #5316
2021-05-13 11:16:35 -04:00
InverseBot 9ba3c13737 chore(js/css): update generated files 2021-05-13 00:28:31 -04:00
Francis Lachapelle 4501b5e35c fix(web(js)): don't cache users results in ACL editor 2021-05-12 10:59:27 -04:00
Francis Lachapelle 8e98af0e9f fix(web): allow to change expired password from login page 2021-05-11 15:03:02 -04:00
Francis Lachapelle e5d957181c fix(calendar(css)): enlarge categories color stripes
Fixes #5301
2021-05-11 12:36:03 -04:00
Francis Lachapelle 0b33575457 Revert "chore(npm): update ng-sortable"
This reverts commit bf23f70104.
2021-05-11 11:09:23 -04:00
Francis Lachapelle bdd8e3500a fix(web): allow to change expired password from login page 2021-05-06 16:35:42 -04:00
InverseBot 8a10ae140d chore(js/css): update generated files 2021-05-06 00:28:35 -04:00
Francis Lachapelle d303247481 fix(mail(js)): add debouncing on keyup events of sgAutogrow 2021-05-05 17:37:42 -04:00
Francis Lachapelle 049c17f15a fix(mail(js)): don't delay the progress indicator when loading mailbox
Fixes #5278
2021-05-05 15:45:19 -04:00
Francis Lachapelle 0c1f9fdb02 fix(web): restore support of ppolicy OpenLDAP overlay 2021-05-05 12:41:08 -04:00
Francis Lachapelle da366083e9 fix(core): change password in user's matching source only 2021-05-05 10:21:15 -04:00
Francis Lachapelle e0b6e22fa2 fix(core): don't bind a DN to LDAP sources with a different search base 2021-05-05 09:48:17 -04:00
Francis Lachapelle ac2853cfcf chore(tool): delete memcached entries of expired sessions 2021-05-03 16:12:28 -04:00
Francis Lachapelle 2c9c38da86 docs: add upgrade notice for release 5.1.0 2021-04-29 14:20:11 -04:00
Francis Lachapelle 4aa80ec496 docs: update list of supported Linux distributions 2021-04-29 14:19:41 -04:00
InverseBot ae3fe6aad1 chore(js/css): update generated files 2021-04-22 00:27:55 -04:00
Francis Lachapelle bd80b6ea75 fix(calendar(css)): enlarge categories color stripes
Fixes #5301
2021-04-21 14:12:14 -04:00
Francis Lachapelle 66afbd2172 fix(mail(html)): add missing ARIA labels 2021-04-21 11:11:51 -04:00
Francis Lachapelle 189aab3535 fix(mail): retrieve IMAP delimiter after LIST command 2021-04-21 10:49:33 -04:00
Francis Lachapelle a83b0d822a fix(core): decompose LDAP nested groups, cache logins
We now decompose entries with attributes "member" or "uniquemember".

We now properly cache decomposed subgroups.
2021-04-19 14:42:30 -04:00
InverseBot f5e4d3a7fd chore(js/css): update generated files 2021-04-17 00:27:55 -04:00
Francis Lachapelle fec299f040 fix(calendar(js)): show conflict error inside appointment editor
A single string error is returned when at least one of the attendees
refuses to be invited.
2021-04-16 13:54:54 -04:00
Francis Lachapelle af61752933 fix(mail(js)): add tooltip with email of attendees in invitation 2021-04-16 13:54:54 -04:00
InverseBot f44122d763 chore(js/css): update generated files 2021-04-15 00:27:59 -04:00
Francis Lachapelle bfbf43b1c8 fix(mail(js)): unselect all messages when changing mailbox
Fixes #4970
Fixes #5148
2021-04-14 14:28:22 -04:00
Francis Lachapelle bed91ce95a fix(mail(js)): avoid updating the DOM before closing editor
When destroying the CKEditor instance (closing the mail editor in HTML mode), we no longer try to update the associated textarea because we're removing it anyway.
2021-04-09 17:57:08 -04:00
Francis Lachapelle 716d739b85 chore(rhel): remove references to RHEL/CentOS 5 2021-04-08 09:53:05 -04:00
InverseBot 71a8dd4078 chore(js/css): update generated files 2021-04-07 00:28:18 -04:00
Francis Lachapelle 72321ec545 fix(mail(css)): improve HTML sanitization of background attribute 2021-04-06 16:49:05 -04:00
Francis Lachapelle 045879a1fa fix(css): adjust colors of center lists of views
Fixes #5291
2021-04-06 12:00:40 -04:00
InverseBot a2eeab4612 chore(js/css): update generated files 2021-03-31 00:33:03 -04:00
Francis Lachapelle 4f90fbf4b6 chore(release): 5.1.0 2021-03-30 16:47:30 -04:00
Francis Lachapelle 90fb5426c7 chore(conf): enable XSRF validation by default 2021-03-30 16:42:57 -04:00
Francis Lachapelle 749013db6d chore(js/css): update generated files 2021-03-30 16:01:11 -04:00
Francis Lachapelle c6fab04df6 i18n(pt_BR): update Brazilian Portuguese translation 2021-03-30 15:33:44 -04:00
Francis Lachapelle 3875eddda3 i18n(hu): update Hungarian translation 2021-03-30 15:33:17 -04:00
Francis Lachapelle 883f45c7b0 chore(debian): remove packaging/debian-multiarch
Was required for Debian 6 (Squeeze) and Ubuntu 12.04 LTS (Precise
Pangolin) which we no longer support.
2021-03-26 12:23:00 -04:00
Francis Lachapelle 46948f514a chore: configuration file and script for versioning
See https://github.com/conventional-changelog/standard-version
2021-03-26 09:49:12 -04:00
Francis Lachapelle a95964b51f i18n(sl_SI): update Slovenian translation 2021-03-24 11:02:49 -04:00
Francis Lachapelle 937aad47fc chore(npm): update sass 2021-03-16 12:06:28 -04:00
Francis Lachapelle a94688ab12 chore(npm): update grunt-contrib-cssmin 2021-03-16 12:05:58 -04:00
Francis Lachapelle 074e0d4734 chore(npm): update lodash 2021-03-16 12:05:28 -04:00
Francis Lachapelle cb6de75845 fix(mail): unsubscribe from all subfolders when deleting parent
Fixes #5218
2021-03-16 11:50:05 -04:00
Francis Lachapelle 1914a3516a i18n(hu): update Hungarian translation 2021-03-15 14:09:50 -04:00
Francis Lachapelle a4d9549f6f docs: add SOGoMailComposeWindow parameter
Fixes #5275
2021-03-15 12:17:00 -04:00
Francis Lachapelle 386429e46e fix(core): fix compilation warning in NSData+Crypto 2021-03-12 17:30:17 -05:00
Francis Lachapelle dd90a0977a docs: update README regarding the SOGo Connector TB plugin 2021-03-12 17:27:20 -05:00
Francis Lachapelle 22b6b4bb9f chore(Apache): Don't send the Referer header for cross-origin requests
Fixes #5252
2021-03-12 17:21:13 -05:00
Francis Lachapelle 4740042bf9 chore(tool): fix usage of restore 2021-03-12 17:00:28 -05:00
Francis Lachapelle f6f43c42fc chore(npm): update CKEditor to version 4.16.0
Fixes #5272
Fixes #5273
2021-03-08 13:57:51 -05:00
Francis Lachapelle 3722169522 fix(acls): remove debugging output when searching in groups 2021-03-03 10:57:03 -05:00
Francis Lachapelle 3c7a6a0d4a chore(timezones): update to version 2021a 2021-03-03 09:02:39 -05:00
InverseBot b8a0c84f12 chore(js/css): update generated files 2021-03-03 00:35:05 -05:00
Francis Lachapelle 6ea4cbc7f3 chore(npm): update CKEditor to version 4.16.0 2021-03-02 17:46:10 -05:00
Francis Lachapelle fa3e5e0b75 fix(mail(js)): improve quoted message when replying
Fixes #5223
2021-03-02 17:16:06 -05:00
Francis Lachapelle 6f90977196 fix(common(js)): improve parsing of year
There's no perfect solution when only two digits are used for the year.
It's always better to show four digits for the year to avoid unexpected
results.

Fixes #5268
2021-03-02 14:59:59 -05:00
Francis Lachapelle 088764a3f7 fix(mail(css)): improve visibility of buttons in invitations
Fixes #5263
2021-03-02 14:01:15 -05:00
Extra Fu 080f87c584 Merge pull request #295 from tfux/5266
fix(eas): improve EAS parameters parsing (fixes #5266)
2021-03-01 08:09:40 -05:00
root b2008cd309 fix(eas): improve EAS parameters parsing (fixes #5266) 2021-02-28 14:49:57 +01:00
Francis Lachapelle dd326f9ddf fix(core): use "is null" instead of "= null" when building SQL
Keep NSNull instances for values in GCSFolder and let [EOQualifier(GCS)
_gcsAppendToString:] properly format the key/value qualifier that
involves a NULL.

This fixes various issues, including missing unique recurrent events in
attendees calendars.
2021-02-26 14:30:55 -05:00
InverseBot 822c304d10 chore(js/css): update generated files 2021-02-26 00:35:00 -05:00
Francis Lachapelle f9a8d8491e fix(mail(js)): don't modify filters for automatic refresh
Fixes #5226
2021-02-25 13:39:21 -05:00
InverseBot d2bbaf7c39 chore(js/css): update generated files 2021-02-21 00:35:12 -05:00
InverseBot 7f5386db45 chore(js/css): update generated files 2021-02-16 00:34:40 -05:00
Francis Lachapelle 3662332229 i18n(pl): update Polish translation 2021-02-11 15:01:04 -05:00
Francis Lachapelle cbcf6cbfdf i18n(de): update German translation 2021-02-11 15:00:32 -05:00
Francis Lachapelle 9bafb57a79 i18n(cs): update Czech translation 2021-02-11 15:00:05 -05:00
Francis Lachapelle b486938e40 i18n(sk): update Slovak translation 2021-02-11 14:59:32 -05:00
Francis Lachapelle 8915749f75 i18n(sr): update Serbian and Serbian Latin translations 2021-02-11 14:58:47 -05:00
Francis Lachapelle d030d1c4b3 i18n(ru): update Russian translation 2021-02-11 14:57:29 -05:00
InverseBot 14ef484bea chore(js/css): update generated files 2021-02-11 00:34:47 -05:00
jkanefendt 59e876d8f7 fix(preferences(js)): always apply forward constraints to sieve filters (#294) 2021-02-10 14:41:51 -05:00
InverseBot 83f1516ca8 chore(js/css): update generated files 2021-02-09 00:34:19 -05:00
Francis Lachapelle e774c4c474 fix(mail(css)): limit some text formatting to attachment cards 2021-02-08 12:02:34 -05:00
Francis Lachapelle 9fe2de753b fix(calendar): try to repair VCALENDAR when parsing versit string
It seems that Exchange 2010 and 2016 sometimes produce calendar
invitation emails with text/calendar multipart parts in the email that
have "END:VCALENDAR" at the end of the calendar data missing.
2021-02-08 11:28:39 -05:00
Francis Lachapelle 9dcdaedb40 fix(mail(css)): limit some text formatting to attachment cards 2021-02-08 11:25:05 -05:00
InverseBot 0088b9f7f5 chore(js/css): update generated files 2021-01-26 00:34:39 -05:00
Francis Lachapelle e78eb44dd7 fix(calendar(js)): ignore attendees when saving task 2021-01-25 09:59:02 -05:00
InverseBot 6a5f3e4e4f chore(js/css): update generated files 2021-01-15 00:34:28 -05:00
Francis Lachapelle fc4f5d2161 feat(mail): new option to force default identity
Users can now force the default identity to always be used when replying
or forwarding a message.
2021-01-14 15:23:43 -05:00
Extra Fu 2826c83fc5 Merge pull request #291 from tfux/5239
fix(eas): handle fileAs element (fixes #5239)
2021-01-09 09:54:56 -05:00
root dd8ebd1922 fix(eas): handle fileAs element (fixes #5239) 2021-01-06 19:57:49 +01:00
InverseBot d470ebcda2 chore(js/css): update generated files 2020-12-24 00:34:21 -05:00
Francis Lachapelle 86ab7312a4 fix(mail(css)): restore scrolling of msg source when animation is off 2020-12-23 10:12:22 -05:00
InverseBot 099ef0ef7e chore(js/css): update generated files 2020-12-22 10:06:25 -05:00
Francis Lachapelle b3932cc3de chore(npm): update angular-ui-router 2020-12-22 09:39:31 -05:00
Francis Lachapelle 822c50ff56 i18n(sr_SR): update Serbian (Latin) translation 2020-12-21 15:00:58 -05:00
Francis Lachapelle 5c872647ee chore(npm): update sass 2020-12-21 14:02:51 -05:00
Francis Lachapelle bf23f70104 chore(npm): update ng-sortable 2020-12-21 14:02:16 -05:00
Francis Lachapelle dfeb0467d7 chore(npm): update md to v1.2.2 2020-12-21 14:00:49 -05:00
Francis Lachapelle 8386bb2c08 i18n(sr_SR): add Serbian (Latin) translation 2020-12-18 19:41:37 -05:00
Francis Lachapelle c27be0fbe5 fix(calendar): avoid exception when FoldersOrder have invalid entries 2020-12-18 11:22:42 -05:00
Francis Lachapelle 7da4bc465f fix(core): remove overstruck diacritics from sanitized strings 2020-12-15 14:47:51 -05:00
tfux fab8061766 feat(eas): Allow EAS Search operation in all parts of a message 2020-12-09 13:34:19 -05:00
Francis Lachapelle b9e19c2cc4 fix(addressbook(dav)): add support for macOS 11 (Big Sur)
Fixes #5203
2020-12-01 15:36:51 -05:00
Francis Lachapelle a3277eb65a fix(login): fix localizabled strings when changing language 2020-11-30 16:59:33 -05:00
Francis Lachapelle c38524ab07 fix(calendar): accept HTML in repeat frequencies descriptions 2020-11-30 12:46:03 -05:00
Francis Lachapelle e2e5e6fed9 i18n(mail): improve generic error message for signed/encrypted messages
Fixes #5204
2020-11-26 16:37:13 -05:00
Francis Lachapelle 0d81195ab3 chore(tool): fix disabling of auto-reply
Disabling of auto-reply was occuring one day too early.

Fixes #5219
2020-11-26 16:18:44 -05:00
Francis Lachapelle 7149634bd7 chore(oc): remove unused code of OpenChange 2020-11-24 09:56:00 -05:00
InverseBot c72565d54f chore(js/css): update generated files 2020-11-20 00:35:04 -05:00
InverseBot 0c6862811d chore(js/css): update generated files 2020-11-17 10:22:27 -05:00
Francis Lachapelle f64b4e1a85 fix(css): adjust colors of center lists of views 2020-11-16 13:43:52 -05:00
Francis Lachapelle f5635e7e20 chore(npm): update CKEditor to version 4.15.1 2020-11-16 13:35:03 -05:00
Francis Lachapelle 0eae8296a3 fx(css): reduce list height of mailboxes
Fixes #5145
2020-11-16 12:15:08 -05:00
Francis Lachapelle defd3c97a9 chore(npm): cleanup dependencies, move to Dart Sass 2020-11-16 10:21:56 -05:00
Francis Lachapelle 12047d112f fix(preferences(css)): improve display of some select input fields 2020-11-13 17:19:53 -05:00
Francis Lachapelle 2ecfa70e72 i18n(pl): update Polish translation 2020-11-13 17:02:36 -05:00
Francis Lachapelle c7166de428 i18n(de): update German translation 2020-11-13 17:02:21 -05:00
Francis Lachapelle 1827a4548a i18n(cs): update Czech translation 2020-11-13 17:01:46 -05:00
Francis Lachapelle 0509d7f162 feat(calendar(js)): allow HTML links in location field 2020-11-11 12:08:00 -05:00
Francis Lachapelle 64f0519f7b chore(sogo-ealarms-notify): improve arguments parsing
Fixes #5197
2020-11-11 11:58:30 -05:00
InverseBot c600aa261c chore(js/css): update generated files 2020-11-10 00:34:51 -05:00
Francis Lachapelle bc77536b5d fix(print): don't print toasts
Fixes #5207
2020-11-06 21:28:22 -05:00
Francis Lachapelle f5b925d90e i18n(fr): update French translation 2020-11-06 21:15:18 -05:00
Francis Lachapelle e6088c9026 i18n(mail): fix status for message validity
Fixes #5204
2020-11-06 20:41:38 -05:00
InverseBot 55e5c191f4 chore(js/css): update generated files 2020-11-06 00:35:11 -05:00
Francis Lachapelle 0e0fc72b44 fix(calendar(js)): fix exception when changing an event calendar 2020-11-05 10:30:28 -05:00
InverseBot bf27328b9a chore(js/css): update generated files 2020-11-05 09:17:12 -05:00
Francis Lachapelle 6cac6f2383 chore(npm): update md to v1.2.1 2020-11-04 16:47:12 -05:00
Francis Lachapelle 4a83733039 feat(calendar(web)): allow to change the classification of an event 2020-11-04 16:15:13 -05:00
Ludovic Marcotte 3796009eca fix(eas): handle SENT-BY in delegated calendars 2020-11-03 07:47:53 -05:00
InverseBot 2da3cad939 chore(js/css): update generated files 2020-10-31 00:34:31 -04:00
Francis Lachapelle 00030ba2fa fix(mail(js)): add collapse button to toolbar of HTML editor
It is useful on small screens to be able to collapse the toolbar.
2020-10-30 15:36:30 -04:00
InverseBot 823f94b09f chore(js/css): update generated files 2020-10-22 00:34:13 -04:00
InverseBot 926c405057 chore(js/css): update generated files 2020-10-16 01:26:59 -04:00
Francis Lachapelle 74acab0738 fix(calendar(js)): add attendee from search field when saving
Fixes #5185
2020-10-15 17:43:17 -04:00
Francis Lachapelle 5d1ac9db5d fix(calendar): fix all-day events in lists
All-day events start date was wrong when the period was covering a DST
change.
2020-10-15 14:10:25 -04:00
Francis Lachapelle 1c4ff40d33 fix(preferences(mail)): make sure auto-reply (vacation) text is set 2020-10-15 14:07:04 -04:00
Ludovic Marcotte 41bbbfacd9 fix(core): release alarm folder's channel immediately after being used 2020-10-13 10:53:46 -04:00
Francis Lachapelle 5c65c10faa chore(release): 5.0.1 2020-10-07 10:40:29 -04:00
Ludovic Marcotte 78c9277b99 fix(core): handle bogus CardDAV clients 2020-10-07 08:01:00 -04:00
Francis Lachapelle 0fe73ec8a7 i18n(de): update German translation 2020-10-06 16:29:08 -04:00
InverseBot 8b4b55927e chore(js/css): update generated files 2020-10-06 00:36:53 -04:00
Francis Lachapelle a594bf84a3 i18n(hu): update Hungarian translation 2020-10-01 15:59:00 -04:00
Francis Lachapelle 7af092f849 i18n(cs): update Czech translation 2020-10-01 15:58:03 -04:00
Francis Lachapelle 0fdeee8490 fix(mail): add missing elements to Czech reply template
Fixes #5179
2020-10-01 15:42:00 -04:00
InverseBot f1d02df7a8 chore(js/css): update generated files 2020-10-01 00:33:51 -04:00
Francis Lachapelle 712d0f4ef1 fix(preferences(js)): sanitize content of toast
Sanitize subject and sender of message when using $mdToast to alert user
of new messages.

Fixes #5178
2020-09-30 14:14:24 -04:00
Francis Lachapelle ec1a01e316 fix(mail): remove duplicate recipients in draft 2020-09-30 09:38:22 -04:00
Francis Lachapelle 9150bdd768 fix(calendar(dav)): check if group member is empty 2020-09-24 14:19:04 -04:00
Francis Lachapelle 1bec216ce6 fix(calendar): restore UIxOccurenceDialog
Renamed as action class UIxOccurenceEditor.

Fixes #5141
Fixes #5160
2020-09-16 17:18:18 -04:00
Francis Lachapelle 728a006e6e fix(mail): add SMTP error to Exception returned by SOGOMailer 2020-09-14 14:43:05 -04:00
InverseBot 24b0408c38 chore(js/css): update generated files 2020-09-11 00:32:58 -04:00
Francis Lachapelle aa706796c2 fix(preferences(js)): sanitize mail identities when saving 2020-09-10 12:23:54 -04:00
Francis Lachapelle 64a8ce4048 fix(mail): fallback to the default identity when replying/forwarding 2020-09-10 12:23:54 -04:00
InverseBot f4f15f1c91 chore(js/css): update generated files 2020-09-10 01:23:08 -04:00
Francis Lachapelle 9af697ae83 fix(calendar): restore UIxOccurenceDialog
Renamed as action class UIxOccurenceEditor.

Fixes #5141
2020-09-09 16:27:54 -04:00
Francis Lachapelle ac8a7ecc6e chore(npm): update grunt 2020-09-09 08:45:33 -04:00
Francis Lachapelle 5f550ae448 chore(npm): update lodash 2020-09-09 08:45:03 -04:00
Francis Lachapelle d9fe3a67e1 chore(npm): update angular-file-upload 2020-09-09 08:44:43 -04:00
Francis Lachapelle 3ee702e637 chore(npm): update md to v1.1.26
Fixes #5082
Fixes #5152
2020-09-08 12:26:14 -04:00
InverseBot 7e0a753242 chore(js/css): update generated files 2020-08-21 00:36:31 -04:00
Nicolas Höft 8507204e0d fix(core): fix GCC 10 compatibility
With GCC 10, SOGoAptFormatter.m FTBS with the following error:

    SOGoAptFormatter.m: In function ‘-[SOGoAptFormatter setPrivateTitleOnly]’:
    SOGoAptFormatter.m:104:56: error: expected ‘)’ before ‘::’ token
      104 |   self->formatAction = @selector(titleOnlyForPrivateApt::);

Simply name the second argument, so gcc is happy.

Also add the `external` keyword to a header declared variable.

Fixes #5029
2020-08-19 12:28:30 -04:00
InverseBot 72053a5801 chore(js/css): update generated files 2020-08-19 00:36:53 -04:00
Francis Lachapelle 7163900d24 fix(mail(js)): keep CKEditor toolbar visible 2020-08-18 16:04:21 -04:00
Francis Lachapelle 6aca61d8ae fix(core): decompose LDAP nested groups 2020-08-17 16:03:29 -04:00
InverseBot 21cb0cb985 chore(js/css): update generated files 2020-08-14 00:37:03 -04:00
Francis Lachapelle af452eb1a7 fix(mail(js)): handle subfolders of Sent mailbox
Fixes #4980
2020-08-13 12:20:36 -04:00
Francis Lachapelle 7b9e750806 fix(web(js)): avoid throwing an error when disconnected 2020-08-13 10:06:47 -04:00
Francis Lachapelle 9ece688bd1 docs: update list of supported operating systems 2020-08-12 16:13:29 -04:00
InverseBot 066e20c5d2 chore(js/css): update generated files 2020-08-11 00:36:40 -04:00
1681 changed files with 83952 additions and 76712 deletions

No files matched your search

+27 -1
View File
@@ -16,6 +16,32 @@ Please make sure to respect the following guidelines when reporting a bug:
Begin by reading [SOGo Developer's Guide](../Documentation/SOGoDevelopersGuide.asciidoc).
### Translations
Three type of files must be translated. The first type are **Localizable.strings**; they can be
translated online using **[Transifex](https://www.transifex.com/inverse/sogo/)**. To use Transifex,
you must first sign up for a [free account](https://www.transifex.com/signup/). Once registered,
[request a new team](https://www.transifex.com/inverse/teams/) for your language. Once authorized,
you'll be able to start/continue translating SOGo in your language.
The second type are **wox and html templates**. Only words outside the tags (<>) must be
translated. Start by duplicating the English templates:
* [UI/Templates/SOGoACLEnglishAdditionAdvisory.wox](https://raw.githubusercontent.com/inverse-inc/sogo/master/UI/Templates/SOGoACLEnglishAdditionAdvisory.wox)
* [UI/Templates/SOGoACLEnglishRemovalAdvisory.wox](https://raw.githubusercontent.com/inverse-inc/sogo/master/UI/Templates/SOGoACLEnglishRemovalAdvisory.wox)
* [UI/Templates/SOGoACLEnglishModificationAdvisory.wox](https://raw.githubusercontent.com/inverse-inc/sogo/master/UI/Templates/SOGoACLEnglishModificationAdvisory.wox)
* [UI/Templates/SOGoFolderEnglishAdditionAdvisory.wox](https://raw.githubusercontent.com/inverse-inc/sogo/master/UI/Templates/SOGoFolderEnglishAdditionAdvisory.wox)
* [UI/Templates/SOGoFolderEnglishRemovalAdvisory.wox](https://raw.githubusercontent.com/inverse-inc/sogo/master/UI/Templates/SOGoFolderEnglishRemovalAdvisory.wox)
* [SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.html](https://raw.githubusercontent.com/inverse-inc/sogo/master/SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.html)
* [SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html](https://raw.githubusercontent.com/inverse-inc/sogo/master/SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html)
The third type is the locale file formatted as a **plist**. Duplicate the English locale:
* [UI/MainUI/English.lproj/Locale](https://raw.githubusercontent.com/inverse-inc/sogo/master/UI/MainUI/English.lproj/Locale)
Once translated, create an archive with all the files and [contact
us](https://sogo.nu/support.html#/commercial). We'll integrate it in the next version of SOGo.
### Git Commit Guidelines
We have very precise rules over how our git commit messages can be formatted. This leads to **more
@@ -81,7 +107,7 @@ The body should include the motivation for the change and contrast this with pre
#### Footer
The footer should contain any information about **Breaking Changes** and is also the
place to reference [Mantis](https://sogo.nu/bus/) issues that this commit **Fixes** or **Resolves**.
place to reference [Mantis](https://sogo.nu/bugs/) issues that this commit **Fixes** or **Resolves**.
> Breaking Changes are intended to be highlighted in the CHANGELOG as changes that will require
> community users to modify their code after updating to a version that contains this commit.
+18
View File
@@ -28,3 +28,21 @@ UI/WebServerResources/scss/.sass-cache/
config.make
doc
tags
.DS_Store
Tests/package-lock.json
.vscode
.configure-test*
UI/WebServerResources/package-lock.json
# CKEditor
UI/WebServerResources/js/vendor/ckeditor/samples/
UI/WebServerResources/js/vendor/ckeditor/skins/n1theme/readme.md
UI/WebServerResources/js/vendor/ckeditor/*.md
UI/WebServerResources/js/vendor/ckeditor/adapters/jquery.js
UI/WebServerResources/js/vendor/ckeditor/bender-runner.config.json
UI/WebServerResources/js/vendor/ckeditor/plugins/onchange/docs
UI/WebServerResources/js/vendor/ckeditor/plugins/scayt/*.md
UI/WebServerResources/js/vendor/ckeditor/skins/n1theme/*.md
# Transifex
.tx/config_20230213185112.bak
+47 -440
View File
@@ -1,453 +1,60 @@
[main]
host = https://www.transifex.com
lang_map = fr: French, pt_BR: BrazilianPortuguese, ru: Russian, sk: Slovak, es_AR: SpanishArgentina, fi: Finnish, id_ID: Indonesian, lt: Lithuanian, tr_TR: TurkishTurkey, zh_TW: ChineseTaiwan, ar: Arabic, cs: Czech, nn_NO: NorwegianNynorsk, sl_SI: Slovenian, uk: Ukrainian, zh_CN: ChineseChina, sv: Swedish, bg_BG: Bulgarian, cy: Welsh, is: Icelandic, sr: Serbian, lv: Latvian, pl: Polish, ro_RO: Romanian, bs_BA: Bosnian,ca: Catalan, he: Hebrew, kk: Kazakh, pt: Portuguese, es_ES: SpanishSpain, eu: Basque, hu: Hungarian, ja: Japanese, mk_MK: Macedonian, nb_NO: NorwegianBokmal, nl: Dutch, sr@latin: SerbianLatin, da_DK: Danish, de: German, hr_HR: Croatian, it: Italian, sr_ME@latin: Montenegrin
[sogo.ui-mailerui]
source_file = UI/MailerUI/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/MailerUI/Arabic.lproj/Localizable.strings
trans.ca = UI/MailerUI/Catalan.lproj/Localizable.strings
trans.cs = UI/MailerUI/Czech.lproj/Localizable.strings
trans.cy = UI/MailerUI/Welsh.lproj/Localizable.strings
trans.da_DK = UI/MailerUI/Danish.lproj/Localizable.strings
trans.de = UI/MailerUI/German.lproj/Localizable.strings
trans.es_AR = UI/MailerUI/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/MailerUI/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/MailerUI/Basque.lproj/Localizable.strings
trans.fi = UI/MailerUI/Finnish.lproj/Localizable.strings
trans.fr = UI/MailerUI/French.lproj/Localizable.strings
trans.he = UI/MailerUI/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/MailerUI/Croatian.lproj/Localizable.strings
trans.hu = UI/MailerUI/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/MailerUI/Indonesian.lproj/Localizable.strings
trans.is = UI/MailerUI/Icelandic.lproj/Localizable.strings
trans.it = UI/MailerUI/Italian.lproj/Localizable.strings
trans.ja = UI/MailerUI/Japanese.lproj/Localizable.strings
trans.lt = UI/MailerUI/Lithuanian.lproj/Localizable.strings
trans.lv = UI/MailerUI/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/MailerUI/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/MailerUI/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/MailerUI/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/MailerUI/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/MailerUI/Polish.lproj/Localizable.strings
trans.pt = UI/MailerUI/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/MailerUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/MailerUI/Romanian.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_CN = UI/MailerUI/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/MailerUI/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:soobjects-appointments]
source_file = SoObjects/Appointments/English.lproj/Localizable.strings
source_lang = en
file_filter = SoObjects/Appointments/<lang>.lproj/Localizable.strings
[sogo.ui-preferencesui]
source_file = UI/PreferencesUI/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/PreferencesUI/Arabic.lproj/Localizable.strings
trans.ca = UI/PreferencesUI/Catalan.lproj/Localizable.strings
trans.cs = UI/PreferencesUI/Czech.lproj/Localizable.strings
trans.cy = UI/PreferencesUI/Welsh.lproj/Localizable.strings
trans.da_DK = UI/PreferencesUI/Danish.lproj/Localizable.strings
trans.de = UI/PreferencesUI/German.lproj/Localizable.strings
trans.es_AR = UI/PreferencesUI/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/PreferencesUI/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/PreferencesUI/Basque.lproj/Localizable.strings
trans.fi = UI/PreferencesUI/Finnish.lproj/Localizable.strings
trans.fr = UI/PreferencesUI/French.lproj/Localizable.strings
trans.he = UI/PreferencesUI/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/PreferencesUI/Croatian.lproj/Localizable.strings
trans.hu = UI/PreferencesUI/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/PreferencesUI/Indonesian.lproj/Localizable.strings
trans.is = UI/PreferencesUI/Icelandic.lproj/Localizable.strings
trans.it = UI/PreferencesUI/Italian.lproj/Localizable.strings
trans.ja = UI/PreferencesUI/Japanese.lproj/Localizable.strings
trans.lt = UI/PreferencesUI/Lithuanian.lproj/Localizable.strings
trans.lv = UI/PreferencesUI/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/PreferencesUI/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/PreferencesUI/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/PreferencesUI/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/PreferencesUI/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/PreferencesUI/Polish.lproj/Localizable.strings
trans.pt = UI/PreferencesUI/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/PreferencesUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/PreferencesUI/Romanian.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_CN = UI/PreferencesUI/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/PreferencesUI/ChineseTaiwan.lproj/Localizable.strings
[sogo.ui-scheduler]
source_file = UI/Scheduler/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/Scheduler/Arabic.lproj/Localizable.strings
trans.ca = UI/Scheduler/Catalan.lproj/Localizable.strings
trans.cs = UI/Scheduler/Czech.lproj/Localizable.strings
trans.cy = UI/Scheduler/Welsh.lproj/Localizable.strings
trans.da_DK = UI/Scheduler/Danish.lproj/Localizable.strings
trans.de = UI/Scheduler/German.lproj/Localizable.strings
trans.es_AR = UI/Scheduler/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/Scheduler/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/Scheduler/Basque.lproj/Localizable.strings
trans.fi = UI/Scheduler/Finnish.lproj/Localizable.strings
trans.fr = UI/Scheduler/French.lproj/Localizable.strings
trans.he = UI/Scheduler/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/Scheduler/Croatian.lproj/Localizable.strings
trans.hu = UI/Scheduler/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/Scheduler/Indonesian.lproj/Localizable.strings
trans.is = UI/Scheduler/Icelandic.lproj/Localizable.strings
trans.it = UI/Scheduler/Italian.lproj/Localizable.strings
trans.ja = UI/Scheduler/Japanese.lproj/Localizable.strings
trans.lt = UI/Scheduler/Lithuanian.lproj/Localizable.strings
trans.lv = UI/Scheduler/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/Scheduler/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/Scheduler/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/Scheduler/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/Scheduler/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/Scheduler/Polish.lproj/Localizable.strings
trans.pt = UI/Scheduler/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/Scheduler/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/Scheduler/Romanian.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_CN = UI/Scheduler/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/Scheduler/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:soobjects-contacts]
source_file = SoObjects/Contacts/English.lproj/Localizable.strings
source_lang = en
file_filter = SoObjects/Contacts/<lang>.lproj/Localizable.strings
[sogo.ui-contacts]
source_file = UI/Contacts/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/Contacts/Arabic.lproj/Localizable.strings
trans.ca = UI/Contacts/Catalan.lproj/Localizable.strings
trans.cs = UI/Contacts/Czech.lproj/Localizable.strings
trans.cy = UI/Contacts/Welsh.lproj/Localizable.strings
trans.da_DK = UI/Contacts/Danish.lproj/Localizable.strings
trans.de = UI/Contacts/German.lproj/Localizable.strings
trans.es_AR = UI/Contacts/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/Contacts/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/Contacts/Basque.lproj/Localizable.strings
trans.fi = UI/Contacts/Finnish.lproj/Localizable.strings
trans.fr = UI/Contacts/French.lproj/Localizable.strings
trans.he = UI/Contacts/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/Contacts/Croatian.lproj/Localizable.strings
trans.hu = UI/Contacts/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/Contacts/Indonesian.lproj/Localizable.strings
trans.is = UI/Contacts/Icelandic.lproj/Localizable.strings
trans.it = UI/Contacts/Italian.lproj/Localizable.strings
trans.ja = UI/Contacts/Japanese.lproj/Localizable.strings
trans.lt = UI/Contacts/Lithuanian.lproj/Localizable.strings
trans.lv = UI/Contacts/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/Contacts/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/Contacts/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/Contacts/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/Contacts/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/Contacts/Polish.lproj/Localizable.strings
trans.pt = UI/Contacts/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/Contacts/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/Contacts/Romanian.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_CN = UI/Contacts/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/Contacts/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:soobjects-mailer]
source_file = SoObjects/Mailer/English.lproj/Localizable.strings
source_lang = en
file_filter = SoObjects/Mailer/<lang>.lproj/Localizable.strings
[sogo.ui-mainui]
source_file = UI/MainUI/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/MainUI/Arabic.lproj/Localizable.strings
trans.ca = UI/MainUI/Catalan.lproj/Localizable.strings
trans.cs = UI/MainUI/Czech.lproj/Localizable.strings
trans.cy = UI/MainUI/Welsh.lproj/Localizable.strings
trans.da_DK = UI/MainUI/Danish.lproj/Localizable.strings
trans.de = UI/MainUI/German.lproj/Localizable.strings
trans.es_AR = UI/MainUI/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/MainUI/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/MainUI/Basque.lproj/Localizable.strings
trans.fi = UI/MainUI/Finnish.lproj/Localizable.strings
trans.fr = UI/MainUI/French.lproj/Localizable.strings
trans.he = UI/MainUI/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/MainUI/Croatian.lproj/Localizable.strings
trans.hu = UI/MainUI/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/MainUI/Indonesian.lproj/Localizable.strings
trans.is = UI/MainUI/Icelandic.lproj/Localizable.strings
trans.it = UI/MainUI/Italian.lproj/Localizable.strings
trans.ja = UI/MainUI/Japanese.lproj/Localizable.strings
trans.lt = UI/MainUI/Lithuanian.lproj/Localizable.strings
trans.lv = UI/MainUI/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/MainUI/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/MainUI/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/MainUI/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/MainUI/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/MainUI/Polish.lproj/Localizable.strings
trans.pt = UI/MainUI/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/MainUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/MainUI/Romanian.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_CN = UI/MainUI/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/MainUI/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-administrationui]
source_file = UI/AdministrationUI/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/AdministrationUI/<lang>.lproj/Localizable.strings
[sogo.ui-common]
source_file = UI/Common/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/Common/Arabic.lproj/Localizable.strings
trans.ca = UI/Common/Catalan.lproj/Localizable.strings
trans.cs = UI/Common/Czech.lproj/Localizable.strings
trans.cy = UI/Common/Welsh.lproj/Localizable.strings
trans.da_DK = UI/Common/Danish.lproj/Localizable.strings
trans.de = UI/Common/German.lproj/Localizable.strings
trans.es_AR = UI/Common/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/Common/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/Common/Basque.lproj/Localizable.strings
trans.fi = UI/Common/Finnish.lproj/Localizable.strings
trans.fr = UI/Common/French.lproj/Localizable.strings
trans.he = UI/Common/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/Common/Croatian.lproj/Localizable.strings
trans.hu = UI/Common/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/Common/Indonesian.lproj/Localizable.strings
trans.is = UI/Common/Icelandic.lproj/Localizable.strings
trans.it = UI/Common/Italian.lproj/Localizable.strings
trans.ja = UI/Common/Japanese.lproj/Localizable.strings
trans.lt = UI/Common/Lithuanian.lproj/Localizable.strings
trans.lv = UI/Common/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/Common/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/Common/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/Common/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/Common/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/Common/Polish.lproj/Localizable.strings
trans.pt = UI/Common/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/Common/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/Common/Romanian.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_CN = UI/Common/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/Common/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-common]
source_file = UI/Common/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/Common/<lang>.lproj/Localizable.strings
[sogo.ui-administrationui]
source_file = UI/AdministrationUI/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/AdministrationUI/Arabic.lproj/Localizable.strings
trans.ca = UI/AdministrationUI/Catalan.lproj/Localizable.strings
trans.cs = UI/AdministrationUI/Czech.lproj/Localizable.strings
trans.cy = UI/AdministrationUI/Welsh.lproj/Localizable.strings
trans.da_DK = UI/AdministrationUI/Danish.lproj/Localizable.strings
trans.de = UI/AdministrationUI/German.lproj/Localizable.strings
trans.es_AR = UI/AdministrationUI/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/AdministrationUI/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/AdministrationUI/Basque.lproj/Localizable.strings
trans.fi = UI/AdministrationUI/Finnish.lproj/Localizable.strings
trans.fr = UI/AdministrationUI/French.lproj/Localizable.strings
trans.he = UI/AdministrationUI/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/AdministrationUI/Croatian.lproj/Localizable.strings
trans.hu = UI/AdministrationUI/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/AdministrationUI/Indonesian.lproj/Localizable.strings
trans.is = UI/AdministrationUI/Icelandic.lproj/Localizable.strings
trans.it = UI/AdministrationUI/Italian.lproj/Localizable.strings
trans.ja = UI/AdministrationUI/Japanese.lproj/Localizable.strings
trans.lt = UI/AdministrationUI/Lithuanian.lproj/Localizable.strings
trans.lv = UI/AdministrationUI/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/AdministrationUI/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/AdministrationUI/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/AdministrationUI/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/AdministrationUI/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/AdministrationUI/Polish.lproj/Localizable.strings
trans.pt = UI/AdministrationUI/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/AdministrationUI/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/AdministrationUI/Romanian.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_CN = UI/AdministrationUI/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/AdministrationUI/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-contacts]
source_file = UI/Contacts/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/Contacts/<lang>.lproj/Localizable.strings
[sogo.soobjects-appointments]
source_file = SoObjects/Appointments/English.lproj/Localizable.strings
source_lang = en
trans.ar = SoObjects/Appointments/Arabic.lproj/Localizable.strings
trans.ca = SoObjects/Appointments/Catalan.lproj/Localizable.strings
trans.cs = SoObjects/Appointments/Czech.lproj/Localizable.strings
trans.cy = SoObjects/Appointments/Welsh.lproj/Localizable.strings
trans.da_DK = SoObjects/Appointments/Danish.lproj/Localizable.strings
trans.de = SoObjects/Appointments/German.lproj/Localizable.strings
trans.es_AR = SoObjects/Appointments/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = SoObjects/Appointments/SpanishSpain.lproj/Localizable.strings
trans.eu = SoObjects/Appointments/Basque.lproj/Localizable.strings
trans.fi = SoObjects/Appointments/Finnish.lproj/Localizable.strings
trans.fr = SoObjects/Appointments/French.lproj/Localizable.strings
trans.he = SoObjects/Appointments/Hebrew.lproj/Localizable.strings
trans.hr_HR = SoObjects/Appointments/Croatian.lproj/Localizable.strings
trans.hu = SoObjects/Appointments/Hungarian.lproj/Localizable.strings
trans.id_ID = SoObjects/Appointments/Indonesian.lproj/Localizable.strings
trans.is = SoObjects/Appointments/Icelandic.lproj/Localizable.strings
trans.it = SoObjects/Appointments/Italian.lproj/Localizable.strings
trans.ja = SoObjects/Appointments/Japanese.lproj/Localizable.strings
trans.lt = SoObjects/Appointments/Lithuanian.lproj/Localizable.strings
trans.lv = SoObjects/Appointments/Latvian.lproj/Localizable.strings
trans.mk_MK = SoObjects/Appointments/Macedonian.lproj/Localizable.strings
trans.nb_NO = SoObjects/Appointments/NorwegianBokmal.lproj/Localizable.strings
trans.nl = SoObjects/Appointments/Dutch.lproj/Localizable.strings
trans.nn_NO = SoObjects/Appointments/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = SoObjects/Appointments/Polish.lproj/Localizable.strings
trans.pt = SoObjects/Appointments/Portuguese.lproj/Localizable.strings
trans.pt_BR = SoObjects/Appointments/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = SoObjects/Appointments/Romanian.lproj/Localizable.strings
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_CN = SoObjects/Appointments/ChineseChina.lproj/Localizable.strings
trans.zh_TW = SoObjects/Appointments/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-mailerui]
source_file = UI/MailerUI/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/MailerUI/<lang>.lproj/Localizable.strings
[sogo.soobjects-contacts]
source_file = SoObjects/Contacts/English.lproj/Localizable.strings
source_lang = en
trans.ar = SoObjects/Contacts/Arabic.lproj/Localizable.strings
trans.ca = SoObjects/Contacts/Catalan.lproj/Localizable.strings
trans.cs = SoObjects/Contacts/Czech.lproj/Localizable.strings
trans.cy = SoObjects/Contacts/Welsh.lproj/Localizable.strings
trans.da_DK = SoObjects/Contacts/Danish.lproj/Localizable.strings
trans.de = SoObjects/Contacts/German.lproj/Localizable.strings
trans.es_AR = SoObjects/Contacts/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = SoObjects/Contacts/SpanishSpain.lproj/Localizable.strings
trans.eu = SoObjects/Contacts/Basque.lproj/Localizable.strings
trans.fi = SoObjects/Contacts/Finnish.lproj/Localizable.strings
trans.fr = SoObjects/Contacts/French.lproj/Localizable.strings
trans.he = SoObjects/Contacts/Hebrew.lproj/Localizable.strings
trans.hr_HR = SoObjects/Contacts/Croatian.lproj/Localizable.strings
trans.hu = SoObjects/Contacts/Hungarian.lproj/Localizable.strings
trans.id_ID = SoObjects/Contacts/Indonesian.lproj/Localizable.strings
trans.is = SoObjects/Contacts/Icelandic.lproj/Localizable.strings
trans.it = SoObjects/Contacts/Italian.lproj/Localizable.strings
trans.ja = SoObjects/Contacts/Japanese.lproj/Localizable.strings
trans.lt = SoObjects/Contacts/Lithuanian.lproj/Localizable.strings
trans.lv = SoObjects/Contacts/Latvian.lproj/Localizable.strings
trans.mk_MK = SoObjects/Contacts/Macedonian.lproj/Localizable.strings
trans.nb_NO = SoObjects/Contacts/NorwegianBokmal.lproj/Localizable.strings
trans.nl = SoObjects/Contacts/Dutch.lproj/Localizable.strings
trans.nn_NO = SoObjects/Contacts/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = SoObjects/Contacts/Polish.lproj/Localizable.strings
trans.pt = SoObjects/Contacts/Portuguese.lproj/Localizable.strings
trans.pt_BR = SoObjects/Contacts/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = SoObjects/Contacts/Romanian.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_CN = SoObjects/Contacts/ChineseChina.lproj/Localizable.strings
trans.zh_TW = SoObjects/Contacts/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-mailpartviewers]
source_file = UI/MailPartViewers/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/MailPartViewers/<lang>.lproj/Localizable.strings
[sogo.soobjects-mailer]
source_file = SoObjects/Mailer/English.lproj/Localizable.strings
source_lang = en
trans.ar = SoObjects/Mailer/Arabic.lproj/Localizable.strings
trans.ca = SoObjects/Mailer/Catalan.lproj/Localizable.strings
trans.cs = SoObjects/Mailer/Czech.lproj/Localizable.strings
trans.cy = SoObjects/Mailer/Welsh.lproj/Localizable.strings
trans.da_DK = SoObjects/Mailer/Danish.lproj/Localizable.strings
trans.de = SoObjects/Mailer/German.lproj/Localizable.strings
trans.es_AR = SoObjects/Mailer/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = SoObjects/Mailer/SpanishSpain.lproj/Localizable.strings
trans.eu = SoObjects/Mailer/Basque.lproj/Localizable.strings
trans.fi = SoObjects/Mailer/Finnish.lproj/Localizable.strings
trans.fr = SoObjects/Mailer/French.lproj/Localizable.strings
trans.he = SoObjects/Mailer/Hebrew.lproj/Localizable.strings
trans.hr_HR = SoObjects/Mailer/Croatian.lproj/Localizable.strings
trans.hu = SoObjects/Mailer/Hungarian.lproj/Localizable.strings
trans.id_ID = SoObjects/Mailer/Indonesian.lproj/Localizable.strings
trans.is = SoObjects/Mailer/Icelandic.lproj/Localizable.strings
trans.it = SoObjects/Mailer/Italian.lproj/Localizable.strings
trans.ja = SoObjects/Mailer/Japanese.lproj/Localizable.strings
trans.lt = SoObjects/Mailer/Lithuanian.lproj/Localizable.strings
trans.lv = SoObjects/Mailer/Latvian.lproj/Localizable.strings
trans.mk_MK = SoObjects/Mailer/Macedonian.lproj/Localizable.strings
trans.nb_NO = SoObjects/Mailer/NorwegianBokmal.lproj/Localizable.strings
trans.nl = SoObjects/Mailer/Dutch.lproj/Localizable.strings
trans.nn_NO = SoObjects/Mailer/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = SoObjects/Mailer/Polish.lproj/Localizable.strings
trans.pt = SoObjects/Mailer/Portuguese.lproj/Localizable.strings
trans.pt_BR = SoObjects/Mailer/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = SoObjects/Mailer/Romanian.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_CN = SoObjects/Mailer/ChineseChina.lproj/Localizable.strings
trans.zh_TW = SoObjects/Mailer/ChineseTaiwan.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-mainui]
source_file = UI/MainUI/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/MainUI/<lang>.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-preferencesui]
source_file = UI/PreferencesUI/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/PreferencesUI/<lang>.lproj/Localizable.strings
[o:alinto:p:sogo:r:ui-scheduler]
source_file = UI/Scheduler/English.lproj/Localizable.strings
source_lang = en
file_filter = UI/Scheduler/<lang>.lproj/Localizable.strings
[sogo.ui-mailpartviewers]
source_file = UI/MailPartViewers/English.lproj/Localizable.strings
source_lang = en
trans.ar = UI/MailPartViewers/Arabic.lproj/Localizable.strings
trans.ca = UI/MailPartViewers/Catalan.lproj/Localizable.strings
trans.cs = UI/MailPartViewers/Czech.lproj/Localizable.strings
trans.cy = UI/MailPartViewers/Welsh.lproj/Localizable.strings
trans.da_DK = UI/MailPartViewers/Danish.lproj/Localizable.strings
trans.de = UI/MailPartViewers/German.lproj/Localizable.strings
trans.es_AR = UI/MailPartViewers/SpanishArgentina.lproj/Localizable.strings
trans.es_ES = UI/MailPartViewers/SpanishSpain.lproj/Localizable.strings
trans.eu = UI/MailPartViewers/Basque.lproj/Localizable.strings
trans.fi = UI/MailPartViewers/Finnish.lproj/Localizable.strings
trans.fr = UI/MailPartViewers/French.lproj/Localizable.strings
trans.he = UI/MailPartViewers/Hebrew.lproj/Localizable.strings
trans.hr_HR = UI/MailPartViewers/Croatian.lproj/Localizable.strings
trans.hu = UI/MailPartViewers/Hungarian.lproj/Localizable.strings
trans.id_ID = UI/MailPartViewers/Indonesian.lproj/Localizable.strings
trans.is = UI/MailPartViewers/Icelandic.lproj/Localizable.strings
trans.it = UI/MailPartViewers/Italian.lproj/Localizable.strings
trans.ja = UI/MailPartViewers/Japanese.lproj/Localizable.strings
trans.lt = UI/MailPartViewers/Lithuanian.lproj/Localizable.strings
trans.lv = UI/MailPartViewers/Latvian.lproj/Localizable.strings
trans.mk_MK = UI/MailPartViewers/Macedonian.lproj/Localizable.strings
trans.nb_NO = UI/MailPartViewers/NorwegianBokmal.lproj/Localizable.strings
trans.nl = UI/MailPartViewers/Dutch.lproj/Localizable.strings
trans.nn_NO = UI/MailPartViewers/NorwegianNynorsk.lproj/Localizable.strings
trans.pl = UI/MailPartViewers/Polish.lproj/Localizable.strings
trans.pt = UI/MailPartViewers/Portuguese.lproj/Localizable.strings
trans.pt_BR = UI/MailPartViewers/BrazilianPortuguese.lproj/Localizable.strings
trans.ro_RO = UI/MailPartViewers/Romanian.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_CN = UI/MailPartViewers/ChineseChina.lproj/Localizable.strings
trans.zh_TW = UI/MailPartViewers/ChineseTaiwan.lproj/Localizable.strings
+27
View File
@@ -0,0 +1,27 @@
const tracker = {
filename: "Version",
updater: require("./Scripts/standard-version-updater.js")
}
module.exports = {
tagPrefix: "SOGo-",
issueUrlFormat: "https://bugs.sogo.nu/view.php?id={{id}}",
compareUrlFormat: "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
types: [
{type: "feat", section: "Features"},
{type: "refactor", section: "Enhancements"},
{type: "perf", section: "Enhancements"},
{type: "i18n", section: "Localization"},
{type: "fix", section: "Bug Fixes"},
{type: "chore", hidden: true},
{type: "docs", hidden: true},
{type: "style", hidden: true},
{type: "test", hidden: true}
],
skip: {
commit: true,
tag: true
},
packageFiles: [tracker],
bumpFiles: [tracker]
}
+1 -1
View File
@@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@interface NGMimeMessage (ActiveSync)
- (NSArray *) allRecipients;
- (NSArray *) allBareRecipients;
@end
+28 -20
View File
@@ -38,39 +38,47 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@implementation NGMimeMessage (ActiveSync)
- (void) _addRecipients: (NSEnumerator *) enumerator
toArray: (NSMutableArray *) recipients
- (NSArray *) allRecipients
{
NGMailAddressParser *parser;
NSEnumerator *addressList;
NSMutableArray *allRecipients;
NGMailAddress *address;
NSEnumerator *recipients;
NSString *s;
NSString *fieldNames[] = {@"to", @"cc", @"bcc"};
unsigned int count;
while ((s = [enumerator nextObject]))
allRecipients = [NSMutableArray arrayWithCapacity: 16];
for (count = 0; count < 3; count++)
{
parser = [NGMailAddressParser mailAddressParserWithString: s];
addressList = [[parser parseAddressList] objectEnumerator];
while ((address = [addressList nextObject]))
[recipients addObject: [address address]];
recipients = [[self headersForKey: fieldNames[count]] objectEnumerator];
while ((s = [recipients nextObject]))
{
parser = [NGMailAddressParser mailAddressParserWithString: s];
addressList = [[parser parseAddressList] objectEnumerator];
while ((address = [addressList nextObject]))
[allRecipients addObject: [address address]];
}
}
return allRecipients;
}
- (NSArray *) allRecipients
- (NSArray *) allBareRecipients
{
NSMutableArray *recipients;
NSMutableArray *bareRecipients;
NSEnumerator *allRecipients;
NSString *recipient;
recipients = [NSMutableArray array];
bareRecipients = [NSMutableArray array];
[self _addRecipients: [[self headersForKey: @"to"] objectEnumerator]
toArray: recipients];
allRecipients = [[self allRecipients] objectEnumerator];
while ((recipient = [allRecipients nextObject]))
[bareRecipients addObject: [recipient pureEMailAddress]];
[self _addRecipients: [[self headersForKey: @"cc"] objectEnumerator]
toArray: recipients];
[self _addRecipients: [[self headersForKey: @"bcc"] objectEnumerator]
toArray: recipients];
return recipients;
return bareRecipients;
}
@end
+3
View File
@@ -109,6 +109,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ((o = [n flattenedValueAtIndex: 4 forKey: @""]))
[s appendFormat: @"<Suffix xmlns=\"Contacts:\">%@</Suffix>", [o activeSyncRepresentationInContext: context]];
if ((o = [self fn]))
[s appendFormat: @"<FileAs xmlns=\"Contacts:\">%@</FileAs>", [o activeSyncRepresentationInContext: context]];
if ((o = [self workCompany]))
[s appendFormat: @"<CompanyName xmlns=\"Contacts:\">%@</CompanyName>", [o activeSyncRepresentationInContext: context]];
+3 -3
View File
@@ -114,7 +114,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (ret != WBXML_OK)
{
[self errorWithFormat: @"wbxml2xmlFromContent: failed: %s\n", wbxml_errors_string(ret)];
[self errorWithFormat: @"wbxml2xml failed: %s\n", wbxml_errors_string(ret)];
[self _dumpToFile];
return nil;
}
@@ -147,7 +147,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (ret != WBXML_OK)
{
[self logWithFormat: @"xml2wbxmlFromContent: failed: %s\n", wbxml_errors_string(ret)];
[self logWithFormat: @"xml2wbxml failed: %s\n", wbxml_errors_string(ret)];
[self _dumpToFile];
return nil;
}
@@ -162,7 +162,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (ret != WBXML_OK)
{
[self errorWithFormat: @"xml2wbxmlFromContent: failed: %s\n", wbxml_errors_string(ret)];
[self errorWithFormat: @"xml2wbxml failed: %s\n", wbxml_errors_string(ret)];
[self _dumpToFile];
free(wbxml);
wbxml_conv_xml2wbxml_destroy(conv);
+1 -1
View File
@@ -234,7 +234,7 @@ static NSArray *easCommandParameters = nil;
// parameter_code 7 == Options
// http://msdn.microsoft.com/en-us/library/ee237789(v=exchg.80).aspx
if (parameter_code == 7)
if (parameter_code == 7 && ! [parameterValue isEqualToString: @"\000"] )
[components addObject: [NSString stringWithFormat: @"%@=%@", [easCommandParameters objectAtIndex: parameter_code],
([parameterValue isEqualToString: @"\001"]) ? @"SaveInSent" : @"AcceptMultiPart"]];
else
@@ -54,6 +54,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <SOGo/SOGoPermissions.h>
#import <NGCards/iCalCalendar.h>
#import <NGCards/iCalPerson.h>
#import <Appointments/iCalEntityObject+SOGo.h>
#import <Appointments/SOGoAppointmentObject.h>
@@ -297,6 +298,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NSMutableDictionary *folderMetadata, *dateCache, *syncCache, *uidCache, *allValues;
NSString *clientId, *serverId, *easId;
NSArray *additions, *roles;
SOGoUser *ownerUser;
id anAddition, sogoObject, o;
BOOL is_new;
@@ -456,6 +458,16 @@ FIXME
else
{
[o takeActiveSyncValues: allValues inContext: context];
// Handle situation were Alice creates an event in Bob's calendar.
// Bob should be the organizer, and Alice the SENT-BY.
ownerUser = [SOGoUser userWithLogin: [sogoObject ownerInContext: context]];
if (theFolderType == ActiveSyncEventFolder && ![o userIsOrganizer: ownerUser] && [[context activeUser] hasEmail: [[o organizer] rfc822Email]])
{
[[o organizer] setCn: [ownerUser cn]];
[[o organizer] setEmail: [[ownerUser allEmails] objectAtIndex: 0]];
[[o organizer] setSentBy: [NSString stringWithFormat: @"\"MAILTO:%@\"", [[[context activeUser] allEmails] objectAtIndex: 0]]];
}
[sogoObject setIsNew: is_new];
if (theFolderType == ActiveSyncEventFolder)
@@ -570,6 +582,7 @@ FIXME
NSArray *changes, *a, *roles;
id aChange, o, sogoObject;
NSMutableDictionary *folderMetadata, *syncCache, *uidCache;
SOGoUser *ownerUser;
int i;
@@ -690,6 +703,16 @@ FIXME
if (theFolderType == ActiveSyncEventFolder)
{
// Handle situation were Alice creates an event in Bob's calendar.
// Bob should be the organizer, and Alice the SENT-BY.
ownerUser = [SOGoUser userWithLogin: [sogoObject ownerInContext: context]];
if (theFolderType == ActiveSyncEventFolder && ![o userIsOrganizer: ownerUser] && [[context activeUser] hasEmail: [[o organizer] rfc822Email]])
{
[[o organizer] setCn: [ownerUser cn]];
[[o organizer] setEmail: [[ownerUser allEmails] objectAtIndex: 0]];
[[o organizer] setSentBy: [NSString stringWithFormat: @"\"MAILTO:%@\"", [[[context activeUser] allEmails] objectAtIndex: 0]]];
}
[sogoObject saveComponent: o force: YES];
if ([sogoObject resourceHasAutoAccepted])
[objectsToTouch addObject: sogoObject];
File diff suppressed because it is too large. Load diff
+44 -5
View File
@@ -60,6 +60,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <NGMime/NGMimeFileData.h>
#import <NGMime/NGMimeMultipartBody.h>
#import <NGMime/NGMimeType.h>
#import <NGMime/NGMimeHeaderFields.h>
#import <NGMail/NGMimeMessageParser.h>
#import <NGMail/NGMimeMessage.h>
#import <NGMail/NGMimeMessageGenerator.h>
@@ -290,6 +291,36 @@ struct GlobalObjectId {
}
// Format replyTo
//
// If there are multiple e-mail addresses, they are separated by a semi-colon.
- (NSString *) _replyToAddressesFrom: (NSArray *) enveloppeAddresses
{
NSMutableArray *addresses;
NSString *rc;
NGImap4EnvelopeAddress *address;
NSString *email;
int count, max;
rc = nil;
max = [enveloppeAddresses count];
if (max > 0)
{
addresses = [NSMutableArray array];
for (count = 0; count < max; count++)
{
address = [enveloppeAddresses objectAtIndex: count];
email = [NSString stringWithFormat: @"%@", [address email]];
[addresses addObject: email];
}
rc = [addresses componentsJoinedByString: @"; "];
}
return rc;
}
//
//
//
@@ -426,7 +457,7 @@ struct GlobalObjectId {
body = [thePart body];
if ([body isKindOfClass: [NGMimeMultipartBody class]])
if ([body isKindOfClass: [NGMimeMultipartBody class]] || [body isKindOfClass: [NGMimeMessage class]])
{
[self _sanitizedMIMEPart: body
performed: b];
@@ -478,6 +509,13 @@ struct GlobalObjectId {
RELEASE(fdata);
*b = YES;
}
else if ([body isKindOfClass: [NSData class]])
{
[thePart setHeader: @"base64" forKey: @"content-transfer-encoding"];
[thePart setBody: [body dataByEncodingBase64]];
[thePart setHeader: [NSString stringWithFormat:@"%d", (int)[[thePart body] length]]
forKey: @"content-length"];
}
}
}
@@ -1101,10 +1139,11 @@ struct GlobalObjectId {
[s appendFormat: @"<ContentClass xmlns=\"Email:\">%@</ContentClass>", @"urn:content-classes:message"];
}
// Reply-To - FIXME
//NSArray *replyTo = [[message objectForKey: @"envelope"] replyTo];
//if ([replyTo count])
// [s appendFormat: @"<Reply-To xmlns=\"Email:\">%@</Reply-To>", [addressFormatter stringForArray: replyTo]];
// ReplyTo
value = [self _replyToAddressesFrom: [self replyToEnvelopeAddresses]];
if (value)
[s appendFormat: @"<Reply-To xmlns=\"Email:\">%@</Reply-To>", [value activeSyncRepresentationInContext: context]];
// InternetCPID - 65001 == UTF-8, we use this all the time for now.
// - 20127 == US-ASCII
+1 -1
View File
@@ -40,7 +40,7 @@
<Proxy http://127.0.0.1:20000>
RequestHeader set "x-webobjects-server-port" "8843"
RequestHeader set "x-webobjects-server-name" "CHANGETHIS:8843"
RequestHeader set "x-webobjects-server-url" "http://CHANGETHIS:8843"
RequestHeader set "x-webobjects-server-url" "https://CHANGETHIS:8843"
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
AddDefaultCharset UTF-8
</Proxy>
+23 -11
View File
@@ -22,6 +22,14 @@ Alias /SOGo/WebServerResources/ \
</IfModule>
</Directory>
# Don't send the Referer header for cross-origin requests
Header always set Referrer-Policy "same-origin"
<Location /SOGo>
# Don't cache dynamic content
Header set Cache-Control "max-age=0, no-cache, no-store"
</Location>
## Uncomment the following to enable proxy-side authentication, you will then
## need to set the "SOGoTrustProxyAuthentication" SOGo user default to YES and
## adjust the "x-webobjects-remote-user" proxy header in the "Proxy" section
@@ -45,8 +53,12 @@ Alias /SOGo/WebServerResources/ \
#</Location>
ProxyRequests Off
SetEnv proxy-nokeepalive 1
ProxyPreserveHost On
SetEnv proxy-nokeepalive 1
# Uncomment the following lines if you experience "Bad gateway" errors with mod_proxy
#SetEnv proxy-initial-not-pooled 1
#SetEnv force-proxy-request-1.0 1
# When using CAS, you should uncomment this and install cas-proxy-validate.py
# in /usr/lib/cgi-bin to reduce server overloading
@@ -68,24 +80,24 @@ ProxyPreserveHost On
# http://127.0.0.1:20000/SOGo/Microsoft-Server-ActiveSync \
# retry=60 connectiontimeout=5 timeout=360
ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0 nocanon
<Proxy http://127.0.0.1:20000/SOGo>
## Adjust the following to your configuration
## and make sure to enable the headers module
<IfModule headers_module>
RequestHeader set "x-webobjects-server-port" "443"
SetEnvIf Host (.*) HTTP_HOST=$1
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
<IfModule headers_module>
RequestHeader set "x-webobjects-server-port" "443"
SetEnvIf Host (.*) HTTP_HOST=$1
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:
RequestHeader unset "x-webobjects-remote-user"
# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e" env=REMOTE_USER
RequestHeader unset "x-webobjects-remote-user"
# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e" env=REMOTE_USER
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
</IfModule>
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
</IfModule>
AddDefaultCharset UTF-8
-674
View File
@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program 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 of the License, or
(at your option) any later version.
This program 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. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
-34
View File
@@ -1,34 +0,0 @@
/* Codepages.h - this file is part of SOGo
*
* Copyright (C) 2014 Jesús García Sáez
*
* 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/NSDictionary.h>
#import <Foundation/NSValue.h>
#import <Foundation/NSString.h>
@interface Codepages
+ (NSDictionary *) getCodepagesTable;
+ (NSDictionary *) getReverseCodepagesTable;
+ (NSNumber *) getCodepageFromName: (NSString *) name;
+ (NSString *) getNameFromCodepage: (NSNumber *) codepage;
@end
-214
View File
@@ -1,214 +0,0 @@
/* Codepages.m - this file is part of SOGo
*
* Copyright (C) 2014 Jesús García Sáez
*
* 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 "Codepages.h"
#import <Foundation/NSArray.h>
@implementation Codepages
+ (NSDictionary *) getCodepagesTable
{
static NSDictionary *table = nil;
if (table == nil)
{
/* http://msdn.microsoft.com/en-us/library/dd317756%28v=vs.85%29.aspx */
table = [[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: 37], @"ibm037",
[NSNumber numberWithInt: 437], @"ibm437",
[NSNumber numberWithInt: 500], @"ibm500",
[NSNumber numberWithInt: 708], @"asmo-708",
[NSNumber numberWithInt: 720], @"dos-720",
[NSNumber numberWithInt: 737], @"ibm737",
[NSNumber numberWithInt: 775], @"ibm775",
[NSNumber numberWithInt: 850], @"ibm850",
[NSNumber numberWithInt: 852], @"ibm852",
[NSNumber numberWithInt: 855], @"ibm855",
[NSNumber numberWithInt: 857], @"ibm857",
[NSNumber numberWithInt: 858], @"ibm00858",
[NSNumber numberWithInt: 860], @"ibm860",
[NSNumber numberWithInt: 861], @"ibm861",
[NSNumber numberWithInt: 862], @"dos-862",
[NSNumber numberWithInt: 863], @"ibm863",
[NSNumber numberWithInt: 864], @"ibm864",
[NSNumber numberWithInt: 865], @"ibm865",
[NSNumber numberWithInt: 866], @"cp866",
[NSNumber numberWithInt: 869], @"ibm869",
[NSNumber numberWithInt: 870], @"ibm870",
[NSNumber numberWithInt: 874], @"windows-874",
[NSNumber numberWithInt: 875], @"cp875",
[NSNumber numberWithInt: 932], @"shift_jis",
[NSNumber numberWithInt: 936], @"gb2312",
[NSNumber numberWithInt: 949], @"ks_c_5601-1987",
[NSNumber numberWithInt: 950], @"big5",
[NSNumber numberWithInt: 1026], @"ibm1026",
[NSNumber numberWithInt: 1047], @"ibm01047",
[NSNumber numberWithInt: 1140], @"ibm01140",
[NSNumber numberWithInt: 1141], @"ibm01141",
[NSNumber numberWithInt: 1142], @"ibm01142",
[NSNumber numberWithInt: 1143], @"ibm01143",
[NSNumber numberWithInt: 1144], @"ibm01144",
[NSNumber numberWithInt: 1145], @"ibm01145",
[NSNumber numberWithInt: 1146], @"ibm01146",
[NSNumber numberWithInt: 1147], @"ibm01147",
[NSNumber numberWithInt: 1148], @"ibm01148",
[NSNumber numberWithInt: 1149], @"ibm01149",
[NSNumber numberWithInt: 1200], @"utf-16",
[NSNumber numberWithInt: 1201], @"unicodefffe",
[NSNumber numberWithInt: 1250], @"windows-1250",
[NSNumber numberWithInt: 1251], @"windows-1251",
[NSNumber numberWithInt: 1252], @"windows-1252",
[NSNumber numberWithInt: 1253], @"windows-1253",
[NSNumber numberWithInt: 1254], @"windows-1254",
[NSNumber numberWithInt: 1255], @"windows-1255",
[NSNumber numberWithInt: 1256], @"windows-1256",
[NSNumber numberWithInt: 1257], @"windows-1257",
[NSNumber numberWithInt: 1258], @"windows-1258",
[NSNumber numberWithInt: 1361], @"johab",
[NSNumber numberWithInt: 10000], @"macintosh",
[NSNumber numberWithInt: 10001], @"x-mac-japanese",
[NSNumber numberWithInt: 10002], @"x-mac-chinesetrad",
[NSNumber numberWithInt: 10003], @"x-mac-korean",
[NSNumber numberWithInt: 10004], @"x-mac-arabic",
[NSNumber numberWithInt: 10005], @"x-mac-hebrew",
[NSNumber numberWithInt: 10006], @"x-mac-greek",
[NSNumber numberWithInt: 10007], @"x-mac-cyrillic",
[NSNumber numberWithInt: 10008], @"x-mac-chinesesimp",
[NSNumber numberWithInt: 10010], @"x-mac-romanian",
[NSNumber numberWithInt: 10017], @"x-mac-ukrainian",
[NSNumber numberWithInt: 10021], @"x-mac-thai",
[NSNumber numberWithInt: 10029], @"x-mac-ce",
[NSNumber numberWithInt: 10079], @"x-mac-icelandic",
[NSNumber numberWithInt: 10081], @"x-mac-turkish",
[NSNumber numberWithInt: 10082], @"x-mac-croatian",
[NSNumber numberWithInt: 12000], @"utf-32",
[NSNumber numberWithInt: 12001], @"utf-32be",
[NSNumber numberWithInt: 20000], @"x-chinese-cns",
[NSNumber numberWithInt: 20001], @"x-cp20001",
[NSNumber numberWithInt: 20002], @"x-chinese-eten",
[NSNumber numberWithInt: 20003], @"x-cp20003",
[NSNumber numberWithInt: 20004], @"x-cp20004",
[NSNumber numberWithInt: 20005], @"x-cp20005",
[NSNumber numberWithInt: 20105], @"x-ia5",
[NSNumber numberWithInt: 20106], @"x-ia5-german",
[NSNumber numberWithInt: 20107], @"x-ia5-swedish",
[NSNumber numberWithInt: 20108], @"x-ia5-norwegian",
[NSNumber numberWithInt: 20127], @"us-ascii",
[NSNumber numberWithInt: 20261], @"x-cp20261",
[NSNumber numberWithInt: 20269], @"x-cp20269",
[NSNumber numberWithInt: 20273], @"ibm273",
[NSNumber numberWithInt: 20277], @"ibm277",
[NSNumber numberWithInt: 20278], @"ibm278",
[NSNumber numberWithInt: 20280], @"ibm280",
[NSNumber numberWithInt: 20284], @"ibm284",
[NSNumber numberWithInt: 20285], @"ibm285",
[NSNumber numberWithInt: 20290], @"ibm290",
[NSNumber numberWithInt: 20297], @"ibm297",
[NSNumber numberWithInt: 20420], @"ibm420",
[NSNumber numberWithInt: 20423], @"ibm423",
[NSNumber numberWithInt: 20424], @"ibm424",
[NSNumber numberWithInt: 20833], @"x-ebcdic-koreanextended",
[NSNumber numberWithInt: 20838], @"ibm-thai",
[NSNumber numberWithInt: 20866], @"koi8-r",
[NSNumber numberWithInt: 20871], @"ibm871",
[NSNumber numberWithInt: 20880], @"ibm880",
[NSNumber numberWithInt: 20905], @"ibm905",
[NSNumber numberWithInt: 20924], @"ibm00924",
[NSNumber numberWithInt: 20932], @"euc-jp",
[NSNumber numberWithInt: 20936], @"x-cp20936",
[NSNumber numberWithInt: 20949], @"x-cp20949",
[NSNumber numberWithInt: 21025], @"cp1025",
[NSNumber numberWithInt: 21866], @"koi8-u",
[NSNumber numberWithInt: 28591], @"iso-8859-1",
[NSNumber numberWithInt: 28592], @"iso-8859-2",
[NSNumber numberWithInt: 28593], @"iso-8859-3",
[NSNumber numberWithInt: 28594], @"iso-8859-4",
[NSNumber numberWithInt: 28595], @"iso-8859-5",
[NSNumber numberWithInt: 28596], @"iso-8859-6",
[NSNumber numberWithInt: 28597], @"iso-8859-7",
[NSNumber numberWithInt: 28598], @"iso-8859-8",
[NSNumber numberWithInt: 28599], @"iso-8859-9",
[NSNumber numberWithInt: 28603], @"iso-8859-13",
[NSNumber numberWithInt: 28605], @"iso-8859-15",
[NSNumber numberWithInt: 29001], @"x-europa",
[NSNumber numberWithInt: 38598], @"iso-8859-8-i",
[NSNumber numberWithInt: 50220], @"iso-2022-jp",
[NSNumber numberWithInt: 50221], @"csiso2022jp",
[NSNumber numberWithInt: 50222], @"iso-2022-jp",
[NSNumber numberWithInt: 50225], @"iso-2022-kr",
[NSNumber numberWithInt: 50227], @"x-cp50227",
[NSNumber numberWithInt: 51932], @"euc-jp",
[NSNumber numberWithInt: 51936], @"euc-cn",
[NSNumber numberWithInt: 51949], @"euc-kr",
[NSNumber numberWithInt: 52936], @"hz-gb-2312",
[NSNumber numberWithInt: 54936], @"gb18030",
[NSNumber numberWithInt: 57002], @"x-iscii-de",
[NSNumber numberWithInt: 57003], @"x-iscii-be",
[NSNumber numberWithInt: 57004], @"x-iscii-ta",
[NSNumber numberWithInt: 57005], @"x-iscii-te",
[NSNumber numberWithInt: 57006], @"x-iscii-as",
[NSNumber numberWithInt: 57007], @"x-iscii-or",
[NSNumber numberWithInt: 57008], @"x-iscii-ka",
[NSNumber numberWithInt: 57009], @"x-iscii-ma",
[NSNumber numberWithInt: 57010], @"x-iscii-gu",
[NSNumber numberWithInt: 57011], @"x-iscii-pa",
[NSNumber numberWithInt: 65000], @"utf-7",
[NSNumber numberWithInt: 65001], @"utf-8",
nil] retain];
}
return table;
}
+ (NSDictionary *) getReverseCodepagesTable
{
static NSDictionary *table = nil;
if (table == nil)
{
NSDictionary *codepages_table;
NSEnumerator *enumerator;
NSMutableArray *codepages, *names;
id key;
// Build reverse table: (NSNumber) codepage -> (NSString) encoding name
codepages_table = [self getCodepagesTable];
codepages = [NSMutableArray arrayWithCapacity: [codepages_table count]];
names = [NSMutableArray arrayWithCapacity: [codepages_table count]];
enumerator = [codepages_table keyEnumerator];
while ((key = [enumerator nextObject]))
{
[names addObject: key];
[codepages addObject: [codepages_table objectForKey: key]];
}
table = [[NSDictionary dictionaryWithObjects: names forKeys: codepages] retain];
}
return table;
}
+ (NSNumber *) getCodepageFromName: (NSString *) name
{
return [[self getCodepagesTable] objectForKey: [name lowercaseString]];
}
+ (NSString *) getNameFromCodepage: (NSNumber *) codepage
{
return [[self getReverseCodepagesTable] objectForKey: codepage];
}
@end
-200
View File
@@ -1,200 +0,0 @@
# GNUstep makefile
include ../config.make
include $(GNUSTEP_MAKEFILES)/common.make
include ../Version
BACKEND_VERSION = 1.0.0
### bootstrap library
MAPISTORESOGO = MAPIStoreSOGo
LIBRARY_NAME = $(MAPISTORESOGO)
$(MAPISTORESOGO)_VERSION = $(BACKEND_VERSION)
$(MAPISTORESOGO)_OBJC_FILES += \
MAPIStoreSOGo.m
### backend bundle
SOGOBACKEND = SOGoBackend
BUNDLE_NAME = $(SOGOBACKEND)
BUNDLE_EXTENSION = .MAPIStore
BUNDLE_INSTALL_DIR = $(SOGO_LIBDIR)
PYTHON = /usr/bin/python
PYTHON_IS_GOOD = $(shell $(PYTHON) -c 'from sys import version_info; a=version_info; print a[0] == 2 and a[1] >= 6')
ifeq (${PYTHON_IS_GOOD},False)
PYTHON = /usr/bin/python2.6
endif
all::
@echo " Python executable: ${PYTHON}"
SAMBA_PRIVATE_DIR = $(shell $(PYTHON) ./samba-get-config.py 'private dir' || echo /var/lib/samba/private)
$(SOGOBACKEND)_PRINCIPAL_CLASS = MAPIApplication
$(SOGOBACKEND)_OBJC_FILES += \
MAPIApplication.m \
MAPIStoreActiveTables.m \
MAPIStoreAuthenticator.m \
MAPIStoreMapping.m \
MAPIStoreMIME.m \
MAPIStoreTypes.m \
MAPIStorePropertySelectors.m \
MAPIStoreSamDBUtils.m \
MAPIStoreUserContext.m \
\
SOGoMAPIDBMessage.m \
SOGoCacheGCSObject+MAPIStore.m \
\
MAPIStoreAppointmentWrapper.m \
MAPIStoreAttachment.m \
MAPIStoreAttachmentTable.m \
MAPIStoreContext.m \
MAPIStoreEmbeddedMessage.m \
MAPIStoreFolder.m \
MAPIStoreMessage.m \
MAPIStoreObject.m \
MAPIStoreObjectProxy.m \
MAPIStoreSOGoObject.m \
MAPIStoreTable.m \
MAPIStoreMessageTable.m \
MAPIStoreFolderTable.m \
MAPIStorePermissionsTable.m \
\
MAPIStoreDBBaseContext.m \
MAPIStoreDBFolder.m \
MAPIStoreDBFolderTable.m \
MAPIStoreDBMessage.m \
MAPIStoreDBMessageTable.m \
\
MAPIStoreFAIMessage.m \
MAPIStoreFAIMessageTable.m \
\
MAPIStoreGCSBaseContext.m \
MAPIStoreGCSFolder.m \
MAPIStoreGCSMessage.m \
MAPIStoreGCSMessageTable.m \
\
MAPIStoreCalTaskFolder.m \
MAPIStoreCalTaskMessage.m \
\
MAPIStoreCalendarAttachment.m \
MAPIStoreCalendarContext.m \
MAPIStoreCalendarFolder.m \
MAPIStoreCalendarMessage.m \
MAPIStoreCalendarEmbeddedMessage.m \
MAPIStoreCalendarMessageTable.m \
MAPIStoreRecurrenceUtils.m \
\
MAPIStoreContactsAttachment.m \
MAPIStoreContactsContext.m \
MAPIStoreContactsFolder.m \
MAPIStoreContactsMessage.m \
MAPIStoreContactsMessageTable.m \
\
MAPIStoreTasksContext.m \
MAPIStoreTasksFolder.m \
MAPIStoreTasksMessage.m \
MAPIStoreTasksMessageTable.m \
\
MAPIStoreMailAttachment.m \
MAPIStoreMailContext.m \
MAPIStoreMailFolder.m \
MAPIStoreMailFolderTable.m \
MAPIStoreMailMessage.m \
MAPIStoreMailVolatileMessage.m \
MAPIStoreMailMessageTable.m \
\
MAPIStoreNotesContext.m \
MAPIStoreNotesFolder.m \
MAPIStoreNotesMessage.m \
\
MAPIStoreFallbackContext.m \
\
MAPIStoreSharingMessage.m \
\
NSArray+MAPIStore.m \
NSData+MAPIStore.m \
NSDate+MAPIStore.m \
NSObject+MAPIStore.m \
NSString+MAPIStore.m \
NSValue+MAPIStore.m \
\
iCalEvent+MAPIStore.m \
iCalTimeZone+MAPIStore.m \
\
RTFHandler.m \
\
Codepages.m
$(SOGOBACKEND)_RESOURCE_FILES += \
product.plist
### pl reader
PLREADER_TOOL = plreader
$(PLREADER_TOOL)_OBJC_FILES += \
plreader.m \
DBMSGREADER_TOOL = dbmsgreader
$(DBMSGREADER_TOOL)_OBJC_FILES += \
dbmsgreader.m \
NSObject+PropertyList.m
$(DBMSGREADER_TOOL)_LIB_DIRS += \
-L../SoObjects/SOGo/SOGo.framework/sogo -lSOGo \
-L../SOPE/GDLContentStore/obj/ -lGDLContentStore \
-L../SOPE/NGCards/obj/ -lNGCards \
-lNGObjWeb \
$(LIBMAPI_LIBS)
TEST_TOOL_NAME += $(PLREADER_TOOL) $(DBMSGREADER_TOOL)
### cflags and libs
LIBMAPI_CFLAGS = $(shell pkg-config libmapi --cflags)
ifeq ($(LIBMAPI_CFLAGS),)
all install::
@echo "Cannot build the OpenChange SOGo backend (empty CFLAGS for libmapistore)"
else
SAMBA_LIB_DIR = $(shell pkg-config libmapistore --variable=libdir)
LIBMAPI_LIBS = $(shell pkg-config libmapi --libs)
LIBMAPISTORE_CFLAGS = $(shell pkg-config libmapistore --cflags) -DSAMBA_PREFIX="\"$(shell pkg-config libmapistore --variable=prefix)\""
LIBMAPISTORE_LIBS = $(shell pkg-config libmapistore --libs) -lmapiproxy -lWEExtensions
$(MAPISTORESOGO)_INSTALL_DIR = $(DESTDIR)/$(SAMBA_LIB_DIR)/mapistore_backends
$(MAPISTORESOGO)_LIB_DIRS += \
-L../SoObjects/SOGo/SOGo.framework/sogo/ -lSOGo -lgnustep-base -lobjc -lNGObjWeb \
$(LIBMAPI_LIBS) \
$(LIBMAPISTORE_LIBS)
$(SOGOBACKEND)_LIB_DIRS += \
-L../SoObjects/SOGo/SOGo.framework/sogo/ -lSOGo \
$(LIBMAPI_LIBS) \
$(LIBMAPISTORE_LIBS)
ADDITIONAL_INCLUDE_DIRS += \
-Wall \
-DSAMBA_PRIVATE_DIR=@"\"$(SAMBA_PRIVATE_DIR)\"" \
$(LIBMAPI_CFLAGS) \
$(LIBMAPISTORE_CFLAGS) \
-I../SoObjects -I../SOPE \
-DBACKEND_BUNDLE_NAME="@\"$(BUNDLE_NAME)$(BUNDLE_EXTENSION)\"" \
-DSOGO_BUNDLES_DIR="@\"$(BUNDLE_INSTALL_DIR)\""
ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/bundle.make
include $(GNUSTEP_MAKEFILES)/library.make
include $(GNUSTEP_MAKEFILES)/test-tool.make
include $(GNUSTEP_MAKEFILES)/aggregate.make
-include GNUmakefile.postamble
endif
-8
View File
@@ -1,8 +0,0 @@
all:: MAPIStorePropertySelectors.m MAPIStorePropertySelectors.h
MAPIStorePropertySelectors.m MAPIStorePropertySelectors.h: gen-property-selectors.py code-MAPIStorePropertySelectors.m code-MAPIStorePropertySelectors.h
@echo " Auto-generating MAPIStorePropertySelectors.[hm]..."
@$(PYTHON) ./gen-property-selectors.py -o MAPIStorePropertySelectors $(LIBMAPISTORE_CFLAGS)
distclean clean::
-rm -f MAPIStorePropertySelectors.m MAPIStorePropertySelectors.h
-44
View File
@@ -1,44 +0,0 @@
/* MAPIApplication.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPIAPPLICATION_H
#define MAPIAPPLICATION_H
#import <NGObjWeb/SoApplication.h>
@class MAPIStoreUserContext;
@interface MAPIApplication : SoApplication
{
MAPIStoreUserContext *userContext;
}
- (id) authenticatorInContext: (id) context;
- (MAPIStoreUserContext *) userContext;
- (void) setUserContext: (MAPIStoreUserContext *) newContext;
- (void) cleanup;
@end
extern MAPIApplication *MAPIApp;
#endif /* MAPIAPPLICATION_H */
-101
View File
@@ -1,101 +0,0 @@
/* MAPIApplication.m - this file is part of SOGo
*
* Copyright (C) 2010 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSUserDefaults.h>
#import <Foundation/NSTimeZone.h>
#import <WEExtensions/WEResourceManager.h>
#import <SOGo/SOGoProductLoader.h>
#import <SOGo/SOGoSystemDefaults.h>
#import <Appointments/iCalEntityObject+SOGo.h>
#import "MAPIStoreUserContext.h"
#import "MAPIStoreTypes.h"
#import "MAPIApplication.h"
MAPIApplication *MAPIApp = nil;
@implementation MAPIApplication
+ (BOOL) isCachingEnabled;
{
return NO;
}
- (NSString *) name
{
return @"SOGo";
}
- (id) init
{
if (!MAPIApp)
{
WEResourceManager *rm;
// TODO publish
[iCalEntityObject initializeSOGoExtensions];
MAPIApp = [super init];
[MAPIApp retain];
rm = [[WEResourceManager alloc] init];
[self setResourceManager:rm];
[rm release];
utcTZ = [NSTimeZone timeZoneWithName: @"UTC"];
[utcTZ retain];
}
return MAPIApp;
}
- (BOOL) shouldSetupSignalHandlers
{
return NO;
}
- (MAPIStoreUserContext *) userContext
{
return userContext;
}
- (void) setUserContext: (MAPIStoreUserContext *) newContext
{
/* user contexts must not be retained here ad their holder (mapistore)
contexts must be active when any operation occurs. */
userContext = newContext;
}
- (id) authenticatorInContext: (id) context
{
return [userContext authenticator];
}
- (void) cleanup
{
[userContext deactivate];
}
@end
-47
View File
@@ -1,47 +0,0 @@
/* MAPIStoreActiveTables.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREACTIVETABLES_H
#define MAPISTOREACTIVETABLES_H
#import <Foundation/NSObject.h>
@class NSMutableArray;
@class MAPIStoreTable;
@interface MAPIStoreActiveTables : NSObject
{
NSMutableArray *records;
}
+ (id) activeTables;
- (void) registerTable: (MAPIStoreTable *) table;
- (void) unregisterTable: (MAPIStoreTable *) table;
- (NSArray *) activeTablesForFMID: (uint64_t) fmid
andType: (uint8_t) tableType;
@end
#endif /* MAPISTOREACTIVETABLES_H */
-198
View File
@@ -1,198 +0,0 @@
/* MAPIStoreActiveTables.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
/* MAPIStoreActiveTables provides an interface to keep accounting of all
instances of a given table, independently from its store and context.
Primary useful for notifications across different connections. */
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
#import "MAPIStoreFolder.h"
#import "MAPIStoreTable.h"
#import "MAPIStoreActiveTables.h"
@interface MAPIStoreActiveTableRecord : NSObject
{
uint64_t folderId;
uint8_t tableType;
MAPIStoreTable *table;
}
+ (id) recordForTable: (MAPIStoreTable *) newTable;
- (id) initWithTable: (MAPIStoreTable *) newTable;
- (MAPIStoreTable *) table;
- (BOOL) exactlyMatchesTable: (MAPIStoreTable *) otherTable;
- (BOOL) matchesFMID: (uint64_t) otherFMid
andTableType: (uint8_t) otherTableType;
- (BOOL) matchesTable: (MAPIStoreTable *) otherTable;
@end
@implementation MAPIStoreActiveTableRecord : NSObject
+ (id) recordForTable: (MAPIStoreTable *) newTable
{
MAPIStoreActiveTableRecord *record;
record = [[self alloc] initWithTable: newTable];
[record autorelease];
return record;
}
- (id) init
{
if ((self = [super init]))
{
folderId = 0;
tableType = 0;
table = nil;
}
return self;
}
- (id) initWithTable: (MAPIStoreTable *) newTable
{
if ((self = [self init]))
{
table = newTable;
folderId = [[table container] objectId];
tableType = [table tableType];
}
return self;
}
- (MAPIStoreTable *) table
{
return table;
}
- (BOOL) exactlyMatchesTable: (MAPIStoreTable *) otherTable
{
return (table == otherTable);
}
- (BOOL) matchesFMID: (uint64_t) otherFMid
andTableType: (uint8_t) otherTableType
{
return (tableType == otherTableType
&& folderId == otherFMid);
}
- (BOOL) matchesTable: (MAPIStoreTable *) otherTable
{
uint64_t otherFMid;
BOOL rc;
rc = [self exactlyMatchesTable: otherTable];
if (!rc)
{
otherFMid = [[otherTable container] objectId];
rc = [self matchesFMID: otherFMid andTableType: [otherTable tableType]];
}
return rc;
}
@end
@implementation MAPIStoreActiveTables
+ (id) activeTables
{
static MAPIStoreActiveTables *activeTables = nil;
if (!activeTables)
activeTables = [self new];
return activeTables;
}
- (id) init
{
if ((self = [super init]))
{
records = [NSMutableArray new];
}
return self;
}
- (void) dealloc
{
[records release];
[super dealloc];
}
- (void) registerTable: (MAPIStoreTable *) table
{
MAPIStoreActiveTableRecord *newRecord;
newRecord = [MAPIStoreActiveTableRecord recordForTable: table];
[records addObject: newRecord];
}
- (void) unregisterTable: (MAPIStoreTable *) table
{
MAPIStoreActiveTableRecord *currentRecord;
NSUInteger count, max;
BOOL done = NO;
max = [records count];
for (count = 0; !done && count < max; count++)
{
currentRecord = [records objectAtIndex: count];
if ([currentRecord exactlyMatchesTable: table])
{
[records removeObject: currentRecord];
done = YES;
}
}
}
- (NSArray *) activeTablesForFMID: (uint64_t) fmid
andType: (uint8_t) tableType
{
NSUInteger count, max;
NSMutableArray *tables;
MAPIStoreActiveTableRecord *currentRecord;
tables = [NSMutableArray arrayWithCapacity: 5];
max = [records count];
for (count = 0; count < max; count++)
{
currentRecord = [records objectAtIndex: count];
if ([currentRecord matchesFMID: fmid andTableType: tableType])
[tables addObject: [currentRecord table]];
}
return tables;
}
@end
@@ -1,177 +0,0 @@
/* MAPIStoreAppointmentWrapper.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTORECALENDARWRAPPER_H
#define MAPISTORECALENDARWRAPPER_H
#import <NGCards/iCalPerson.h>
#import <NGCards/iCalTimeZone.h>
#import <Appointments/iCalEntityObject+SOGo.h>
#import "MAPIStoreObjectProxy.h"
@class NSTimeZone;
@class iCalAlarm;
@class iCalCalendar;
@class iCalEvent;
@class SOGoUser;
@interface MAPIStoreAppointmentWrapper : MAPIStoreObjectProxy
{
struct mapistore_connection_info *connInfo;
iCalCalendar *calendar;
iCalEvent *firstEvent;
iCalEvent *event;
iCalTimeZone *timeZone;
SOGoUser *user;
NSString *senderEmail;
NSData *globalObjectId;
NSData *cleanGlobalObjectId;
BOOL alarmSet;
iCalAlarm *alarm;
BOOL itipSetup;
NSString *method;
iCalPersonPartStat partstat;
}
+ (id) wrapperWithICalEvent: (iCalEvent *) newEvent
andUser: (SOGoUser *) newUser
andSenderEmail: (NSString *) newSenderEmail
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo;
- (id) initWithICalEvent: (iCalEvent *) newEvent
andUser: (SOGoUser *) newUser
andSenderEmail: (NSString *) newSenderEmail
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo;
/* getters */
- (void) fillMessageData: (struct mapistore_message *) dataPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (NSString *) creator;
- (NSString *) owner;
- (NSUInteger) sensitivity;
- (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;
- (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;
- (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 */
- (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
#endif /* MAPISTORECALENDARWRAPPER_H */
File diff suppressed because it is too large. Load diff
-59
View File
@@ -1,59 +0,0 @@
/* MAPIStoreAttachment.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREATTACHMENT_H
#define MAPISTOREATTACHMENT_H
#import "MAPIStoreObject.h"
@class NSData;
@class MAPIStoreEmbeddedMessage;
@interface MAPIStoreAttachment : MAPIStoreObject
{
uint32_t aid;
}
- (void) setAID: (uint32_t) newAID;
- (uint32_t) AID;
- (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;
/* move & copy operations */
- (void) copyToAttachment: (MAPIStoreAttachment *) newAttachment inMemCtx: (TALLOC_CTX *) memCtx;
/* subclasses */
- (MAPIStoreEmbeddedMessage *) openEmbeddedMessage;
- (MAPIStoreEmbeddedMessage *) createEmbeddedMessage;
@end
#endif /* MAPISTOREATTACHMENT_H */
-194
View File
@@ -1,194 +0,0 @@
/* MAPIStoreAttachment.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSData.h>
#import "MAPIStoreAttachment.h"
#import "MAPIStoreEmbeddedMessage.h"
#import "MAPIStoreContext.h"
#import "MAPIStoreMapping.h"
#import "MAPIStoreMessage.h"
#import "MAPIStoreTypes.h"
#import "NSObject+MAPIStore.h"
#undef DEBUG
#include <stdbool.h>
#include <gen_ndr/exchange.h>
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreAttachment
- (void) setAID: (uint32_t) newAID
{
aid = newAID;
}
- (uint32_t) AID
{
return aid;
}
- (NSString *) nameInContainer
{
return [NSString stringWithFormat: @"%d", aid];
}
- (NSData *) mimeAttachTag
{
static NSData *mimeAttachTag = nil;
char tagBytes[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x14, 0x03, 0x0a, 0x04};
if (!mimeAttachTag)
{
mimeAttachTag = [NSData dataWithBytes: tagBytes length: 9];
[mimeAttachTag retain];
}
return mimeAttachTag;
}
- (enum mapistore_error) getPidTagMid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, [container objectId]);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, aid);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagRenderingPosition: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0xffffffff);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: 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;
mapistoreMsg = talloc_zero (memCtx, struct mapistore_message);
attMessage = [self openEmbeddedMessage];
if (attMessage)
{
*mid = [attMessage objectId];
*messagePtr = attMessage;
*mapistoreMsgPtr = mapistoreMsg;
}
return (attMessage ? MAPISTORE_SUCCESS : MAPISTORE_ERROR);
}
- (enum mapistore_error) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreEmbeddedMessage *attMessage;
struct mapistore_message *mapistoreMsg;
mapistoreMsg = talloc_zero (memCtx, struct mapistore_message);
attMessage = [self createEmbeddedMessage];
if (attMessage)
{
*messagePtr = attMessage;
*mapistoreMsgPtr = mapistoreMsg;
}
return (attMessage ? MAPISTORE_SUCCESS : MAPISTORE_ERROR);
}
- (NSDate *) creationTime
{
return [container creationTime];
}
- (NSDate *) lastModificationTime
{
return [container lastModificationTime];
}
- (uint64_t) objectVersion
{
/* attachments have no version number */
return ULLONG_MAX;
}
- (void) copyToAttachment: (MAPIStoreAttachment *) newAttachment inMemCtx: (TALLOC_CTX *) memCtx
{
void *attachMethod;
enum mapistore_error error;
MAPIStoreEmbeddedMessage *embeddedMessage, *newEmbeddedMessage;
[self copyPropertiesToObject: newAttachment inMemCtx: memCtx];
attachMethod = NULL;
error = [self getProperty: &attachMethod
withTag: PidTagAttachMethod
inMemCtx: NULL];
if (error == MAPISTORE_SUCCESS && attachMethod)
{
if (*(uint32_t *) attachMethod == afEmbeddedMessage)
{
embeddedMessage = [self openEmbeddedMessage];
newEmbeddedMessage = [newAttachment createEmbeddedMessage];
[embeddedMessage copyToMessage: newEmbeddedMessage inMemCtx: memCtx];
}
talloc_free (attachMethod);
}
}
/* subclasses */
- (MAPIStoreEmbeddedMessage *) openEmbeddedMessage
{
// [self subclassResponsibility: _cmd];
return nil;
}
- (MAPIStoreEmbeddedMessage *) createEmbeddedMessage
{
[self subclassResponsibility: _cmd];
return nil;
}
@end
@@ -1,31 +0,0 @@
/* MAPIStoreAttachmentTable.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREATTACHMENTTABLE_H
#define MAPISTOREATTACHMENTTABLE_H
#import "MAPIStoreTable.h"
@interface MAPIStoreAttachmentTable : MAPIStoreTable
@end
#endif /* MAPISTOREATTACHMENTTABLE_H */
@@ -1,73 +0,0 @@
/* MAPIStoreAttachmentTable.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 "MAPIStoreMessage.h"
#import "MAPIStoreAttachmentTable.h"
@implementation MAPIStoreAttachmentTable
- (NSArray *) childKeys
{
if (!childKeys)
{
childKeys = [(MAPIStoreMessage *)
container attachmentKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [(MAPIStoreMessage *)
container attachmentKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (id) lookupChild: (NSString *) childKey
{
return [(MAPIStoreMessage *) container lookupAttachment: childKey];
}
@end
-54
View File
@@ -1,54 +0,0 @@
/* MAPIStoreAuthenticator.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREAUTHENTICATOR_H
#define MAPISTOREAUTHENTICATOR_H
#import <Foundation/NSObject.h>
@class NSString;
@class NSURL;
@class WOContext;
@interface MAPIStoreAuthenticator : NSObject
{
NSString *username;
NSString *password;
}
- (void) setUsername: (NSString *) newUsername;
- (NSString *) username;
- (void) setPassword: (NSString *) newPassword;
- (NSString *) imapPasswordInContext: (WOContext *) context
forURL: (NSURL *) server
forceRenew: (BOOL) renew;
- (NSString *) passwordInContext: (WOContext *) context;
@end
#endif /* MAPISTOREAUTHENTICATOR_H */
-79
View File
@@ -1,79 +0,0 @@
/* MAPIStoreAuthenticator.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSURL.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoPermissions.h>
#import "MAPIStoreAuthenticator.h"
@implementation MAPIStoreAuthenticator
- (void) dealloc
{
[username release];
[password release];
[super dealloc];
}
- (void) setUsername: (NSString *) newUsername
{
ASSIGN (username, newUsername);
}
- (NSString *) username
{
return username;
}
- (void) setPassword: (NSString *) newPassword
{
ASSIGN (password, newPassword);
}
- (SOGoUser *) userInContext: (WOContext *)_ctx
{
return [SOGoUser userWithLogin: username
roles: [NSArray arrayWithObject: SoRole_Authenticated]];
}
- (NSString *) imapPasswordInContext: (WOContext *) context
forURL: (NSURL *) server
forceRenew: (BOOL) renew
{
NSString *imapPassword;
if (renew)
imapPassword = nil;
else
imapPassword = password;
return imapPassword;
}
- (NSString *) passwordInContext: (WOContext *) context
{
return password;
}
@end
-35
View File
@@ -1,35 +0,0 @@
/* 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
@@ -1,101 +0,0 @@
/* 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
@@ -1,40 +0,0 @@
/* 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
@@ -1,107 +0,0 @@
/* 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
@@ -1,255 +0,0 @@
/* MAPIStoreCalendarAttachment.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSCalendarDate.h>
#import <Foundation/NSData.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSTimeZone.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSObject+Logs.h>
#import "iCalEvent+MAPIStore.h"
#import "MAPIStoreCalendarEmbeddedMessage.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import "NSDate+MAPIStore.h"
#import "NSData+MAPIStore.h"
#import "NSObject+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreCalendarAttachment.h"
#undef DEBUG
#include <stdbool.h>
#include <gen_ndr/exchange.h>
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreCalendarAttachment
- (id) init
{
if ((self = [super init]))
{
event = nil;
timeZone = nil;
}
return self;
}
- (id) initInContainer: (MAPIStoreObject *) newContainer
{
MAPIStoreUserContext *userContext;
if ((self = [super initInContainer: newContainer]))
{
userContext = [newContainer userContext];
ASSIGN (timeZone, [userContext timeZone]);
}
return self;
}
- (void) dealloc
{
[event release];
[timeZone release];
[super dealloc];
}
- (void) setEvent: (iCalEvent *) newEvent
{
ASSIGN (event, newEvent);
}
- (iCalEvent *) event
{
return event;
}
- (NSString *) nameInContainer
{
return [[event uniqueChildWithTag: @"recurrence-id"]
flattenedValuesForKey: @""];
}
- (enum mapistore_error) getPidTagAttachmentHidden: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getYes: data inMemCtx: localMemCtx];
}
- (enum mapistore_error) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = MAPILongValue (localMemCtx, 0x00000002); /* afException */
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getLongZero: data inMemCtx: localMemCtx];
}
- (enum mapistore_error) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getLongZero: data inMemCtx: localMemCtx];
}
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = MAPILongValue (localMemCtx, afEmbeddedMessage);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachEncoding: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = [[NSData data] asBinaryInMemCtx: localMemCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = [@"Untitled" asUnicodeInMemCtx: localMemCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagExceptionReplaceTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc;
NSCalendarDate *dateValue;
NSInteger offset;
dateValue = [event recurrenceId];
if (dateValue)
{
rc = MAPISTORE_SUCCESS;
if ([event isAllDay])
{
offset = -[timeZone secondsFromGMTForDate: dateValue];
dateValue = [dateValue dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: offset];
}
[dateValue setTimeZone: utcTZ];
*data = [dateValue asFileTimeInMemCtx: memCtx];
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
return rc;
}
- (enum mapistore_error) getPidTagExceptionStartTime: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
enum mapistore_error rc;
NSCalendarDate *dateValue;
NSInteger offset;
if ([event recurrenceId] != nil)
{
dateValue = [event startDate];
[dateValue setTimeZone: timeZone];
if (![event isAllDay])
{
offset = [timeZone secondsFromGMTForDate: dateValue];
dateValue = [dateValue dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: offset];
}
*data = [dateValue asFileTimeInMemCtx: localMemCtx];
rc = MAPISTORE_SUCCESS;
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
return rc;
}
- (enum mapistore_error) getPidTagExceptionEndTime: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
enum mapistore_error rc;
NSCalendarDate *dateValue;
NSInteger offset;
if ([event recurrenceId] != nil)
{
dateValue = [event startDate];
[dateValue setTimeZone: timeZone];
offset = [event durationAsTimeInterval];
if (![event isAllDay])
offset += [timeZone secondsFromGMTForDate: dateValue];
dateValue = [dateValue dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: offset];
*data = [dateValue asFileTimeInMemCtx: localMemCtx];
rc = MAPISTORE_SUCCESS;
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
return rc;
}
/* subclasses */
- (MAPIStoreCalendarEmbeddedMessage *) openEmbeddedMessage
{
MAPIStoreCalendarEmbeddedMessage *msg;
msg = [MAPIStoreCalendarEmbeddedMessage
mapiStoreObjectInContainer: self];
return msg;
}
- (MAPIStoreCalendarEmbeddedMessage *) createEmbeddedMessage
{
MAPIStoreCalendarEmbeddedMessage *msg;
msg = [self openEmbeddedMessage];
[msg setIsNew: YES];
return msg;
}
@end
@@ -1,32 +0,0 @@
/* MAPIStoreCalendarContext.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTORECALENDARCONTEXT_H
#define MAPISTORECALENDARCONTEXT_H
#import "MAPIStoreGCSBaseContext.h"
@interface MAPIStoreCalendarContext : MAPIStoreGCSBaseContext
@end
#endif /* MAPISTORECALENDARCONTEXT_H */
@@ -1,64 +0,0 @@
/* MAPIStoreCalendarContext.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import <Appointments/SOGoAppointmentFolders.h>
#import "MAPIStoreMapping.h"
#import "MAPIStoreCalendarFolder.h"
#import "MAPIStoreUserContext.h"
#import "MAPIStoreCalendarContext.h"
#undef DEBUG
#include <mapistore/mapistore.h>
static Class MAPIStoreCalendarFolderK;
@implementation MAPIStoreCalendarContext
+ (void) initialize
{
MAPIStoreCalendarFolderK = [MAPIStoreCalendarFolder class];
}
+ (NSString *) MAPIModuleName
{
return @"calendar";
}
+ (enum mapistore_context_role) MAPIContextRole
{
return MAPISTORE_CALENDAR_ROLE;
}
- (Class) MAPIStoreFolderClass
{
return MAPIStoreCalendarFolderK;
}
+ (NSString *) folderNameSuffix
{
return @"c";
}
@end
@@ -1,34 +0,0 @@
/* MAPIStoreCalendarEmbeddedMessage.h - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTORECALENDAREMBEDDEDMESSAGE_H
#define MAPISTORECALENDAREMBEDDEDMESSAGE_H
#import "MAPIStoreEmbeddedMessage.h"
@class MAPIStoreAppointmentWrapper;
@interface MAPIStoreCalendarEmbeddedMessage : MAPIStoreEmbeddedMessage
@end
#endif /* MAPISTORECALENDAREMBEDDEDMESSAGE_H */
@@ -1,215 +0,0 @@
/* MAPIStoreCalendarEmbeddedMessage.m - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#include <talloc.h>
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSDictionary.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <SOGo/SOGoUser.h>
#import "iCalEvent+MAPIStore.h"
#import "MAPIStoreAppointmentWrapper.h"
#import "MAPIStoreCalendarAttachment.h"
#import "MAPIStoreContext.h"
#import "MAPIStoreUserContext.h"
#import "MAPIStoreTypes.h"
#import "NSObject+MAPIStore.h"
#import "MAPIStoreCalendarEmbeddedMessage.h"
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreCalendarEmbeddedMessage
- (id) initInContainer: (id) newContainer
{
MAPIStoreContext *context;
MAPIStoreUserContext *userContext;
MAPIStoreAppointmentWrapper *appointmentWrapper;
if ((self = [super initInContainer: newContainer]))
{
context = [self context];
userContext = [self userContext];
appointmentWrapper
= [MAPIStoreAppointmentWrapper
wrapperWithICalEvent: [newContainer event]
andUser: [userContext sogoUser]
andSenderEmail: nil
withConnectionInfo: [context connectionInfo]];
[self addProxy: appointmentWrapper];
}
return self;
}
- (NSDate *) creationTime
{
return [[container event] created];
}
- (NSDate *) lastModificationTime
{
return [[container event] lastModified];
}
- (void) getMessageData: (struct mapistore_message **) dataPtr
inMemCtx: (TALLOC_CTX *) memCtx
{
struct mapistore_message *msgData;
[super getMessageData: &msgData inMemCtx: memCtx];
/* HACK: we know the first (and only) proxy is our appointment wrapper
instance, but this might not always be true */
[[proxies objectAtIndex: 0] fillMessageData: msgData
inMemCtx: memCtx];
*dataPtr = msgData;
}
- (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;
}
- (enum mapistore_error) getPidTagMessageFlags: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, MSGFLAG_UNMODIFIED);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagResponseRequested: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
/* discarded properties */
- (enum mapistore_error) getPidLidAppointmentLastSequence: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidLidMeetingWorkspaceUrl: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidLidContacts: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagSensitivity: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidLidPrivate: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidNameKeywords: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidLidFExceptionalBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (void) save: (TALLOC_CTX *) memCtx
{
// (gdb) po embeddedMessage->properties
// 2442592320 = "2012-07-11 22:30:00 +0000";
// 2448359488 = "2012-07-11 22:30:00 +0000";
// 2442723392 = "2012-07-11 22:30:00 +0000";
// 2442068032 = "2012-07-11 22:30:00 +0000";
// 2441740352 = "2012-07-11 23:00:00 +0000";
// 131083 = 1; 2442330115 = 2;
// 235339779 = 9;
// 6291520 = "2012-07-11 16:00:00 +0000";
// 2442526784 = "2012-07-11 23:00:00 +0000";
// 2818059 = 0;
// 1703967 = "IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}";
// 3538947 = 0;
// 1071513603 = 28591; 805830720 = "2012-07-10 16:42:00 +0000";
// 2485977346 = <02013000 02001500 45006100 73007400
// 65007200 6e002000 53007400 61006e00 64006100 72006400 20005400 69006d00
// 65000200 02013e00 0000d607 00000000 00000000 00000000 00002c01 00000000
// 0000c4ff ffff0000 0a000000 05000200 00000000 00000000 04000000 01000200
// 00000000 00000201 3e000200 d7070000 00000000 00000000 00000000 2c010000
// 00000000 c4ffffff 00000b00 00000100 02000000 00000000 00000300 00000200
// 02000000 00000000>; 2454257728 = "2012-07-11 16:00:00 +0000"; 2442985475 =
// 118330; 1507331 = 1; 805765184 = "2012-07-09 18:32:00 +0000"; 2442657856 =
// "2012-07-11 23:00:00 +0000"; 2443051039 = "11.0"; 236912651 = 1; 2485911810 =
// <02013000 02001500 45006100 73007400 65007200 6e002000 53007400 61006e00
// 64006100 72006400 20005400 69006d00 65000200 02013e00 0000d607 00000000
// 00000000 00000000 00002c01 00000000 0000c4ff ffff0000 0a000000 05000200
// 00000000 00000000 04000000 01000200 00000000 00000201 3e000200 d7070000
// 00000000 00000000 00000000 2c010000 00000000 c4ffffff 00000b00 00000100
// 02000000 00000000 00000300 00000200 02000000 00000000>; 2441543683 = 30;
// 2442068032 = "2012-07-11 22:30:00 +0000";
// 1073348639 = "OpenChange User";
// 806027522 = <2d64f6f5 89a59243 992d29d1 49173b3a>; 6357056 = "2012-07-11
// 16:30:00 +0000";
// */
// // 0x92490040 = 2454257728
// }
SOGoUser *activeUser;
activeUser = [[self context] activeUser];
[[container event] updateFromMAPIProperties: properties
inUserContext: [self userContext]
withActiveUser: activeUser
isNew: NO
inMemCtx: memCtx];
}
@end
@@ -1,32 +0,0 @@
/* MAPIStoreCalendarFolder.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTORECALENDARFOLDER_H
#define MAPISTORECALENDARFOLDER_H
#import "MAPIStoreCalTaskFolder.h"
@interface MAPIStoreCalendarFolder : MAPIStoreCalTaskFolder
@end
#endif /* MAPISTORECALENDARFOLDER_H */
-226
View File
@@ -1,226 +0,0 @@
/* MAPIStoreCalendarFolder.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import <Foundation/NSURL.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSObject+Logs.h>
#import <EOControl/EOQualifier.h>
#import <SOGo/SOGoPermissions.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import <Appointments/SOGoAppointmentFolders.h>
#import <Appointments/SOGoAppointmentObject.h>
#import "MAPIApplication.h"
#import "MAPIStoreCalendarContext.h"
#import "MAPIStoreCalendarMessage.h"
#import "MAPIStoreCalendarMessageTable.h"
#import "MAPIStoreUserContext.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreCalendarFolder.h"
#include <mapistore/mapistore_errors.h>
#include <util/time.h>
#include <gen_ndr/exchange.h>
@implementation MAPIStoreCalendarFolder
- (MAPIStoreMessageTable *) messageTable
{
[self synchroniseCache];
return [MAPIStoreCalendarMessageTable tableForContainer: self];
}
- (NSString *) component
{
return @"vevent";
}
- (MAPIStoreMessage *) createMessage
{
MAPIStoreMessage *newMessage;
SOGoAppointmentObject *newEntry;
NSString *name;
[[self userContext] activate];
name = [NSString stringWithFormat: @"%@.ics",
[SOGoObject globallyUniqueObjectId]];
newEntry = [SOGoAppointmentObject objectWithName: name
inContainer: sogoObject];
[newEntry setIsNew: YES];
newMessage = [MAPIStoreCalendarMessage mapiStoreObjectWithSOGoObject: newEntry
inContainer: self];
return newMessage;
}
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
{
/* Limitations
Following rights are not supported by SOGo specifically:
- CreateSubfolders: No calendar subfolders
- FolderVisible: It is inferred by other rights when extracting
*/
NSMutableArray *roles;
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];
}
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];
if (rights & RightsFreeBusyDetailed)
[roles addObject: SOGoCalendarRole_ConfidentialDAndTViewer];
if (rights & RightsFolderOwner)
[roles addObject: MAPIStoreRightFolderOwner];
if (rights & RightsFolderContact)
[roles addObject: MAPIStoreRightFolderContact];
// [self logWithFormat: @"roles for rights %.8x = (%@)", rights, roles];
return roles;
}
- (uint32_t) exchangeRightsForRoles: (NSArray *) roles
{
uint32_t rights = 0;
if ([roles containsObject: SOGoRole_ObjectCreator])
rights |= RightsCreateItems;
if ([roles containsObject: SOGoRole_ObjectEraser])
rights |= RightsDeleteAll | RightsDeleteOwn;
if ([roles containsObject: SOGoCalendarRole_PublicModifier]
&& [roles containsObject: SOGoCalendarRole_PrivateModifier]
&& [roles containsObject: SOGoCalendarRole_ConfidentialModifier])
rights |= RightsReadItems | RightsEditAll | RightsEditOwn | RightsFreeBusySimple | RightsFreeBusyDetailed;
else if ([roles containsObject: SOGoCalendarRole_PublicViewer]
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
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 |= 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;
}
- (BOOL) subscriberCanReadMessages
{
static NSArray *viewerRoles = nil;
if (!viewerRoles)
viewerRoles = [[NSArray alloc] initWithObjects:
SOGoCalendarRole_PublicViewer,
SOGoCalendarRole_PublicDAndTViewer,
SOGoCalendarRole_PrivateViewer,
SOGoCalendarRole_PrivateDAndTViewer,
SOGoCalendarRole_ConfidentialViewer,
SOGoCalendarRole_ConfidentialDAndTViewer,
nil];
return ([[self activeUserRoles] firstObjectCommonWithArray: viewerRoles]
!= nil);
}
- (BOOL) subscriberCanModifyMessages
{
static NSArray *modifierRoles = nil;
if (!modifierRoles)
modifierRoles = [[NSArray alloc] initWithObjects:
SOGoCalendarRole_PublicModifier,
SOGoCalendarRole_PrivateModifier,
SOGoCalendarRole_ConfidentialModifier,
nil];
return ([[self activeUserRoles] firstObjectCommonWithArray: modifierRoles]
!= nil);
}
- (EOQualifier *) aclQualifier
{
return [EOQualifier qualifierWithQualifierFormat:
[(SOGoAppointmentFolder *) sogoObject aclSQLListingFilter]];
}
- (enum mapistore_error) getPidTagContainerClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPF.Appointment" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Appointment" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
@end
-669
View File
@@ -1,669 +0,0 @@
/* MAPIStoreCalendarMessage.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
/* TODO:
- merge common code with tasks
- take the tz definitions from Outlook */
#include <talloc.h>
#include <util/attr.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSData.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSTimeZone.h>
#import <EOControl/EOQualifier.h>
#import <EOControl/EOFetchSpecification.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSObject+Logs.h>
#import <GDLContentStore/GCSFolder.h>
#import <NGCards/iCalAlarm.h>
#import <NGCards/iCalCalendar.h>
#import <NGCards/iCalEvent.h>
#import <NGCards/iCalDateTime.h>
#import <NGCards/iCalPerson.h>
#import <NGCards/iCalTimeZone.h>
#import <NGCards/iCalTrigger.h>
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserManager.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import <Appointments/SOGoAppointmentObject.h>
#import <Appointments/iCalEntityObject+SOGo.h>
#import <Mailer/NSString+Mail.h>
#import "iCalEvent+MAPIStore.h"
#import "MAPIStoreAppointmentWrapper.h"
#import "MAPIStoreCalendarAttachment.h"
#import "MAPIStoreCalendarFolder.h"
#import "MAPIStoreContext.h"
#import "MAPIStoreMapping.h"
#import "MAPIStoreRecurrenceUtils.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import "NSDate+MAPIStore.h"
#import "NSData+MAPIStore.h"
#import "NSObject+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "NSValue+MAPIStore.h"
#import "MAPIStoreCalendarMessage.h"
#undef DEBUG
#include <stdbool.h>
#include <gen_ndr/exchange.h>
#include <gen_ndr/property.h>
#include <libmapi/libmapi.h>
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
#include <mapistore/mapistore_nameid.h>
// extern void ndr_print_AppointmentRecurrencePattern(struct ndr_print *ndr, const char *name, const struct AppointmentRecurrencePattern *r);
static Class NSArrayK, MAPIStoreAppointmentWrapperK;
@implementation SOGoAppointmentObject (MAPIStoreExtension)
- (Class) mapistoreMessageClass
{
return [MAPIStoreCalendarMessage class];
}
@end
@implementation MAPIStoreCalendarMessage
+ (void) initialize
{
NSArrayK = [NSArray class];
MAPIStoreAppointmentWrapperK = [MAPIStoreAppointmentWrapper class];
}
+ (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) memCtx
{
BOOL listedProperties[65536];
NSUInteger count;
uint16_t propId;
memset (listedProperties, NO, 65536 * sizeof (BOOL));
[super getAvailableProperties: propertiesP inMemCtx: memCtx];
for (count = 0; count < (*propertiesP)->cValues; count++)
{
propId = ((*propertiesP)->aulPropTag[count] >> 16) & 0xffff;
listedProperties[propId] = YES;
}
[MAPIStoreAppointmentWrapper fillAvailableProperties: *propertiesP
withExclusions: listedProperties];
return MAPISTORE_SUCCESS;
}
- (id) init
{
if ((self = [super init]))
{
calendar = nil;
masterEvent = nil;
}
return self;
}
- (void) _setupAttachmentParts
{
NSUInteger count, max;
NSArray *events;
NSString *newKey;
MAPIStoreCalendarAttachment *attachment;
NSUInteger aid;
iCalEvent *event;
events = [calendar events];
max = [events count];
for (count = 1; count < max; count++)
{
attachment = [MAPIStoreCalendarAttachment
mapiStoreObjectInContainer: self];
/* we now that there are no attachments yet, so we can assume that the
right AID is 0 from the start */
aid = count - 1;
[attachment setAID: aid];
event = [events objectAtIndex: count];
[attachment setEvent: event];
newKey = [[event uniqueChildWithTag: @"recurrence-id"]
flattenedValuesForKey: @""];
[attachmentParts setObject: attachment forKey: newKey];
}
}
- (id) initWithSOGoObject: (id) newSOGoObject
inContainer: (MAPIStoreObject *) newFolder
{
MAPIStoreContext *context;
MAPIStoreUserContext *userContext;
iCalCalendar *origCalendar;
MAPIStoreAppointmentWrapper *appointmentWrapper;
if ((self = [super initWithSOGoObject: newSOGoObject
inContainer: newFolder]))
{
if ([newSOGoObject isNew])
{
ASSIGN (calendar, [iCalCalendar groupWithTag: @"vcalendar"]);
[calendar setVersion: @"2.0"];
[calendar setProdID: @"-//Inverse inc.//OpenChange+SOGo//EN"];
masterEvent = [iCalEvent groupWithTag: @"vevent"];
[calendar addChild: masterEvent];
[masterEvent setCreated: [NSCalendarDate date]];
}
else
{
origCalendar = [sogoObject calendar: YES secure: YES];
if (!origCalendar)
{
[self errorWithFormat: @"Incorrect calendar event %@. Empty message is created",
[self url]];
return self;
}
calendar = [origCalendar mutableCopy];
masterEvent = [[calendar events] objectAtIndex: 0];
[self _setupAttachmentParts];
}
context = [self context];
userContext = [self userContext];
appointmentWrapper
= [MAPIStoreAppointmentWrapper wrapperWithICalEvent: masterEvent
andUser: [userContext sogoUser]
andSenderEmail: nil
withConnectionInfo: [context connectionInfo]];
[self addProxy: appointmentWrapper];
}
return self;
}
- (void) dealloc
{
//NSLog(@"MAPIStoreCalendarMessage: -dealloc (%p)", self);
[calendar release];
[super dealloc];
}
- (MAPIStoreAppointmentWrapper *) _appointmentWrapper
{
NSUInteger i, max;
id proxy;
max = [proxies count];
for (i = 0; i < max; i++) {
proxy = [proxies objectAtIndex: i];
if ([proxy isKindOfClass: MAPIStoreAppointmentWrapperK])
{
return proxy;
}
}
return nil;
}
/* getters */
- (enum mapistore_error) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
SOGoUser *owner;
owner = [[self userContext] sogoUser];
if ([masterEvent userAsAttendee: owner])
*data = talloc_strdup (memCtx, "IPM.Schedule.Meeting.Request");
else
*data = talloc_strdup (memCtx, "IPM.Appointment");
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidLidSideEffects: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx,
seOpenToDelete | seOpenToCopy | seOpenToMove
| seCoerceToInbox | seOpenForCtxMenu);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (void) getMessageData: (struct mapistore_message **) dataPtr
inMemCtx: (TALLOC_CTX *) memCtx
{
static NSString *recTypes[] = {@"orig", @"to", @"cc", @"bcc"};
static NSInteger recTypesValue[] = {MAPI_ORIG, MAPI_TO, MAPI_CC, MAPI_BCC};
struct mapistore_message *msgData;
NSDictionary *recipients, *contactInfos;
NSString *email;
NSArray *attendees;
NSDictionary *attendee;
SOGoUserManager *mgr;
struct mapistore_message_recipient *recipient;
NSUInteger nRecType, maxRecTypes, count, max, propCount;
NSObject *currentValue;
[super getMessageData: &msgData inMemCtx: memCtx];
/* The presence of the "recipients" meta-property means that our most recent
list of recipients has not been saved yet and that we must return that
one instead of the one stored in the event. */
recipients = [properties objectForKey: @"recipients"];
if (recipients)
{
mgr = [SOGoUserManager sharedUserManager];
/* TODO: this code might need to be moved into MAPIStoreMessage */
msgData->columns = set_SPropTagArray (msgData, 9,
PR_OBJECT_TYPE,
PR_DISPLAY_TYPE,
PR_7BIT_DISPLAY_NAME_UNICODE,
PR_SMTP_ADDRESS_UNICODE,
PR_SEND_INTERNET_ENCODING,
PR_RECIPIENT_DISPLAY_NAME_UNICODE,
PR_RECIPIENT_FLAGS,
PR_RECIPIENT_ENTRYID,
PR_RECIPIENT_TRACKSTATUS);
maxRecTypes = sizeof(recTypes) / sizeof(recTypes[0]);
for (nRecType = 0; nRecType < maxRecTypes; nRecType++)
{
attendees = [recipients objectForKey: recTypes[nRecType]];
max = [attendees count];
if (max > 0)
{
msgData->recipients_count += max;
msgData->recipients = talloc_realloc(msgData,
msgData->recipients, struct
mapistore_message_recipient, msgData->recipients_count);
recipient = msgData->recipients;
for (count = 0; count < max; count++)
{
attendee = [attendees objectAtIndex: count];
recipient->type = recTypesValue[nRecType];
email = [attendee objectForKey: @"email"];
if (email)
{
contactInfos
= [mgr contactInfosForUserWithUIDorEmail: email];
recipient->username = [[contactInfos
objectForKey: @"c_uid"]
asUnicodeInMemCtx: msgData];
}
else
recipient->username = NULL;
recipient->data = talloc_array(msgData, void *,
msgData->columns->cValues);
for (propCount = 0;
propCount < msgData->columns->cValues;
propCount++)
{
currentValue = [attendee objectForKey: MAPIPropertyKey (msgData->columns->aulPropTag[propCount])];
[currentValue getValue: recipient->data + propCount
forTag: msgData->columns->aulPropTag[propCount]
inMemCtx: msgData];
}
recipient++;
}
}
}
}
else
{
[[self _appointmentWrapper] fillMessageData: msgData
inMemCtx: memCtx];
}
*dataPtr = msgData;
}
- (enum mapistore_error) getPidTagResponseRequested: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
/* This three methods: getPidTagNormalizedSubject,
getPidTagSensitivity and getPidTagImportance are implemented in
MAPIStoreMessage base class, then the proxy method is not reached
(see MAPIStoreObject).
*/
- (enum mapistore_error) getPidTagNormalizedSubject: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
appointmentWrapper = [self _appointmentWrapper];
if (appointmentWrapper)
return [appointmentWrapper getPidTagNormalizedSubject: data inMemCtx: memCtx];
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagSensitivity: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
appointmentWrapper = [self _appointmentWrapper];
if (appointmentWrapper)
return [appointmentWrapper getPidTagSensitivity: data inMemCtx: memCtx];
return [self getLongZero: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
MAPIStoreAppointmentWrapper *appointmentWrapper;
appointmentWrapper = [self _appointmentWrapper];
if (appointmentWrapper)
return [appointmentWrapper getPidTagImportance: data inMemCtx: memCtx];
*data = MAPILongValue (memCtx, 1);
return MAPISTORE_SUCCESS;
}
- (NSString *) _uidFromGlobalObjectId: (TALLOC_CTX *) memCtx
{
NSData *objectId;
NSString *uid = nil;
char *bytesDup, *uidStart;
NSUInteger length;
/* NOTE: we only handle the generic case at the moment, see
MAPIStoreAppointmentWrapper */
objectId = [properties
objectForKey: MAPIPropertyKey (PidLidGlobalObjectId)];
if (objectId)
{
length = [objectId length];
bytesDup = talloc_array (memCtx, char, length + 1);
memcpy (bytesDup, [objectId bytes], length);
bytesDup[length] = 0;
uidStart = bytesDup + length - 1;
while (uidStart != bytesDup && *(uidStart - 1))
uidStart--;
if (uidStart > bytesDup && *uidStart)
uid = [NSString stringWithUTF8String: uidStart];
talloc_free (bytesDup);
}
return uid;
}
- (SOGoAppointmentObject *) _resurrectRecord: (NSString *) cname
fromFolder: (SOGoAppointmentFolder *) folder
{
NSArray *records;
EOQualifier *qualifier;
EOFetchSpecification *fs;
GCSFolder *ocsFolder;
SOGoAppointmentObject *newObject;
NSMutableDictionary *newRecord;
static NSArray *childRecordFields = nil;
if (!childRecordFields)
{
childRecordFields = [NSArray arrayWithObjects: @"c_name",
@"c_creationdate", @"c_lastmodified",
@"c_content", nil];
[childRecordFields retain];
}
ocsFolder = [folder ocsFolder];
qualifier
= [EOQualifier qualifierWithQualifierFormat:
[NSString stringWithFormat: @"c_name='%@'", cname]];
fs = [EOFetchSpecification fetchSpecificationWithEntityName: [ocsFolder folderName]
qualifier: qualifier
sortOrderings: nil];
records = [ocsFolder fetchFields: childRecordFields
fetchSpecification: fs
ignoreDeleted: NO];
if ([records isKindOfClass: NSArrayK] && [records count])
{
newRecord = [[records objectAtIndex: 0] mutableCopy];
[newRecord setObject: [NSNumber numberWithInt: 0]
forKey: @"c_version"];
newObject = [SOGoAppointmentObject objectWithRecord: newRecord
inContainer: folder];
[newRecord autorelease];
[newObject setIsNew: NO];
}
else
newObject = nil;
return newObject;
}
- (void) _fixupAppointmentObjectWithUID: (NSString *) uid
{
NSString *cname, *url;
MAPIStoreMapping *mapping;
uint64_t objectId;
WOContext *woContext;
SOGoAppointmentFolder *folder;
SOGoAppointmentObject *newObject;
cname = [[container sogoObject] resourceNameForEventUID: uid];
if (cname)
isNew = NO;
else
cname = [NSString stringWithFormat: @"%@.ics", uid];
mapping = [self mapping];
url = [NSString stringWithFormat: @"%@%@", [container url], cname];
folder = [sogoObject container];
/* reinstantiate the old sogo object and attach it to self */
[[self userContext] activate];
woContext = [[self userContext] woContext];
if (isNew)
{
/* event could have been deleted, let's try to resurrect it */
newObject = [self _resurrectRecord: cname fromFolder: folder];
if (!newObject)
{
newObject = [SOGoAppointmentObject objectWithName: cname
inContainer: folder];
[newObject setIsNew: YES];
}
}
else
{
/* dissociate the object url from the old object's id */
objectId = [mapping idFromURL: url];
[mapping unregisterURLWithID: objectId];
newObject = [folder lookupName: cname
inContext: woContext
acquire: NO];
}
/* dissociate the object url associated with this object, as we want to
discard it */
objectId = [self objectId];
[mapping unregisterURLWithID: objectId];
/* associate the new object url with this object id */
[mapping registerURL: url withID: objectId];
[newObject setContext: woContext];
ASSIGN (sogoObject, newObject);
}
- (NSUInteger) sensitivity
{
return [[self _appointmentWrapper] sensitivity];
}
- (NSString *) creator
{
return [[self _appointmentWrapper] creator];
}
- (NSString *) owner
{
return [[self _appointmentWrapper] owner];
}
- (void) _updateAttachedEvents
{
NSArray *allAttachments;
NSUInteger count, max;
NSString *uid, *summary;
iCalEvent *event;
MAPIStoreCalendarAttachment *attachment;
/* ensure that all exception events have the same UID as the master */
uid = [masterEvent uid];
summary = [masterEvent summary];
allAttachments = [attachmentParts allValues];
max = [allAttachments count];
for (count = 0; count < max; count++)
{
attachment = [allAttachments objectAtIndex: count];
event = [attachment event];
if ([[event summary] length] == 0)
[event setSummary: summary];
[event setUid: uid];
}
}
- (void) save: (TALLOC_CTX *) memCtx
{
// iCalCalendar *vCalendar;
// NSCalendarDate *now;
NSString *uid, *nameInContainer;
// iCalEvent *newEvent;
// iCalPerson *userPerson;
SOGoUser *activeUser;
NSRange rangeOfDot;
if (isNew)
{
uid = [self _uidFromGlobalObjectId: memCtx];
if (uid)
{
/* Hack required because of what's explained in oxocal 3.1.4.7.1:
basically, Outlook creates a copy of the event and then removes
the old instance. We perform a trickery to avoid performing those
operations in the backend, in a way that enables us to recover
the initial instance and act solely on it. */
[self _fixupAppointmentObjectWithUID: uid];
}
else
{
/* We create a UID from the nameInContainer, or the reverse if the
latter is already set... */
nameInContainer = [sogoObject nameInContainer];
if (nameInContainer)
{
rangeOfDot = [nameInContainer rangeOfString: @"."
options: NSBackwardsSearch];
if (rangeOfDot.location == NSNotFound)
uid = nameInContainer;
else
uid = [nameInContainer substringToIndex: rangeOfDot.location];
}
else
{
uid = [SOGoObject globallyUniqueObjectId];
nameInContainer = [NSString stringWithFormat: @"%@.ics", uid];
[sogoObject setNameInContainer: nameInContainer];
}
}
[masterEvent setUid: uid];
}
// [self logWithFormat: @"-save, event props:"];
// MAPIStoreDumpMessageProperties (newProperties);
// now = [NSCalendarDate date];
activeUser = [[self context] activeUser];
[masterEvent updateFromMAPIProperties: properties
inUserContext: [self userContext]
withActiveUser: activeUser
isNew: isNew
inMemCtx: memCtx];
[self _updateAttachedEvents];
[[self userContext] activate];
[sogoObject updateContentWithCalendar: calendar
fromRequest: nil];
[self updateVersions];
}
- (id) lookupAttachment: (NSString *) childKey
{
return [attachmentParts objectForKey: childKey];
}
- (MAPIStoreAttachment *) createAttachment
{
MAPIStoreCalendarAttachment *newAttachment;
uint32_t newAid;
NSString *newKey;
iCalEvent *newEvent;
newAid = [[self attachmentKeys] count];
newAttachment = [MAPIStoreCalendarAttachment
mapiStoreObjectInContainer: self];
[newAttachment setAID: newAid];
newEvent = [iCalEvent groupWithTag: @"vevent"];
[newAttachment setEvent: newEvent];
[calendar addToEvents: newEvent];
newKey = [NSString stringWithFormat: @"%ul", newAid];
[attachmentParts setObject: newAttachment
forKey: newKey];
[attachmentKeys release];
attachmentKeys = nil;
return newAttachment;
}
- (enum mapistore_error) setReadFlag: (uint8_t) flag
{
return MAPISTORE_SUCCESS;
}
@end
@@ -1,32 +0,0 @@
/* MAPIStoreCalendarMessageTable.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTORECALENDARMESSAGETABLE_H
#define MAPISTORECALENDARMESSAGETABLE_H
#import "MAPIStoreGCSMessageTable.h"
@interface MAPIStoreCalendarMessageTable : MAPIStoreGCSMessageTable
@end
#endif /* MAPISTORECALENDARMESSAGETABLE_H */
@@ -1,193 +0,0 @@
/* MAPIStoreCalendarMessageTable.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSDictionary.h>
#import <Foundation/NSNull.h>
#import <Foundation/NSString.h>
#import <EOControl/EOQualifier.h>
#import <NGCards/iCalEvent.h>
#import "MAPIStoreCalendarMessage.h"
#import "MAPIStoreTypes.h"
#import "NSDate+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreCalendarMessageTable.h"
#include <mapistore/mapistore_nameid.h>
static Class MAPIStoreCalendarMessageK = Nil;
@implementation MAPIStoreCalendarMessageTable
+ (void) initialize
{
MAPIStoreCalendarMessageK = [MAPIStoreCalendarMessage class];
}
+ (Class) childObjectClass
{
return MAPIStoreCalendarMessageK;
}
- (EOQualifier *) _orgMailNotNullQualifier
{
static EOQualifier *orgMailQualifier = nil;
EOQualifier *notNullQualifier, *nullQualifier, *notEmptyQualifier, *emptyQualifier;
if (!orgMailQualifier)
{
nullQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_orgmail"
operatorSelector: EOQualifierOperatorEqual
value: [NSNull null]];
notNullQualifier = [[EONotQualifier alloc]
initWithQualifier: nullQualifier];
emptyQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_orgmail"
operatorSelector: EOQualifierOperatorEqual
value: @""];
notEmptyQualifier = [[EONotQualifier alloc]
initWithQualifier: emptyQualifier];
orgMailQualifier = [[EOAndQualifier alloc]
initWithQualifiers: notNullQualifier,
notEmptyQualifier, nil];
[nullQualifier release];
[notNullQualifier release];
[emptyQualifier release];
[notEmptyQualifier release];
}
return orgMailQualifier;
}
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
id value;
NSMutableString *likeString;
NSString *likePartString;
EOAndQualifier *andQualifier, *stringQualifier;
union {
uint32_t longValue;
char charValue[4];
} apptIdValue;
value = NSObjectFromMAPISPropValue (&res->lpProp);
switch ((uint32_t) res->ulPropTag)
{
case PR_MESSAGE_CLASS_UNICODE:
if ([value isEqualToString: @"IPM.Appointment"])
rc = MAPIRestrictionStateAlwaysTrue;
else
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PR_OWNER_APPT_ID:
// c_orgmail != NULL && c_orgmail != '' && c_uid like 'ab%89';
apptIdValue.longValue = [value unsignedLongValue];
likeString = [NSMutableString string];
likePartString = [[NSString alloc]
initWithBytes: apptIdValue.charValue
length: 2
encoding: NSISOLatin1StringEncoding];
[likeString appendString: likePartString];
[likePartString release];
[likeString appendString: @"%%"];
likePartString = [[NSString alloc]
initWithBytes: apptIdValue.charValue + 2
length: 2
encoding: NSISOLatin1StringEncoding];
[likeString appendString: likePartString];
[likePartString release];
stringQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_uid"
operatorSelector: EOQualifierOperatorLike
value: likeString];
andQualifier = [[EOAndQualifier alloc]
initWithQualifiers: [self _orgMailNotNullQualifier],
stringQualifier, nil];
[andQualifier autorelease];
[stringQualifier release];
*qualifier = andQualifier;
rc = MAPIRestrictionStateNeedsEval;
break;
case PidLidBusyStatus:
rc = MAPIRestrictionStateAlwaysTrue; // should be based on c_isopaque
break;
default:
rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier];
}
return rc;
}
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
static NSMutableDictionary *knownProperties = nil;
if (!knownProperties)
{
knownProperties = [NSMutableDictionary new];
[knownProperties setObject: @"c_startdate"
forKey: MAPIPropertyKey (PidLidAppointmentStartWhole)];
[knownProperties setObject: @"c_enddate"
forKey: MAPIPropertyKey (PidLidAppointmentEndWhole)];
[knownProperties setObject: @"c_iscycle"
forKey: MAPIPropertyKey (PidLidRecurring)];
}
return [knownProperties objectForKey: MAPIPropertyKey (property)];
}
/* sorting */
- (NSString *) sortIdentifierForProperty: (enum MAPITAGS) property
{
static NSMutableDictionary *knownProperties = nil;
if (!knownProperties)
{
knownProperties = [NSMutableDictionary new];
[knownProperties setObject: @"c_startdate"
forKey: MAPIPropertyKey (PidLidAppointmentStartWhole)];
[knownProperties setObject: @"c_enddate"
forKey: MAPIPropertyKey (PidLidAppointmentEndWhole)];
[knownProperties setObject: @"c_iscycle"
forKey: MAPIPropertyKey (PidLidRecurring)];
[knownProperties setObject: @"c_isallday"
forKey: MAPIPropertyKey (PidLidAppointmentSubType)];
[knownProperties setObject: @"c_creationdate"
forKey: MAPIPropertyKey (PR_CREATION_TIME)];
[knownProperties setObject: @"c_uid"
forKey: MAPIPropertyKey (PR_OWNER_APPT_ID)];
/* Use by oxcfxics to sort the latest first */
[knownProperties setObject: @"c_lastmodified"
forKey: MAPIPropertyKey (PidTagMessageDeliveryTime)];
}
return [knownProperties objectForKey: MAPIPropertyKey (property)];
}
@end
@@ -1,41 +0,0 @@
/* MAPIStoreContactsAttachment.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTORECONTACTSATTACHMENT_H
#define MAPISTORECONTACTSATTACHMENT_H
#import "MAPIStoreAttachment.h"
@class NSData;
@class NGVCardPhoto;
@interface MAPIStoreContactsAttachment : MAPIStoreAttachment
{
NGVCardPhoto *photo;
NSData *photoData;
}
- (void) setPhoto: (NGVCardPhoto *) newPhoto;
@end
#endif /* MAPISTORECONTACTSATTACHMENT_H */
@@ -1,197 +0,0 @@
/* MAPIStoreContactsAttachment.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSCalendarDate.h>
#import <Foundation/NSString.h>
#import <NGExtensions/NGBase64Coding.h>
#import <NGCards/NGVCardPhoto.h>
#import "MAPIStoreTypes.h"
#import "NSData+MAPIStore.h"
#import "NSDate+MAPIStore.h"
#import "NSObject+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreContactsAttachment.h"
#include <mapistore/mapistore_errors.h>
/* TODO: handle URL pictures via PidTagAttachMethod = ref ? */
@implementation MAPIStoreContactsAttachment
- (id) init
{
if ((self = [super init]))
{
photo = nil;
photoData = nil;
}
return self;
}
- (void) dealloc
{
[photo release];
[photoData release];
[super dealloc];
}
- (void) setPhoto: (NGVCardPhoto *) newPhoto
{
ASSIGN (photo, newPhoto);
}
- (NSString *) fileExtension
{
NSString *type, *extension;
type = [photo type];
if ([type isEqualToString: @"JPEG"]
|| [type isEqualToString: @"JPG"])
extension = @".jpg";
else if ([type isEqualToString: @"PNG"])
extension = @".png";
else if ([type isEqualToString: @"BMP"])
extension = @".bmp";
else if ([type isEqualToString: @"GIF"])
extension = @".gif";
else
extension = nil;
return extension;
}
- (NSDate *) creationTime
{
return [container creationTime];
}
- (NSDate *) lastModificationTime
{
return [container lastModificationTime];
}
- (enum mapistore_error) getPidTagAttachEncoding: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
{
*data = [[NSData data] asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagAttachmentHidden: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00000001);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagAttachDataBinary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!photoData)
ASSIGN (photoData,
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
*data = [photoData asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachSize: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!photoData)
ASSIGN (photoData,
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
*data = MAPILongValue (memCtx, [photoData length]);
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachExtension: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self fileExtension] asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachLongFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *filename;
filename = [NSString stringWithFormat: @"ContactPhoto%@",
[self fileExtension]];
*data = [filename asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagAttachLongFilename: data
inMemCtx: memCtx];
}
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagAttachLongFilename: data inMemCtx: memCtx];
}
@end
@@ -1,32 +0,0 @@
/* MAPIStoreContactsContext.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTORECONTACTSCONTEXT_H
#define MAPISTORECONTACTSCONTEXT_H
#import "MAPIStoreGCSBaseContext.h"
@interface MAPIStoreContactsContext : MAPIStoreGCSBaseContext
@end
#endif /* MAPISTORECONTACTSCONTEXT_H */
@@ -1,59 +0,0 @@
/* MAPIStoreContactsContext.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import <Contacts/SOGoContactFolders.h>
#import "MAPIStoreContactsFolder.h"
#import "MAPIStoreUserContext.h"
#import "MAPIStoreContactsContext.h"
#undef DEBUG
#include <mapistore/mapistore.h>
static Class MAPIStoreContactsFolderK;
@implementation MAPIStoreContactsContext
+ (void) initialize
{
MAPIStoreContactsFolderK = [MAPIStoreContactsFolder class];
}
+ (NSString *) MAPIModuleName
{
return @"contacts";
}
+ (enum mapistore_context_role) MAPIContextRole
{
return MAPISTORE_CONTACTS_ROLE;
}
- (Class) MAPIStoreFolderClass
{
return MAPIStoreContactsFolderK;
}
@end
@@ -1,32 +0,0 @@
/* MAPIStoreContactsFolder.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTORECONTACTSFOLDER_H
#define MAPISTORECONTACTSFOLDER_H
#import "MAPIStoreGCSFolder.h"
@interface MAPIStoreContactsFolder : MAPIStoreGCSFolder
@end
#endif /* MAPISTORECONTACTSFOLDER_H */
-157
View File
@@ -1,157 +0,0 @@
/* MAPIStoreContactsFolder.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSURL.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <EOControl/EOQualifier.h>
#import <SOGo/SOGoPermissions.h>
#import <Contacts/SOGoContactGCSEntry.h>
#import <Contacts/SOGoContactFolders.h>
#import "MAPIApplication.h"
#import "MAPIStoreUserContext.h"
#import "MAPIStoreContactsContext.h"
#import "MAPIStoreContactsMessage.h"
#import "MAPIStoreContactsMessageTable.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreContactsFolder.h"
#include <util/time.h>
#include <gen_ndr/exchange.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreContactsFolder
- (MAPIStoreMessageTable *) messageTable
{
[self synchroniseCache];
return [MAPIStoreContactsMessageTable tableForContainer: self];
}
- (NSString *) component
{
return @"vcard";
}
- (MAPIStoreMessage *) createMessage
{
MAPIStoreMessage *newMessage;
SOGoContactGCSEntry *newEntry;
NSString *name;
[[self userContext] activate];
name = [NSString stringWithFormat: @"%@.vcf",
[SOGoObject globallyUniqueObjectId]];
newEntry = [SOGoContactGCSEntry objectWithName: name
inContainer: sogoObject];
[newEntry setIsNew: YES];
newMessage = [MAPIStoreContactsMessage mapiStoreObjectWithSOGoObject: newEntry
inContainer: self];
return newMessage;
}
- (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: 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;
}
- (uint32_t) exchangeRightsForRoles: (NSArray *) roles
{
uint32_t rights = 0;
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;
}
- (BOOL) subscriberCanModifyMessages
{
return [[self activeUserRoles] containsObject: SOGoRole_ObjectEditor];
}
- (BOOL) subscriberCanReadMessages
{
return [[self activeUserRoles] containsObject: SOGoRole_ObjectViewer];
}
- (enum mapistore_error) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Contact" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
@end
File diff suppressed because it is too large. Load diff
@@ -1,31 +0,0 @@
/* MAPIStoreContactsMessageTable.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTORECONTACTSMESSAGETABLE_H
#define MAPISTORECONTACTSMESSAGETABLE_H
#import "MAPIStoreGCSMessageTable.h"
@interface MAPIStoreContactsMessageTable : MAPIStoreGCSMessageTable
@end
#endif /* MAPISTORECONTACTSMESSAGETABLE_H */
@@ -1,231 +0,0 @@
/* MAPIStoreContactsMessageTable.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSData.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSString.h>
#import <EOControl/EOQualifier.h>
#import <NGMail/NGMailAddress.h>
#import <NGMail/NGMailAddressParser.h>
#import <NGCards/NSArray+NGCards.h>
#import <NGCards/NGVCard.h>
#import <Contacts/SOGoContactGCSEntry.h>
#import "MAPIStoreContactsMessage.h"
#import "MAPIStoreTypes.h"
#import "NSDate+MAPIStore.h"
#import "NSArray+MAPIStore.h"
#import "NSData+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreContactsMessageTable.h"
#include <mapistore/mapistore_nameid.h>
static Class MAPIStoreContactsMessageK, NGMailAddressK, NSDataK, NSStringK;
@implementation MAPIStoreContactsMessageTable
+ (void) initialize
{
MAPIStoreContactsMessageK = [MAPIStoreContactsMessage class];
NSDataK = [NSData class];
NSStringK = [NSString class];
NGMailAddressK = [NGMailAddress class];
}
+ (Class) childObjectClass
{
return MAPIStoreContactsMessageK;
}
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
static NSMutableDictionary *knownProperties = nil;
if (!knownProperties)
{
knownProperties = [NSMutableDictionary new];
[knownProperties setObject: @"c_mail"
forKey: MAPIPropertyKey (PidLidEmail1EmailAddress)];
[knownProperties setObject: @"c_mail"
forKey: MAPIPropertyKey (PidLidEmail2EmailAddress)];
[knownProperties setObject: @"c_mail"
forKey: MAPIPropertyKey (PidLidEmail3EmailAddress)];
[knownProperties setObject: @"c_cn"
forKey: MAPIPropertyKey (PidLidFileUnder)];
[knownProperties setObject: @"c_cn"
forKey: MAPIPropertyKey (PidTagDisplayName)];
[knownProperties setObject: @"c_cn"
forKey: MAPIPropertyKey (PidTagSubject)];
}
return [knownProperties objectForKey: MAPIPropertyKey (property)];
}
/* restrictions */
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
EOAndQualifier *andQualifier;
EOKeyValueQualifier *fullNameQualifier, *emailQualifier;
NSString *fullName, *email;
SEL operator;
id value, ngAddress;
value = NSObjectFromMAPISPropValue (&res->lpProp);
switch ((uint32_t) res->ulPropTag)
{
case PR_MESSAGE_CLASS_UNICODE:
if ([value isEqualToString: @"IPM.Contact"])
rc = MAPIRestrictionStateAlwaysTrue;
else
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PR_SENSITIVITY:
rc = MAPIRestrictionStateAlwaysTrue;
break;
case PidLidAddressBookProviderArrayType:
case PidLidAddressBookProviderEmailList:
/* FIXME: this is a hack. We should return a real qualifier here */
rc = MAPIRestrictionStateAlwaysTrue;
break;
case PidLidEmail1OriginalDisplayName:
case PidLidEmail2OriginalDisplayName:
case PidLidEmail3OriginalDisplayName:
rc = MAPIRestrictionStateAlwaysFalse;
value = NSObjectFromMAPISPropValue (&res->lpProp);
if (value && [value isKindOfClass: NSStringK])
{
rc = MAPIRestrictionStateNeedsEval;
ngAddress = [[NGMailAddressParser mailAddressParserWithString: value]
parse];
if ([ngAddress isKindOfClass: NGMailAddressK])
{
operator = [self operatorFromRestrictionOperator: res->relop];
fullName = [ngAddress displayName];
email = [ngAddress address];
emailQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_mail"
operatorSelector: operator
value: email];
if ([fullName length] > 0)
{
fullNameQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_cn"
operatorSelector: operator
value: fullName];
andQualifier = [[EOAndQualifier alloc]
initWithQualifiers:
emailQualifier, fullNameQualifier, nil];
[fullNameQualifier release];
[emailQualifier release];
*qualifier = andQualifier;
}
else
*qualifier = emailQualifier;
[*qualifier autorelease];
}
}
break;
case PidLidEmail1AddressType:
case PidLidEmail2AddressType:
case PidLidEmail3AddressType:
if ([value isEqualToString: @"SMTP"])
rc = MAPIRestrictionStateAlwaysTrue;
else
rc = MAPIRestrictionStateAlwaysFalse;
break;
default:
rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier];
}
return rc;
}
- (MAPIRestrictionState) evaluateContentRestriction: (struct mapi_SContentRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
id value;
value = NSObjectFromMAPISPropValue (&res->lpProp);
if ([value isKindOfClass: NSDataK])
{
value = [[NSString alloc] initWithData: value
encoding: NSUTF8StringEncoding];
[value autorelease];
}
else if (![value isKindOfClass: NSStringK])
[NSException raise: @"MAPIStoreTypeConversionException"
format: @"unhandled content restriction for class '%@'",
NSStringFromClass ([value class])];
switch (res->ulPropTag)
{
case PR_MESSAGE_CLASS_UNICODE: /* FIXME: should make use of c_component here */
if ([value isEqualToString: @"IPM.Contact"])
rc = MAPIRestrictionStateAlwaysTrue;
else
rc = MAPIRestrictionStateAlwaysFalse;
break;
default:
rc = [super evaluateContentRestriction: res intoQualifier: qualifier];
}
return rc;
}
/* sorting */
- (NSString *) sortIdentifierForProperty: (enum MAPITAGS) property
{
static NSMutableDictionary *knownProperties = nil;
if (!knownProperties)
{
knownProperties = [NSMutableDictionary new];
[knownProperties setObject: @"c_cn"
forKey: MAPIPropertyKey (PidLidFileUnder)];
[knownProperties setObject: @"c_cn"
forKey: MAPIPropertyKey (PidTagDisplayName)];
[knownProperties setObject: @"c_cn"
forKey: MAPIPropertyKey (PidTagSubject)];
[knownProperties setObject: @"c_cn"
forKey: MAPIPropertyKey (PidTagNormalizedSubject)];
/* Use by oxcfxics to sort the latest first */
[knownProperties setObject: @"c_lastmodified"
forKey: MAPIPropertyKey (PidTagMessageDeliveryTime)];
}
return [knownProperties objectForKey: MAPIPropertyKey (property)];
}
@end
-125
View File
@@ -1,125 +0,0 @@
/* MAPIStoreContext.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTORECONTEXT_H
#define MAPISTORECONTEXT_H
#include <talloc.h>
#import <Foundation/NSObject.h>
@class NSArray;
@class NSFileHandle;
@class NSMutableArray;
@class NSMutableDictionary;
@class NSString;
@class NSURL;
@class EOQualifier;
@class WOContext;
@class SOGoFolder;
@class SOGoMAPIFSFolder;
@class SOGoObject;
@class SOGoUser;
@class MAPIStoreAuthenticator;
@class MAPIStoreAttachment;
@class MAPIStoreAttachmentTable;
@class MAPIStoreFolder;
@class MAPIStoreMessage;
@class MAPIStoreTable;
@class MAPIStoreUserContext;
@interface MAPIStoreContext : NSObject
{
struct mapistore_connection_info *connInfo;
NSMutableArray *containersBag;
SOGoUser *activeUser; /* the user accessing the resource */
MAPIStoreUserContext *userContext; /* the owner or the resource */
NSURL *contextUrl;
}
+ (struct mapistore_contexts_list *) listAllContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx;
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx;
+ (enum mapistore_error) createRootFolder: (NSString **) mapistoreUriP
withFID: (uint64_t ) fid
andName: (NSString *) folderName
forUser: (NSString *) username
withRole: (enum mapistore_context_role) role;
+ (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
andTDBIndexing: (struct indexing_context *) indexing;
- (NSURL *) url;
- (struct mapistore_connection_info *) connectionInfo;
- (MAPIStoreUserContext *) userContext;
- (SOGoUser *) activeUser;
// - (id) lookupObject: (NSString *) objectURLString;
/* backend methods */
- (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
andFolderURLAt: (NSString **) folderURL;
- (uint64_t) idForObjectWithKey: (NSString *) key
inFolderURL: (NSString *) folderURL;
- (NSArray *) getNewFMIDs: (uint64_t) max;
- (uint64_t) getNewChangeNumber;
- (NSArray *) getNewChangeNumbers: (uint64_t) max;
/* subclass methods */
+ (NSString *) MAPIModuleName;
+ (enum mapistore_context_role) MAPIContextRole;
+ (NSString *)
createRootSecondaryFolderWithFID: (uint64_t) fid
andName: (NSString *) folderName
forUser: (NSString *) userName;
- (Class) MAPIStoreFolderClass;
/* the top-most parent of the context folder: SOGoMailAccount,
SOGoCalendarFolders, ... */
- (id) rootSOGoFolder;
@end
#endif /* MAPISTORECONTEXT_H */
-644
View File
@@ -1,644 +0,0 @@
/* MAPIStoreContext.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSNull.h>
#import <Foundation/NSURL.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NSObject+Values.h>
#import <SOGo/SOGoFolder.h>
#import <SOGo/SOGoUser.h>
#import "MAPIStoreAttachment.h"
#import "MAPIStoreFallbackContext.h"
#import "MAPIStoreFolder.h"
#import "MAPIStoreFolderTable.h"
#import "MAPIStoreMapping.h"
#import "MAPIStoreMessage.h"
#import "MAPIStoreMessageTable.h"
#import "MAPIStoreFAIMessage.h"
#import "MAPIStoreFAIMessageTable.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import "NSArray+MAPIStore.h"
#import "NSObject+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreContext.h"
#undef DEBUG
#include <dlinklist.h>
#include <stdbool.h>
#include <gen_ndr/exchange.h>
#include <util/attr.h>
#include <libmapiproxy.h>
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
#include <mapistore/mapistore_nameid.h>
#include <talloc.h>
/* TODO: homogenize method names and order of parameters */
@implementation MAPIStoreContext : NSObject
/* sogo://username:password@{contacts,calendar,tasks,journal,notes,mail}/dossier/id */
static Class NSExceptionK, MAPIStoreFallbackContextK, SOGoObjectK;
static NSMutableDictionary *contextClassMapping;
+ (void) initialize
{
NSArray *classes;
Class currentClass;
NSUInteger count, max;
NSString *moduleName;
NSExceptionK = [NSException class];
SOGoObjectK = [SOGoObject class];
contextClassMapping = [NSMutableDictionary new];
classes = GSObjCAllSubclassesOfClass (self);
max = [classes count];
for (count = 0; count < max; count++)
{
currentClass = [classes objectAtIndex: count];
moduleName = [currentClass MAPIModuleName];
if (moduleName)
{
[contextClassMapping setObject: currentClass
forKey: moduleName];
NSLog (@" registered class '%@' as handler of '%@' contexts",
NSStringFromClass (currentClass), moduleName);
}
}
MAPIStoreFallbackContextK = [MAPIStoreFallbackContext class];
}
+ (struct mapistore_contexts_list *) listAllContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx
{
struct mapistore_contexts_list *list, *current;
NSArray *classes;
Class currentClass;
NSUInteger count, max;
list = NULL;
// User context is activated on initialization
[MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: indexing];
classes = GSObjCAllSubclassesOfClass (self);
max = [classes count];
for (count = 0; count < max; count++)
{
currentClass = [classes objectAtIndex: count];
current = [currentClass listContextsForUser: userName
withIndexing: indexing
inMemCtx: memCtx];
if (current)
DLIST_CONCATENATE(list, current, void);
}
return list;
}
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx
{
return NULL;
}
static Class
MAPIStoreLookupContextClassByRole (Class self, enum mapistore_context_role role)
{
static NSMutableDictionary *classMapping = nil;
Class currentClass;
enum mapistore_context_role classRole;
NSNumber *roleNbr;
NSArray *classes;
NSUInteger count, max;
if (!classMapping)
{
classMapping = [NSMutableDictionary new];
classes = GSObjCAllSubclassesOfClass (self);
max = [classes count];
for (count = 0; count < max; count++)
{
currentClass = [classes objectAtIndex: count];
classRole = [currentClass MAPIContextRole];
if (classRole != -1)
{
roleNbr = [NSNumber numberWithUnsignedInt: classRole];
[classMapping setObject: currentClass
forKey: roleNbr];
}
}
}
roleNbr = [NSNumber numberWithUnsignedInt: role];
return [classMapping objectForKey: roleNbr];
}
+ (enum mapistore_error) createRootFolder: (NSString **) mapistoreUriP
withFID: (uint64_t) fid
andName: (NSString *) folderName
forUser: (NSString *) userName
withRole: (enum mapistore_context_role) role
{
Class contextClass;
NSString *mapistoreURI;
enum mapistore_error rc = MAPISTORE_SUCCESS;
contextClass = MAPIStoreLookupContextClassByRole (self, role);
if (!contextClass)
contextClass = MAPIStoreFallbackContextK;
mapistoreURI = [contextClass createRootSecondaryFolderWithFID: fid
andName: folderName
forUser: userName];
if (!mapistoreURI && contextClass != MAPIStoreFallbackContextK)
mapistoreURI = [MAPIStoreFallbackContextK createRootSecondaryFolderWithFID: fid
andName: folderName
forUser: userName];
if (mapistoreURI)
*mapistoreUriP = mapistoreURI;
else
rc = MAPISTORE_ERR_NOT_FOUND;
return rc;
}
static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
{
NSString *urlString;
NSURL *completeURL;
urlString = [NSString stringWithFormat: @"sogo://%@",
[NSString stringWithUTF8String: uri]];
if (![urlString hasSuffix: @"/"])
urlString = [urlString stringByAppendingString: @"/"];
completeURL = [NSURL URLWithString: urlString];
return completeURL;
}
+ (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;
enum mapistore_error rc = MAPISTORE_ERR_NOT_FOUND;
context = nil;
baseURL = CompleteURLFromMapistoreURI (newUri);
if (baseURL)
{
module = [baseURL host];
if (module)
{
contextClass = [contextClassMapping objectForKey: module];
if (contextClass)
{
context = [[contextClass alloc] initFromURL: baseURL
withConnectionInfo: newConnInfo
andTDBIndexing: indexing];
if (context)
{
[context autorelease];
rc = MAPISTORE_SUCCESS;
*contextPtr = context;
}
}
else
NSLog (@"ERROR: unrecognized module name '%@'", module);
}
}
else
NSLog (@"ERROR: url could not be parsed");
return rc;
}
- (id) init
{
if ((self = [super init]))
{
activeUser = nil;
userContext = nil;
contextUrl = nil;
containersBag = [NSMutableArray new];
}
return self;
}
- (id) initFromURL: (NSURL *) newUrl
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo
andTDBIndexing: (struct indexing_context *) indexing
{
NSString *username;
if (newConnInfo == NULL)
{
return nil;
}
if ((self = [self init]))
{
ASSIGN (contextUrl, newUrl);
username = [newUrl user];
if ([username length] == 0)
{
[self errorWithFormat:
@"attempt to instantiate a context with an empty owner"];
[self release];
return nil;
}
ASSIGN (userContext,
[MAPIStoreUserContext userContextWithUsername: username
andTDBIndexing: indexing]);
connInfo = newConnInfo;
username = [NSString stringWithUTF8String: newConnInfo->username];
ASSIGN (activeUser, [SOGoUser userWithLogin: username]);
if (!activeUser)
{
[self errorWithFormat: @"user '%@' not found in SOGo environment",
username];
[self release];
return nil;
}
}
return self;
}
- (void) dealloc
{
[contextUrl release];
[userContext release];
[containersBag release];
[super dealloc];
}
- (MAPIStoreUserContext *) userContext
{
return userContext;
}
- (NSURL *) url
{
return contextUrl;
}
- (struct mapistore_connection_info *) connectionInfo
{
return connInfo;
}
- (SOGoUser *) activeUser
{
return activeUser;
}
- (enum mapistore_error) getPath: (char **) path
ofFMID: (uint64_t) fmid
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc;
NSString *objectURL, *url;
url = [contextUrl absoluteString];
// FIXME transform percent escapes but not for user part of the url
//[xxxx stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
objectURL = [[userContext mapping] urlFromID: fmid];
if (objectURL)
{
if ([objectURL hasPrefix: url])
{
*path = [[objectURL substringFromIndex: 7] asUnicodeInMemCtx: memCtx];
[self logWithFormat: @"found path '%s' for fmid 0x%.16"PRIx64"", *path, fmid];
rc = MAPISTORE_SUCCESS;
}
else
{
[self logWithFormat: @"context (%@, %@) does not contain "
@"found fmid: 0x%.16"PRIx64"", objectURL, url, fmid];
*path = NULL;
rc = MAPISTORE_SUCCESS;
}
}
else
{
[self errorWithFormat: @"%s: you should *never* get here", __PRETTY_FUNCTION__];
*path = NULL;
rc = MAPISTORE_SUCCESS;
}
return rc;
}
- (void) ensureContextFolder
{
}
- (enum mapistore_error) getRootFolder: (MAPIStoreFolder **) folderPtr
withFID: (uint64_t) newFid
{
enum mapistore_error rc;
MAPIStoreFolder *baseFolder;
SOGoFolder *currentFolder;
WOContext *woContext;
NSString *path;
NSArray *pathComponents;
NSUInteger count, max;
[userContext activate];
woContext = [userContext woContext];
[self ensureContextFolder];
currentFolder = [self rootSOGoFolder];
[containersBag addObject: currentFolder];
/* HACK:
-[NSURL path] returns unescaped strings in theory. In pratice, sometimes
it does, sometimes not. Therefore we use the result of our own
implementation of -[NSString
stringByReplacingPercentEscapeUsingEncoding:], which returns nil if the
original string contains non-ascii chars, from which we can determine
whether the path was unescaped or not. */
path = [[contextUrl path]
stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
if (!path)
path = [contextUrl path];
if ([path hasPrefix: @"/"])
path = [path substringFromIndex: 1];
if ([path hasSuffix: @"/"])
path = [path substringToIndex: [path length] - 1];
if ([path length] > 0)
{
pathComponents = [path componentsSeparatedByString: @"/"];
max = [pathComponents count];
for (count = 0; currentFolder && count < max; count++)
{
[woContext setClientObject: currentFolder];
currentFolder = [currentFolder
lookupName: [pathComponents objectAtIndex: count]
inContext: woContext
acquire: NO];
if ([currentFolder isKindOfClass: SOGoObjectK]) /* class common to all
SOGo folder types */
[containersBag addObject: currentFolder];
else
currentFolder = nil;
}
}
if (currentFolder)
{
baseFolder = [[self MAPIStoreFolderClass]
mapiStoreObjectWithSOGoObject: currentFolder
inContainer: nil];
[baseFolder setContext: self];
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;
else
rc = MAPISTORE_ERR_DENIED;
return rc;
}
/* utils */
- (NSString *) extractChildNameFromURL: (NSString *) objectURL
andFolderURLAt: (NSString **) folderURL;
{
NSString *childKey;
NSRange lastSlash;
NSUInteger slashPtr;
if ([objectURL hasSuffix: @"/"])
objectURL = [objectURL substringToIndex: [objectURL length] - 2];
lastSlash = [objectURL rangeOfString: @"/"
options: NSBackwardsSearch];
if (lastSlash.location != NSNotFound)
{
slashPtr = NSMaxRange (lastSlash);
childKey = [objectURL substringFromIndex: slashPtr];
if ([childKey length] == 0)
childKey = nil;
if (folderURL)
*folderURL = [objectURL substringToIndex: slashPtr];
}
else
childKey = nil;
return childKey;
}
- (uint64_t) idForObjectWithKey: (NSString *) key
inFolderURL: (NSString *) folderURL
{
NSString *childURL;
MAPIStoreMapping *mapping;
uint64_t mappingId;
enum mapistore_error ret;
if (key)
childURL = [NSString stringWithFormat: @"%@%@", folderURL,
[key stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];
else
childURL = folderURL;
mapping = [userContext mapping];
mappingId = [mapping idFromURL: childURL];
if (mappingId == NSNotFound)
{
const char *owner;
[self logWithFormat: @"No id exist yet for '%@', requesting one", childURL];
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
[self errorWithFormat: @"Error trying to get new folder id (%d): %s",
ret, mapistore_errstr (ret)];
}
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;
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_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)];
}
for (count = 0; count < max; count++)
{
newNumber = [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
[newChangeNumbers addObject: newNumber];
}
talloc_free (memCtx);
return newChangeNumbers;
}
/* Get new fmids from mapistore_indexing interface using resource's
owner user */
- (NSArray *) getNewFMIDs: (uint64_t) max
{
const char *owner;
enum mapistore_error ret;
NSMutableArray *newFMIDs;
NSString *newNumber;
uint64_t count, newFID;
newFMIDs = [NSMutableArray arrayWithCapacity: max];
/* Get the resource's owner name */
owner = [[userContext username] UTF8String];
for (count = 0; count < max; 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];
}
return newFMIDs;
}
/* subclasses */
+ (NSString *) MAPIModuleName
{
[self subclassResponsibility: _cmd];
return nil;
}
+ (enum mapistore_context_role) MAPIContextRole
{
return -1;
}
+ (NSString *)
createRootSecondaryFolderWithFID: (uint64_t) fid
andName: (NSString *) folderName
forUser: (NSString *) userName
{
[self subclassResponsibility: _cmd];
return nil;
}
- (Class) MAPIStoreFolderClass
{
[self subclassResponsibility: _cmd];
return nil;
}
- (id) rootSOGoFolder
{
[self subclassResponsibility: _cmd];
return nil;
}
@end
-32
View File
@@ -1,32 +0,0 @@
/* MAPIStoreDBBaseContext.h - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREDBBASECONTEXT_H
#define MAPISTOREDBBASECONTEXT_H
#import "MAPIStoreContext.h"
@interface MAPIStoreDBBaseContext : MAPIStoreContext
@end
#endif /* MAPISTOREDBBASECONTEXT_H */
-114
View File
@@ -1,114 +0,0 @@
/* MAPIStoreDBBaseContext.m - this file is part of SOGo
*
* Copyright (C) 2012-2014 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
* 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.
*/
/* A generic parent class for all context that will store their data on the
disk in the form of a plist. */
#import <Foundation/NSArray.h>
#import <Foundation/NSString.h>
#import <Foundation/NSURL.h>
#import <NGExtensions/NSObject+Logs.h>
#import "MAPIStoreDBFolder.h"
#import "MAPIStoreMapping.h"
#import "MAPIStoreUserContext.h"
#import <SOGo/SOGoCacheGCSFolder.h>
#import "MAPIStoreDBBaseContext.h"
#undef DEBUG
#include <mapistore/mapistore.h>
static Class MAPIStoreDBFolderK;
@implementation MAPIStoreDBBaseContext
+ (void) initialize
{
MAPIStoreDBFolderK = [MAPIStoreDBFolder class];
}
+ (NSString *) MAPIModuleName
{
return nil;
}
- (Class) MAPIStoreFolderClass
{
return MAPIStoreDBFolderK;
}
- (void) ensureContextFolder
{
SOGoCacheGCSFolder *currentFolder;
NSArray *parts;
NSMutableArray *folders;
NSString *folderName;
NSUInteger count, max;
parts = [[contextUrl path] componentsSeparatedByString: @"/"];
max = [parts count];
folders = [NSMutableArray arrayWithCapacity: max];
/* build the folder chain */
currentFolder = [self rootSOGoFolder];
[folders addObject: currentFolder];
for (count = 1; count < max; count++)
{
folderName = [parts objectAtIndex: count];
if ([folderName length] > 0)
{
currentFolder = [SOGoCacheGCSFolder objectWithName: folderName
inContainer: currentFolder];
[folders addObject: currentFolder];
}
}
/* ensure each folder in the chain actually exists, so that it becomes
"listable" in further operations */
max = [folders count];
for (count = 0; count < max; count++)
{
currentFolder = [folders objectAtIndex: count];
[currentFolder reloadIfNeeded];
if ([currentFolder isNew])
[currentFolder save];
}
}
- (id) rootSOGoFolder
{
SOGoCacheGCSFolder *folder;
[userContext ensureFolderTableExists];
folder = [SOGoCacheGCSFolder objectWithName: [isa MAPIModuleName]
inContainer: nil];
[folder setTableUrl: [userContext folderTableURL]];
// [folder reloadIfNeeded];
/* we don't need to set the "path prefix" of the folder since the module
name is used as the label for the top folder */
return folder;
}
@end
-43
View File
@@ -1,43 +0,0 @@
/* MAPIStoreDBFolder.h - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREDBFOLDER_H
#define MAPISTOREDBFOLDER_H
#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
#endif /* MAPISTOREDBFOLDER_H */
-382
View File
@@ -1,382 +0,0 @@
/* MAPIStoreDBFolder.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#include <inttypes.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSString.h>
#import <Foundation/NSURL.h>
#import <NGExtensions/NSObject+Logs.h>
#import <EOControl/EOQualifier.h>
#import <SOGo/SOGoFolder.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/EOQualifier+SOGoCacheObject.h>
#import "MAPIStoreContext.h"
#import "MAPIStoreDBFolderTable.h"
#import "MAPIStoreDBMessage.h"
#import "MAPIStoreDBMessageTable.h"
#import "MAPIStoreMapping.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import <SOGo/SOGoCacheGCSFolder.h>
#import "SOGoMAPIDBMessage.h"
#import "MAPIStoreDBFolder.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
static Class EOKeyValueQualifierK, SOGoCacheGCSFolderK, MAPIStoreDBFolderK;
@implementation MAPIStoreDBFolder
+ (void) initialize
{
EOKeyValueQualifierK = [EOKeyValueQualifier class];
SOGoCacheGCSFolderK = [SOGoCacheGCSFolder class];
MAPIStoreDBFolderK = [MAPIStoreDBFolder class];
}
- (void) setupAuxiliaryObjects
{
[super setupAuxiliaryObjects];
ASSIGN (sogoObject, dbFolder);
}
- (MAPIStoreMessageTable *) messageTable
{
return [MAPIStoreDBMessageTable tableForContainer: self];
}
- (MAPIStoreFolderTable *) folderTable
{
return [MAPIStoreDBFolderTable tableForContainer: self];
}
- (enum mapistore_error) createFolder: (struct SRow *) aRow
withFID: (uint64_t) newFID
andKey: (NSString **) newKeyP
{
enum mapistore_error rc;
NSString *folderName, *nameInContainer;
SOGoCacheGCSFolder *newFolder;
struct SPropValue *value;
value = get_SPropValue_SRow (aRow, PidTagDisplayName);
if (value)
folderName = [NSString stringWithUTF8String: value->value.lpszW];
else
{
value = get_SPropValue_SRow (aRow, PidTagDisplayName_string8);
if (value)
folderName = [NSString stringWithUTF8String: (const char *) value->value.lpszA];
else
folderName = nil;
}
if (folderName)
{
nameInContainer = [NSString stringWithFormat: @"0x%.16"PRIx64,
(unsigned long long) newFID];
newFolder = [SOGoCacheGCSFolderK objectWithName: nameInContainer
inContainer: sogoObject];
[newFolder reloadIfNeeded];
[[newFolder properties] setObject: folderName
forKey: MAPIPropertyKey (PidTagDisplayName)];
[newFolder save];
*newKeyP = nameInContainer;
rc = MAPISTORE_SUCCESS;
}
else
rc = MAPISTORE_ERR_INVALID_PARAMETER;
return rc;
}
- (enum mapistore_error) moveCopyToFolder: (MAPIStoreFolder *) targetFolder
withNewName: (NSString *) newFolderName
isMove: (BOOL) isMove
isRecursive: (BOOL) isRecursive
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc;
NSString *path, *pathComponent, *targetPath, *newPath;
NSString *newURL;
MAPIStoreMapping *mapping;
NSRange slashRange;
pathComponent = nil;
if (isMove && ([targetFolder isKindOfClass: MAPIStoreDBFolderK] || !targetFolder))
{
path = [sogoObject path];
slashRange = [path rangeOfString: @"/" options: NSBackwardsSearch];
if (slashRange.location == NSNotFound)
[NSException raise: @"MAPIStoreIOException"
format: @"db folder path must start with a '/'"];
else
pathComponent = [path substringFromIndex: slashRange.location + 1];
if (targetFolder)
{
targetPath = [[targetFolder sogoObject] path];
newPath = [NSString stringWithFormat: @"%@/%@",
targetPath, pathComponent];
[dbFolder changePathTo: newPath
intoNewContainer: [targetFolder dbFolder]];
}
else
[dbFolder changePathTo: [NSString stringWithFormat: @"/fallback/%@", pathComponent]
intoNewContainer: nil];
mapping = [self mapping];
if (targetFolder)
newURL = [NSString stringWithFormat: @"%@%@/",
[targetFolder url], pathComponent];
else
newURL = [NSString stringWithFormat: @"sogo://%@@fallback/%@/",
[[self userContext] username], pathComponent];
[mapping updateID: [self objectId]
withURL: newURL];
[targetFolder cleanupCaches];
rc = MAPISTORE_SUCCESS;
}
else
rc = [super moveCopyToFolder: targetFolder withNewName: newFolderName
isMove: isMove
isRecursive: isRecursive
inMemCtx: memCtx];
return rc;
}
- (MAPIStoreMessage *) createMessage
{
MAPIStoreMessage *newMessage;
SOGoMAPIDBMessage *fsObject;
NSString *newKey;
[[self userContext] activate];
newKey = [NSString stringWithFormat: @"%@.plist",
[SOGoObject globallyUniqueObjectId]];
fsObject = [SOGoMAPIDBMessage objectWithName: newKey
inContainer: sogoObject];
[fsObject setObjectType: MAPIMessageCacheObject];
[fsObject reloadIfNeeded];
newMessage = [MAPIStoreDBMessage mapiStoreObjectWithSOGoObject: fsObject
inContainer: self];
return newMessage;
}
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
NSArray *keys;
SOGoUser *ownerUser;
ownerUser = [[self userContext] sogoUser];
if ([[context activeUser] isEqual: ownerUser]
|| [self subscriberCanReadMessages])
{
[[self userContext] activate];
keys = [(SOGoCacheGCSFolder *) sogoObject childKeysOfType: MAPIMessageCacheObject
includeDeleted: NO
matchingQualifier: qualifier
andSortOrderings: sortOrderings];
}
else
keys = [NSArray array];
return keys;
}
- (NSArray *) folderKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
[[self userContext] activate];
return [dbFolder childKeysOfType: MAPIFolderCacheObject
includeDeleted: NO
matchingQualifier: qualifier
andSortOrderings: sortOrderings];
}
/* TODO: now that we are DB-based, this method can easily be implemented
- (NSArray *) getDeletedKeysFromChangeNumber: (uint64_t) changeNum
andCN: (NSNumber **) cnNbrs
inTableType: (enum mapistore_table_type) tableType
{
}
*/
- (NSDate *) lastMessageModificationTime
{
NSUInteger count, max;
NSDate *date, *fileDate;
MAPIStoreDBMessage *msg;
NSArray *messageKeys;
messageKeys = [self messageKeys];
date = [NSCalendarDate date];
//[self logWithFormat: @"current date: %@", date];
max = [messageKeys count];
for (count = 0; count < max; count++)
{
msg = [self lookupMessage: [messageKeys objectAtIndex: count]];
fileDate = [msg lastModificationTime];
if ([date laterDate: fileDate] == fileDate)
{
//[self logWithFormat: @"current date: %@", date];
date = fileDate;
}
}
return date;
}
- (SOGoFolder *) aclFolder
{
return sogoObject;
}
- (NSArray *) rolesForExchangeRights: (uint32_t) rights
{
NSMutableArray *roles;
roles = [NSMutableArray arrayWithCapacity: 9];
if (rights & RightsReadItems)
[roles addObject: MAPIStoreRightReadItems];
if (rights & RightsCreateItems)
[roles addObject: MAPIStoreRightCreateItems];
if (rights & RightsEditOwn)
[roles addObject: MAPIStoreRightEditOwn];
if (rights & RightsDeleteOwn)
[roles addObject: MAPIStoreRightDeleteOwn];
if (rights & RightsEditAll)
[roles addObject: MAPIStoreRightEditAll];
if (rights & RightsDeleteAll)
[roles addObject: MAPIStoreRightDeleteAll];
if (rights & RightsCreateSubfolders)
[roles addObject: MAPIStoreRightCreateSubfolders];
if (rights & RightsFolderOwner)
[roles addObject: MAPIStoreRightFolderOwner];
if (rights & RightsFolderContact)
[roles addObject: MAPIStoreRightFolderContact];
return roles;
}
- (uint32_t) exchangeRightsForRoles: (NSArray *) roles
{
uint32_t rights = 0;
if ([roles containsObject: MAPIStoreRightReadItems])
rights |= RightsReadItems;
if ([roles containsObject: MAPIStoreRightCreateItems])
rights |= RightsCreateItems;
if ([roles containsObject: MAPIStoreRightEditOwn])
rights |= RightsEditOwn;
if ([roles containsObject: MAPIStoreRightDeleteOwn])
rights |= RightsDeleteOwn;
if ([roles containsObject: MAPIStoreRightEditAll])
rights |= RightsEditAll | RightsEditOwn;
if ([roles containsObject: MAPIStoreRightDeleteAll])
rights |= RightsDeleteAll | RightsDeleteOwn;
if ([roles containsObject: MAPIStoreRightCreateSubfolders])
rights |= RightsCreateSubfolders;
if ([roles containsObject: MAPIStoreRightFolderOwner])
rights |= RightsFolderOwner;
if ([roles containsObject: MAPIStoreRightFolderContact])
rights |= RightsFolderContact;
if (rights != 0)
rights |= RoleNone; /* actually "folder visible" */
return rights;
}
- (BOOL) _testRoleForActiveUser: (const NSString *) role
{
SOGoUser *activeUser;
NSArray *roles;
activeUser = [[self context] activeUser];
roles = [[self aclFolder] aclsForUser: [activeUser login]];
return [roles containsObject: role];
}
- (BOOL) subscriberCanCreateMessages
{
return [self _testRoleForActiveUser: MAPIStoreRightCreateItems];
}
- (BOOL) subscriberCanModifyMessages
{
return [self _testRoleForActiveUser: MAPIStoreRightEditAll];
}
- (BOOL) subscriberCanReadMessages
{
NSString *displayName;
/* when this folder is the "Freebusy Data" folder, we need to allow
subscribed to read an open contained messages in order to enable them to
find the "LocalFreebusy" message */
[sogoObject reloadIfNeeded];
displayName = [[sogoObject properties]
objectForKey: MAPIPropertyKey (PidTagDisplayName)];
return ([displayName isEqualToString: @"Freebusy Data"]
|| [self _testRoleForActiveUser: MAPIStoreRightReadItems]);
}
- (BOOL) subscriberCanDeleteMessages
{
return [self _testRoleForActiveUser: MAPIStoreRightDeleteAll];
}
- (BOOL) subscriberCanCreateSubFolders
{
return [self _testRoleForActiveUser: MAPIStoreRightCreateSubfolders];
}
- (BOOL) supportsSubFolders
{
return YES;
}
@end
-31
View File
@@ -1,31 +0,0 @@
/* MAPIStoreDBFolderTable.h - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREDBFOLDERTABLE_H
#define MAPISTOREDBFOLDERTABLE_H
#import "MAPIStoreFolderTable.h"
@interface MAPIStoreDBFolderTable : MAPIStoreFolderTable
@end
#endif /* MAPISTOREDBFOLDERTABLE_H */
-36
View File
@@ -1,36 +0,0 @@
/* MAPIStoreDBFolderTable.m - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import "MAPIStoreTypes.h"
#import "MAPIStoreDBFolderTable.h"
@implementation MAPIStoreDBFolderTable
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
return [NSString stringWithFormat: @"%@", MAPIPropertyKey (property)];
}
@end
-31
View File
@@ -1,31 +0,0 @@
/* MAPIStoreDBMessage.h - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREDBMESSAGE_H
#define MAPISTOREDBMESSAGE_H
#import "MAPIStoreMessage.h"
@interface MAPIStoreDBMessage : MAPIStoreMessage
@end
#endif /* MAPISTOREDBMESSAGE_H */
-495
View File
@@ -1,495 +0,0 @@
/* MAPIStoreDBMessage.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSCalendarDate.h>
#import <Foundation/NSData.h>
#import <Foundation/NSDictionary.h>
#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"
#import "SOGoMAPIDBMessage.h"
#import "MAPIStoreDBFolder.h"
#import "MAPIStoreDBMessage.h"
#import "MAPIStoreTypes.h"
#import "NSData+MAPIStore.h"
#import "NSObject+MAPIStore.h"
#import "NSString+MAPIStore.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreDBMessage
+ (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) memCtx
{
struct SPropTagArray *properties;
NSUInteger count;
enum MAPITAGS faiProperties[] = {
0x68330048, /* PR_VIEW_CLSID */
0x68350102, /* PR_VIEW_STATE */
0x683c0102,
0x683d0040,
0x683e0102,
0x683f0102, /* PR_VIEW_VIEWTYPE_KEY */
0x68410003,
0x68420102,
0x68450102,
0x68460003,
0x7006001F, /* PR_VD_NAME_W */
0x70030003, /* PR_VD_FLAGS */
0x70070003 /* PR_VD_VERSION */
};
size_t faiSize = sizeof(faiProperties) / sizeof(enum MAPITAGS);
properties = talloc_zero (memCtx, struct SPropTagArray);
properties->cValues = MAPIStoreSupportedPropertiesCount + faiSize;
properties->aulPropTag = talloc_array (properties, enum MAPITAGS,
MAPIStoreSupportedPropertiesCount + faiSize);
for (count = 0; count < MAPIStoreSupportedPropertiesCount; count++)
properties->aulPropTag[count] = MAPIStoreSupportedProperties[count];
/* FIXME (hack): append a few undocumented properties that can be added to
FAI messages */
for (count = 0; count < faiSize; count++)
properties->aulPropTag[MAPIStoreSupportedPropertiesCount+count]
= faiProperties[count];
*propertiesP = properties;
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) memCtx
{
return [[self class] getAvailableProperties: propertiesP
inMemCtx: memCtx];
}
- (id) initWithSOGoObject: (id) newSOGoObject
inContainer: (MAPIStoreObject *) newContainer
{
if ((self = [super initWithSOGoObject: newSOGoObject
inContainer: newContainer]))
{
[properties release];
properties = [newSOGoObject properties];
[properties retain];
}
return self;
}
- (NSString *) description
{
id key, value;
NSEnumerator *propEnumerator;
NSMutableString *description;
description = [NSMutableString stringWithFormat: @"%@ %@. Properties: {", NSStringFromClass ([self class]),
[self url]];
propEnumerator = [properties keyEnumerator];
while ((key = [propEnumerator nextObject]))
{
uint32_t proptag = 0;
if ([key isKindOfClass: [NSString class]] && [(NSString *)key intValue] > 0)
proptag = [(NSString *)key intValue];
else if ([key isKindOfClass: [NSNumber class]])
proptag = [key unsignedLongValue];
if (proptag > 0)
{
const char *propTagName = get_proptag_name ([key unsignedLongValue]);
NSString *propName;
if (propTagName)
propName = [NSString stringWithCString: propTagName
encoding: NSUTF8StringEncoding];
else
propName = [NSString stringWithFormat: @"0x%.4x", [key unsignedLongValue]];
[description appendFormat: @"'%@': ", propName];
}
else
[description appendFormat: @"'%@': ", key];
value = [properties objectForKey: key];
[description appendFormat: @"%@ (%@), ", value, NSStringFromClass ([value class])];
}
[description appendString: @"}\n"];
return description;
}
- (uint64_t) objectVersion
{
/* Return the global counter from CN structure.
See [MS-OXCFXICS] Section 2.2.2.1 */
NSNumber *versionNbr, *cn;
uint64_t objectVersion;
[(SOGoMAPIDBMessage *) sogoObject reloadIfNeeded];
versionNbr = [properties objectForKey: @"version_number"];
if (versionNbr)
objectVersion = exchange_globcnt ([versionNbr unsignedLongLongValue]);
else
{
/* Old version which stored the CN structure not useful for searching */
cn = [properties objectForKey: @"version"];
if (cn)
objectVersion = (([cn unsignedLongLongValue] >> 16)
& 0x0000ffffffffffffLL);
else
objectVersion = ULLONG_MAX;
}
return objectVersion;
}
- (void) _updatePredecessorChangeList
{
BOOL updated;
enum mapistore_error rc;
NSData *currentChangeList, *changeKey;
NSMutableArray *changeKeys;
NSMutableData *newChangeList;
NSUInteger count, len;
struct SizedXid *changes;
struct SPropValue property;
struct SRow aRow;
struct XID *currentChangeKey;
TALLOC_CTX *localMemCtx;
uint32_t nChanges;
localMemCtx = talloc_new (NULL);
if (!localMemCtx)
{
[self errorWithFormat: @"No more memory"];
return;
}
changeKey = [self getReplicaKeyFromGlobCnt: [self objectVersion]];
currentChangeList = [properties objectForKey: MAPIPropertyKey (PidTagPredecessorChangeList)];
if (!currentChangeList)
{
/* Create a new PredecessorChangeList */
len = [changeKey length];
newChangeList = [NSMutableData dataWithCapacity: len + 1];
[newChangeList appendUInt8: len];
[newChangeList appendData: changeKey];
}
else
{
/* Update current predecessor change list with new change key */
changes = [currentChangeList asSizedXidArrayInMemCtx: localMemCtx
with: &nChanges];
updated = NO;
currentChangeKey = [changeKey asXIDInMemCtx: localMemCtx];
for (count = 0; count < nChanges && !updated; count++)
{
if (GUID_equal(&changes[count].XID.NameSpaceGuid, &currentChangeKey->NameSpaceGuid))
{
NSData *globCnt, *oldGlobCnt;
oldGlobCnt = [NSData dataWithBytes: changes[count].XID.LocalId.data length: changes[count].XID.LocalId.length];
globCnt = [NSData dataWithBytes: currentChangeKey->LocalId.data length: currentChangeKey->LocalId.length];
if ([globCnt compare: oldGlobCnt] == NSOrderedDescending)
{
if ([globCnt length] != [oldGlobCnt length])
{
[self errorWithFormat: @"Cannot compare globcnt with different length: %@ and %@", globCnt, oldGlobCnt];
abort();
}
memcpy (changes[count].XID.LocalId.data, currentChangeKey->LocalId.data, currentChangeKey->LocalId.length);
updated = YES;
}
}
}
/* Serialise it */
changeKeys = [NSMutableArray array];
if (!updated)
[changeKeys addObject: changeKey];
for (count = 0; count < nChanges; count++)
{
changeKey = [NSData dataWithXID: &changes[count].XID];
[changeKeys addObject: changeKey];
}
[changeKeys sortUsingFunction: MAPIChangeKeyGUIDCompare context: localMemCtx];
newChangeList = [NSMutableData data];
len = [changeKeys count];
for (count = 0; count < len; count++)
{
changeKey = [changeKeys objectAtIndex: count];
[newChangeList appendUInt8: [changeKey length]];
[newChangeList appendData: changeKey];
}
}
if ([newChangeList length] > 0)
{
property.ulPropTag = PidTagPredecessorChangeList;
property.value.bin = *[newChangeList asBinaryInMemCtx: localMemCtx];
aRow.cValues = 1;
aRow.lpProps = &property;
rc = [self addPropertiesFromRow: &aRow];
if (rc != MAPISTORE_SUCCESS)
[self errorWithFormat: @"Impossible to add a new predecessor change list: %d", rc];
}
talloc_free (localMemCtx);
}
//
// FIXME: how this can happen?
//
// We might get there if for some reasons, all classes weren't able
// to tell us the message class.
//
- (enum mapistore_error) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
[self logWithFormat: @"METHOD '%s' - unable to determine message class. Falling back to IPM.Note", __FUNCTION__];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getProperties: (struct mapistore_property_data *) data
withTags: (enum MAPITAGS *) tags
andCount: (uint16_t) columnCount
inMemCtx: (TALLOC_CTX *) memCtx
{
[sogoObject reloadIfNeeded];
return [super getProperties: data
withTags: tags
andCount: columnCount
inMemCtx: memCtx];
}
- (enum mapistore_error) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
{
id value;
enum mapistore_error rc;
value = [properties objectForKey: MAPIPropertyKey (propTag)];
if (value)
rc = [value getValue: data forTag: propTag inMemCtx: memCtx];
else
rc = [super getProperty: data withTag: propTag inMemCtx: memCtx];
return rc;
}
- (void) addProperties: (NSDictionary *) newNewProperties
{
[sogoObject reloadIfNeeded];
[super addProperties: newNewProperties];
}
- (void) save: (TALLOC_CTX *) memCtx
{
uint64_t newVersion;
if ([attachmentKeys count] > 0)
[properties setObject: attachmentParts forKey: @"attachments"];
newVersion = [[self context] getNewChangeNumber];
newVersion = exchange_globcnt ((newVersion >> 16) & 0x0000ffffffffffffLL);
[properties setObject: [NSNumber numberWithUnsignedLongLong: newVersion]
forKey: @"version_number"];
/* Remove old version */
[properties removeObjectForKey: @"version"];
/* 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]];
[sogoObject save];
}
- (BOOL) _messageIsFreeBusy
{
NSString *msgClass;
/* This is a HACK until we figure out how to determine a message position in
the mailbox hierarchy.... (missing: folderid and role) */
msgClass = [properties
objectForKey: MAPIPropertyKey (PR_MESSAGE_CLASS_UNICODE)];
return [msgClass isEqualToString: @"IPM.Microsoft.ScheduleData.FreeBusy"];
}
//-----------------------------
// Permissions
//-----------------------------
- (BOOL) subscriberCanReadMessage
{
return [(MAPIStoreFolder *) container subscriberCanReadMessages];
}
- (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
{
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
{
return [sogoObject creationDate];
}
- (NSDate *) lastModificationTime
{
return [sogoObject lastModified];
}
- (enum mapistore_error) setReadFlag: (uint8_t) flag
{
/* Modify PidTagMessageFlags from SetMessageReadFlag and
SyncImportReadStateChanges ROPs */
NSNumber *flags;
uint32_t newFlag;
flags = [properties objectForKey: MAPIPropertyKey (PR_MESSAGE_FLAGS)];
if (flags)
{
newFlag = [flags unsignedLongValue];
if (flag & SUPPRESS_RECEIPT)
newFlag |= MSGFLAG_READ;
if (flag & CLEAR_RN_PENDING)
newFlag &= ~MSGFLAG_RN_PENDING;
if (flag & CLEAR_READ_FLAG)
newFlag &= ~MSGFLAG_READ;
if (flag & CLEAR_NRN_PENDING)
newFlag &= ~MSGFLAG_NRN_PENDING;
}
else
{
newFlag = MSGFLAG_READ;
if (flag & CLEAR_READ_FLAG)
newFlag = 0x0;
}
[properties setObject: [NSNumber numberWithUnsignedLong: newFlag]
forKey: MAPIPropertyKey (PR_MESSAGE_FLAGS)];
return MAPISTORE_SUCCESS;
}
@end
@@ -1,31 +0,0 @@
/* MAPIStoreDBMessageTable.h - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREDBMESSAGETABLE_H
#define MAPISTOREDBMESSAGETABLE_H
#import "MAPIStoreMessageTable.h"
@interface MAPIStoreDBMessageTable : MAPIStoreMessageTable
@end
#endif /* MAPISTOREDBMESSAGETABLE_H */
-133
View File
@@ -1,133 +0,0 @@
/* MAPIStoreDBMessageTable.m - this file is part of SOGo
*
* Copyright (C) 2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import <NGExtensions/NSObject+Logs.h>
#import <EOControl/EOQualifier.h>
#import "MAPIStoreTypes.h"
#import "MAPIStoreDBMessage.h"
#import "MAPIStoreDBMessageTable.h"
#undef DEBUG
#include <mapistore/mapistore.h>
static Class MAPIStoreDBMessageK = Nil;
@implementation MAPIStoreDBMessageTable
+ (void) initialize
{
MAPIStoreDBMessageK = [MAPIStoreDBMessage class];
}
+ (Class) childObjectClass
{
return MAPIStoreDBMessageK;
}
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
return [NSString stringWithFormat: @"%@", MAPIPropertyKey (property)];
}
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
id value;
NSNumber *version;
uint64_t cVersion;
if ((uint32_t) res->ulPropTag == PidTagChangeNumber)
{
SEL operator;
value = NSObjectFromMAPISPropValue (&res->lpProp);
cVersion = exchange_globcnt (([value unsignedLongLongValue] >> 16)
& 0x0000ffffffffffffLL);
version = [NSNumber numberWithUnsignedLongLong: cVersion];
operator = [self operatorFromRestrictionOperator: res->relop];
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: @"version_number"
operatorSelector: operator
value: version];
[*qualifier autorelease];
rc = MAPIRestrictionStateNeedsEval;
}
else if ((uint32_t) res->ulPropTag == PR_SUBJECT_UNICODE)
{
EOQualifier *subjectQualifier, *nSubjectQualifier, *subjectPQualifier;
EOQualifier *orQualifier, *andQualifier;
struct mapi_SPropertyRestriction subRes;
char *colPtr, *prefix;
[super evaluatePropertyRestriction: res
intoQualifier: &subjectQualifier];
subRes.relop = res->relop;
subRes.ulPropTag = PR_NORMALIZED_SUBJECT_UNICODE;
subRes.lpProp.ulPropTag = PR_NORMALIZED_SUBJECT_UNICODE;
colPtr = strstr (res->lpProp.value.lpszW, ":");
if (colPtr)
subRes.lpProp.value.lpszW = colPtr + 1;
else
subRes.lpProp.value.lpszW = res->lpProp.value.lpszW;
[self evaluatePropertyRestriction: &subRes
intoQualifier: &nSubjectQualifier];
if (colPtr)
{
prefix = strndup (res->lpProp.value.lpszW, (colPtr - res->lpProp.value.lpszW));
subRes.relop = RELOP_EQ;
subRes.ulPropTag = PR_SUBJECT_PREFIX_UNICODE;
subRes.lpProp.ulPropTag = PR_SUBJECT_PREFIX_UNICODE;
subRes.lpProp.value.lpszW = prefix;
[self evaluatePropertyRestriction: &subRes
intoQualifier: &subjectPQualifier];
free (prefix);
andQualifier = [[EOOrQualifier alloc]
initWithQualifiers:
subjectPQualifier, nSubjectQualifier, nil];
orQualifier = [[EOOrQualifier alloc]
initWithQualifiers:
subjectQualifier, andQualifier, nil];
[andQualifier release];
}
else
orQualifier = [[EOOrQualifier alloc]
initWithQualifiers:
subjectQualifier, nSubjectQualifier, nil];
[orQualifier autorelease];
*qualifier = orQualifier;
rc = MAPIRestrictionStateNeedsEval;
}
else
rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier];
return rc;
}
@end
-154
View File
@@ -1,154 +0,0 @@
/* MAPIStoreEmbeddedMessage.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import "MAPIStoreAttachment.h"
#import "MAPIStoreFolder.h"
#import "NSObject+MAPIStore.h"
#import "MAPIStoreEmbeddedMessage.h"
#include <mapistore/mapistore_errors.h>
static Class MAPIStoreAttachmentK;
@implementation MAPIStoreEmbeddedMessage
+ (void) initialize
{
MAPIStoreAttachmentK = [MAPIStoreAttachment class];
}
- (uint64_t) objectId
{
NSString *objectKey;
MAPIStoreMessage *grandParent;
grandParent = (MAPIStoreMessage *) [container container];
/* FIXME: this is a hack */
objectKey = [NSString stringWithFormat: @"%@/%@/as-message",
[grandParent nameInContainer],
[container nameInContainer],
[self nameInContainer]];
return [(MAPIStoreFolder *) [grandParent container]
idForObjectWithKey: objectKey];
}
- (enum mapistore_error) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
/* disabled properties */
- (enum mapistore_error) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagChangeNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagInstID: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagInstanceNum: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagRowType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagDepth: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (enum mapistore_error) getPidTagOriginalMessageClass: (void **) dataa
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
/* common methods */
- (NSString *) nameInContainer
{
return @"as-message";
}
- (uint64_t) objectVersion
{
return ULLONG_MAX;
}
- (void) save: (TALLOC_CTX *) memCtx
{
[self subclassResponsibility: _cmd];
}
@end
-31
View File
@@ -1,31 +0,0 @@
/* MAPIStoreFAIMessage.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREFAIMESSAGE_H
#define MAPISTOREFAIMESSAGE_H
#import "MAPIStoreDBMessage.h"
@interface MAPIStoreFAIMessage : MAPIStoreDBMessage
@end
#endif /* MAPISTOREFAIMESSAGE_H */
-81
View File
@@ -1,81 +0,0 @@
/* MAPIStoreFAIMessage.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 <SOGo/SOGoUser.h>
#import "MAPIStoreActiveTables.h"
#import "MAPIStoreContext.h"
#import "MAPIStoreFolder.h"
#import "MAPIStoreUserContext.h"
#import "NSObject+MAPIStore.h"
#import "MAPIStoreFAIMessage.h"
#undef DEBUG
#include <stdbool.h>
#include <talloc.h>
#include <util/time.h>
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreFAIMessage
- (NSArray *) activeContainerMessageTables
{
return [[MAPIStoreActiveTables activeTables]
activeTablesForFMID: [container objectId]
andType: MAPISTORE_FAI_TABLE];
}
- (enum mapistore_error) getPidTagAssociated: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (enum mapistore_error) saveMessage: (TALLOC_CTX *) memCtx;
{
enum mapistore_error rc;
MAPIStoreContext *context;
SOGoUser *ownerUser;
context = [self context];
ownerUser = [[self userContext] sogoUser];
if ([[context activeUser] isEqual: ownerUser])
rc = [super saveMessage: memCtx];
else
rc = MAPISTORE_ERR_DENIED;
return rc;
}
- (BOOL) subscriberCanReadMessage
{
return [(MAPIStoreFolder *)container subscriberCanReadMessages];
}
- (BOOL) subscriberCanModifyMessage
{
return NO;
}
@end
@@ -1,31 +0,0 @@
/* MAPIStoreFAIMessageTable.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREFAIMESSAGETABLE_H
#define MAPISTOREFAIMESSAGETABLE_H
#import "MAPIStoreDBMessageTable.h"
@interface MAPIStoreFAIMessageTable : MAPIStoreDBMessageTable
@end
#endif /* MAPISTOREFAIMESSAGETABLE_H */
-101
View File
@@ -1,101 +0,0 @@
/* MAPIStoreFAIMessageTable.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 "MAPIStoreFAIMessage.h"
#import "MAPIStoreFolder.h"
#import "MAPIStoreFAIMessageTable.h"
#undef DEBUG
#include <talloc.h>
#include <util/time.h>
#include <mapistore/mapistore.h>
static Class MAPIStoreFAIMessageK = Nil;
@implementation MAPIStoreFAIMessageTable
+ (void) initialize
{
MAPIStoreFAIMessageK = [MAPIStoreFAIMessage class];
}
+ (Class) childObjectClass
{
return MAPIStoreFAIMessageK;
}
- (id) init
{
if ((self = [super init]))
{
tableType = MAPISTORE_FAI_TABLE;
}
return self;
}
- (NSArray *) childKeys
{
if (!childKeys)
{
childKeys = [(MAPIStoreFolder *)
container faiMessageKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [(MAPIStoreFolder *)
container faiMessageKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (id) lookupChild: (NSString *) childKey
{
return [(MAPIStoreFolder *) container lookupFAIMessage: childKey];
}
@end
@@ -1,32 +0,0 @@
/* MAPIStoreFallbackContext.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREFALLBACKCONTEXT_H
#define MAPISTOREFALLBACKCONTEXT_H
#import "MAPIStoreDBBaseContext.h"
@interface MAPIStoreFallbackContext : MAPIStoreDBBaseContext
@end
#endif /* MAPISTOREFALLBACKCONTEXT_H */
-112
View File
@@ -1,112 +0,0 @@
/* MAPIStoreFallbackContext.m - this file is part of SOGo
*
* Copyright (C) 2011-2014 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
* 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/NSString.h>
#import <Foundation/NSURL.h>
#import "MAPIStoreUserContext.h"
#import "NSString+MAPIStore.h"
#import <SOGo/SOGoCacheGCSFolder.h>
#import "MAPIStoreFallbackContext.h"
#undef DEBUG
#include <inttypes.h>
#include <dlinklist.h>
#include <mapistore/mapistore.h>
@implementation MAPIStoreFallbackContext
+ (NSString *) MAPIModuleName
{
return @"fallback";
}
+ (enum mapistore_context_role) MAPIContextRole
{
return MAPISTORE_MAIL_ROLE;
}
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx
{
struct mapistore_contexts_list *firstContext = NULL, *context;
SOGoCacheGCSFolder *root;
NSArray *names;
NSUInteger count, max;
NSString *baseURL, *url, *name;
MAPIStoreUserContext *userContext;
baseURL = [NSString stringWithFormat: @"sogo://%@@fallback/",
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"]];
context = talloc_zero (memCtx, struct mapistore_contexts_list);
context->url = [baseURL asUnicodeInMemCtx: context];
context->name = "Fallback";
context->main_folder = true;
context->role = MAPISTORE_FALLBACK_ROLE;
context->tag = "tag";
DLIST_ADD_END (firstContext, context, void);
/* Maybe emsmdbp_provisioning should be fixed in order to only take the uri
returned above to avoid deleting its entries... */
root = [SOGoCacheGCSFolder objectWithName: [self MAPIModuleName]
inContainer: nil];
[root setOwner: userName];
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: indexing];
[userContext ensureFolderTableExists];
[root setTableUrl: [userContext folderTableURL]];
names = [root toManyRelationshipKeys];
max = [names count];
for (count = 0; count < max; count++)
{
name = [names objectAtIndex: count];
url = [NSString stringWithFormat: @"%@%@/", baseURL, name];
context = talloc_zero (memCtx, struct mapistore_contexts_list);
context->url = [url asUnicodeInMemCtx: context];
context->name = [name asUnicodeInMemCtx: context];
context->main_folder = false;
context->role = MAPISTORE_FALLBACK_ROLE;
context->tag = "tag";
DLIST_ADD_END (firstContext, context, void);
}
return firstContext;
}
+ (NSString *)
createRootSecondaryFolderWithFID: (uint64_t) fid
andName: (NSString *) folderName
forUser: (NSString *) userName
{
return [NSString stringWithFormat: @"sogo://%@@fallback/0x%.16"PRIx64"/",
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
(unsigned long long) fid];
}
@end
-209
View File
@@ -1,209 +0,0 @@
/* MAPIStoreFolder.h - this file is part of SOGo
*
* Copyright (C) 2011-2014 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
* 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 MAPISTOREFOLDER_H
#define MAPISTOREFOLDER_H
#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
@class NSArray;
@class NSMutableArray;
@class NSNumber;
@class EOQualifier;
@class MAPIStoreContext;
@class MAPIStoreMessage;
@class MAPIStoreFAIMessageTable;
@class MAPIStoreFolderTable;
@class MAPIStoreMessageTable;
@class MAPIStorePermissionsTable;
@class SOGoFolder;
@class SOGoCacheGCSFolder;
@class SOGoMAPIDBMessage;
#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;
// NSArray *messageKeys;
// NSArray *faiMessageKeys;
// NSArray *folderKeys;
SOGoCacheGCSFolder *dbFolder;
// SOGoMAPIDBFolder *faiFolder;
// SOGoMAPIDBFolder *propsFolder;
// SOGoMAPIDBMessage *propsMessage;
}
- (void) setContext: (MAPIStoreContext *) newContext;
- (void) setupAuxiliaryObjects;
- (SOGoCacheGCSFolder *) dbFolder;
- (NSArray *) activeMessageTables;
- (NSArray *) activeFAIMessageTables;
// - (SOGoMAPIDBMessage *) propertiesMessage;
- (NSString *) childKeyFromURL: (NSString *) childURL;
- (id) lookupMessageByURL: (NSString *) messageURL;
- (id) lookupFolderByURL: (NSString *) folderURL;
/* permissions */
- (MAPIStorePermissionsTable *) permissionsTable;
- (NSArray *) permissionEntries;
- (NSArray *) expandRoles: (NSArray *) roles;
/* message objects and tables */
- (id) lookupMessage: (NSString *) messageKey;
- (NSArray *) messageKeys;
/* FAI message objects and tables */
- (id) lookupFAIMessage: (NSString *) messageKey;
- (MAPIStoreFAIMessageTable *) faiMessageTable;
- (NSArray *) faiMessageKeys;
- (NSArray *) faiMessageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
/* folder objects and tables */
- (id) lookupFolder: (NSString *) folderKey;
- (MAPIStoreFolderTable *) folderTable;
- (NSArray *) folderKeys;
- (NSArray *) folderKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
- (MAPIStoreMessage *) createMessage: (BOOL) isAssociated;
/* backend interface */
- (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;
- (enum mapistore_error) createMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
isAssociated: (BOOL) isAssociated;
- (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;
- (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
isMove: (BOOL) isMove
isRecursive: (BOOL) isRecursive
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 *) mem_ctx;
- (enum mapistore_error) getTable: (MAPIStoreTable **) tablePtr
andRowCount: (uint32_t *) count
tableType: (enum mapistore_table_type) tableType
andHandleId: (uint32_t) handleId;
- (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;
/* helpers */
- (uint64_t) idForObjectWithKey: (NSString *) childKey;
- (MAPIStoreFolder *) rootContainer;
/* subclasses */
- (MAPIStoreMessage *) createMessage;
- (MAPIStoreMessageTable *) messageTable;
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
- (NSArray *) getDeletedKeysFromChangeNumber: (uint64_t) changeNum
andCN: (NSNumber **) cnNbr
inTableType: (enum mapistore_table_type) tableType;
- (enum mapistore_error) createFolder: (struct SRow *) aRow
withFID: (uint64_t) newFID
andKey: (NSString **) newKeyP;
- (NSCalendarDate *) lastMessageModificationTime;
- (SOGoFolder *) aclFolder;
- (NSArray *) rolesForExchangeRights: (uint32_t) rights;
- (uint32_t) exchangeRightsForRoles: (NSArray *) roles;
- (BOOL) subscriberCanCreateMessages;
- (BOOL) subscriberCanModifyMessages;
- (BOOL) subscriberCanReadMessages;
- (BOOL) subscriberCanDeleteMessages;
- (BOOL) subscriberCanCreateSubFolders;
- (BOOL) supportsSubFolders; /* capability */
- (enum mapistore_error) preloadMessageBodiesWithKeys: (NSArray *) keys
ofTableType: (enum mapistore_table_type) tableType;
/* subclass helpers */
- (void) setupVersionsMessage;
- (void) ensureIDsForChildKeys: (NSArray *) keys;
@end
#endif /* MAPISTOREFOLDER_H */
File diff suppressed because it is too large. Load diff
-31
View File
@@ -1,31 +0,0 @@
/* MAPIStoreFolderTable.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREFOLDERTABLE_H
#define MAPISTOREFOLDERTABLE_H
#import "MAPIStoreTable.h"
@interface MAPIStoreFolderTable : MAPIStoreTable
@end
#endif /* MAPISTOREFOLDERTABLE_H */
-118
View File
@@ -1,118 +0,0 @@
/* MAPIStoreFolderTable.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 <NGExtensions/NSObject+Logs.h>
#import "MAPIStoreFolder.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreFolderTable.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_nameid.h>
#include <libmapiproxy.h>
@implementation MAPIStoreFolderTable
- (id) init
{
if ((self = [super init]))
{
tableType = MAPISTORE_FOLDER_TABLE;
}
return self;
}
- (NSArray *) childKeys
{
if (!childKeys)
{
childKeys = [(MAPIStoreFolder *)
container folderKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
/* FIXME: restrictions are ignored on folder tables */
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [(MAPIStoreFolder *)
container folderKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
switch ((uint32_t) res->ulPropTag)
{
/* HACK: we cheat here as we current have no mechanism for searching
folders based on PR_CHANGE_NUM, which is used by the oxcfxics
mechanism... */
case PidTagChangeNumber:
rc = MAPIRestrictionStateAlwaysTrue;
break;
default:
rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier];
}
return rc;
}
- (id) lookupChild: (NSString *) childKey
{
return [(MAPIStoreFolder *) container lookupFolder: childKey];
}
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
return nil;
}
@end
@@ -1,37 +0,0 @@
/* MAPIStoreGCSBaseContext.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREGCSBASECONTEXT_H
#define MAPISTOREGCSBASECONTEXT_H
#import "MAPIStoreContext.h"
@class EOQualifier;
@interface MAPIStoreGCSBaseContext : MAPIStoreContext
+ (NSString *) folderNameSuffix;
+ (NSString *) getFolderDisplayName: (NSString *) sogoDisplayName;
@end
#endif /* MAPISTOREGCSBASECONTEXT_H */
-145
View File
@@ -1,145 +0,0 @@
/* MAPIStoreGCSBaseContext.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import <SOGo/SOGoGCSFolder.h>
#import <SOGo/SOGoParentFolder.h>
#import "MAPIApplication.h"
#import "MAPIStoreUserContext.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreGCSBaseContext.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <dlinklist.h>
@implementation MAPIStoreGCSBaseContext
+ (NSString *) MAPIModuleName
{
return nil;
}
+ (NSString *) folderNameSuffix
{
return @"";
}
+ (NSString *) getFolderDisplayName: (NSString *) sogoDisplayName
{
NSString *suffix, *displayName;
suffix = [self folderNameSuffix];
if ([suffix length] > 0 && ![sogoDisplayName hasSuffix: suffix])
displayName = [NSString stringWithFormat: @"%@ (%@)",
sogoDisplayName, suffix];
else
displayName = sogoDisplayName;
return displayName;
}
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx
{
struct mapistore_contexts_list *firstContext = NULL, *context;
NSString *moduleName, *baseUrl, *url, *nameInContainer, *displayName;
NSArray *subfolders;
MAPIStoreUserContext *userContext;
SOGoParentFolder *parentFolder;
NSUInteger count, max;
SOGoGCSFolder *currentFolder;
moduleName = [self MAPIModuleName];
if (moduleName)
{
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: indexing];
parentFolder = [[userContext rootFolders] objectForKey: moduleName];
baseUrl = [NSString stringWithFormat: @"sogo://%@@%@/",
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
moduleName];
subfolders = [parentFolder subFolders];
max = [subfolders count];
for (count = 0; count < max; count++)
{
currentFolder = [subfolders objectAtIndex: count];
if ([[currentFolder ownerInContext: nil] isEqualToString: userName])
{
context = talloc_zero (memCtx, struct mapistore_contexts_list);
nameInContainer = [currentFolder nameInContainer];
url = [NSString stringWithFormat: @"%@%@", baseUrl, nameInContainer];
context->url = [url asUnicodeInMemCtx: context];
displayName = [self getFolderDisplayName: [currentFolder displayName]];
context->name = [displayName asUnicodeInMemCtx: context];
context->main_folder = [nameInContainer isEqualToString: @"personal"];
context->role = [self MAPIContextRole];
context->tag = "tag";
DLIST_ADD_END (firstContext, context, void);
}
}
}
return firstContext;
}
+ (NSString *)
createRootSecondaryFolderWithFID: (uint64_t) fid
andName: (NSString *) folderName
forUser: (NSString *) userName
{
NSString *mapistoreURI, *nameInContainer, *moduleName;
MAPIStoreUserContext *userContext;
SOGoParentFolder *parentFolder;
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: NULL];
moduleName = [self MAPIModuleName];
parentFolder = [[userContext rootFolders] objectForKey: moduleName];
nameInContainer = nil;
if (![parentFolder newFolderWithName: folderName
nameInContainer: &nameInContainer])
mapistoreURI = [NSString stringWithFormat: @"sogo://%@@%@/%@/",
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
moduleName, nameInContainer];
else
mapistoreURI = nil;
return mapistoreURI;
}
- (id) rootSOGoFolder
{
return [[userContext rootFolders] objectForKey: [isa MAPIModuleName]];
}
@end
-64
View File
@@ -1,64 +0,0 @@
/* MAPIStoreGCSFolder.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREGCSFOLDER_H
#define MAPISTOREGCSFOLDER_H
#import "MAPIStoreFolder.h"
@class NSArray;
@class NSCalendarDate;
@class NSData;
@class NSMutableDictionary;
@class NSNumber;
@class NSString;
@interface MAPIStoreGCSFolder : MAPIStoreFolder
{
SOGoMAPIDBMessage *versionsMessage;
NSArray *activeUserRoles;
EOQualifier *componentQualifier;
}
/* synchronisation */
- (BOOL) synchroniseCache;
- (BOOL) synchroniseCacheFor: (NSString *) nameInContainer;
- (void) updateVersionsForMessageWithKey: (NSString *) messageKey
withChangeKey: (NSData *) oldChangeKey
andPredecessorChangeList: (NSData *) pcl;
- (NSNumber *) lastModifiedFromMessageChangeNumber: (NSString *) changeNumber;
- (NSString *) changeNumberForMessageWithKey: (NSString *) messageKey;
- (NSData *) changeKeyForMessageWithKey: (NSString *) messageKey;
- (NSData *) predecessorChangeListForMessageWithKey: (NSString *) messageKey;
- (NSArray *) activeUserRoles;
- (EOQualifier *) componentQualifier;
- (EOQualifier *) contentComponentQualifier;
/* subclasses */
- (EOQualifier *) aclQualifier;
- (NSString *) component;
@end
#endif /* MAPISTOREGCSFOLDER_H */
-893
View File
@@ -1,893 +0,0 @@
/* MAPIStoreGCSFolder.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSCalendarDate.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NSObject+Values.h>
#import <EOControl/EOQualifier.h>
#import <EOControl/EOFetchSpecification.h>
#import <EOControl/EOSortOrdering.h>
#import <GDLContentStore/GCSFolder.h>
#import <SOGo/NSArray+Utilities.h>
#import <SOGo/SOGoGCSFolder.h>
#import <SOGo/SOGoParentFolder.h>
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import "MAPIStoreGCSBaseContext.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import "NSData+MAPIStore.h"
#import "NSDate+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "SOGoMAPIDBMessage.h"
#import "MAPIStoreGCSFolder.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
static Class NSNumberK;
@implementation MAPIStoreGCSFolder
+ (void) initialize
{
NSNumberK = [NSNumber class];
}
- (id) initWithSOGoObject: (id) newSOGoObject
inContainer: (MAPIStoreObject *) newContainer
{
if ((self = [super initWithSOGoObject: newSOGoObject inContainer: newContainer]))
{
activeUserRoles = nil;
}
return self;
}
- (void) setupVersionsMessage
{
ASSIGN (versionsMessage,
[SOGoMAPIDBMessage objectWithName: @"versions.plist"
inContainer: dbFolder]);
[versionsMessage setObjectType: MAPIInternalCacheObject];
[versionsMessage reloadIfNeeded];
}
- (void) dealloc
{
[versionsMessage release];
[activeUserRoles release];
[componentQualifier release];
[super dealloc];
}
- (enum mapistore_error) deleteFolder
{
enum mapistore_error rc;
NSException *error;
NSString *name;
name = [self nameInContainer];
if ([name isEqualToString: @"personal"])
rc = MAPISTORE_ERR_DENIED;
else
{
[[sogoObject container] removeSubFolder: name];
error = [(SOGoGCSFolder *) sogoObject delete];
if (error)
rc = MAPISTORE_ERROR;
else
{
if (![versionsMessage delete])
rc = MAPISTORE_SUCCESS;
else
rc = MAPISTORE_ERROR;
}
}
return (rc == MAPISTORE_SUCCESS) ? [super deleteFolder] : rc;
}
- (void) setDisplayName: (NSString *) newDisplayName
{
NSString *suffix, *fullSuffix;
Class cClass;
cClass = [(MAPIStoreGCSBaseContext *) [self context] class];
/* if a suffix exists, we strip it from the final name */
suffix = [cClass folderNameSuffix];
if ([suffix length] > 0)
{
fullSuffix = [NSString stringWithFormat: @"(%@)", suffix];
if ([newDisplayName hasSuffix: fullSuffix])
{
newDisplayName = [newDisplayName substringToIndex:
[newDisplayName length]
- [fullSuffix length]];
newDisplayName = [newDisplayName stringByTrimmingSpaces];
}
}
if (![[sogoObject displayName] isEqualToString: newDisplayName])
[sogoObject renameTo: newDisplayName];
}
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *displayName;
Class cClass;
cClass = [(MAPIStoreGCSBaseContext *) [self context] class];
displayName = [cClass getFolderDisplayName: [sogoObject displayName]];
*data = [displayName asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (void) addProperties: (NSDictionary *) newProperties
{
NSString *newDisplayName;
NSMutableDictionary *propsCopy;
NSNumber *key;
key = MAPIPropertyKey (PR_DISPLAY_NAME_UNICODE);
newDisplayName = [newProperties objectForKey: key];
if (newDisplayName)
{
[self setDisplayName: newDisplayName];
propsCopy = [newProperties mutableCopy];
[propsCopy removeObjectForKey: key];
[propsCopy autorelease];
newProperties = propsCopy;
}
[super addProperties: newProperties];
}
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
static NSArray *fields = nil;
SOGoUser *ownerUser;
NSArray *records;
NSMutableArray *qualifierArray;
EOQualifier *fetchQualifier, *aclQualifier;
GCSFolder *ocsFolder;
EOFetchSpecification *fs;
NSArray *keys;
if (!fields)
fields = [[NSArray alloc]
initWithObjects: @"c_name", @"c_version", nil];
qualifierArray = [NSMutableArray new];
ownerUser = [[self userContext] sogoUser];
if (![[context activeUser] isEqual: ownerUser])
{
aclQualifier = [self aclQualifier];
if (aclQualifier)
[qualifierArray addObject: aclQualifier];
}
[qualifierArray addObject: [self componentQualifier]];
if (qualifier)
[qualifierArray addObject: qualifier];
fetchQualifier = [[EOAndQualifier alloc]
initWithQualifierArray: qualifierArray];
ocsFolder = [sogoObject ocsFolder];
fs = [EOFetchSpecification
fetchSpecificationWithEntityName: [ocsFolder folderName]
qualifier: fetchQualifier
sortOrderings: sortOrderings];
[fetchQualifier release];
[qualifierArray release];
records = [ocsFolder fetchFields: fields fetchSpecification: fs];
keys = [records objectsForKey: @"c_name"
notFoundMarker: nil];
return keys;
}
- (NSDate *) lastMessageModificationTime
{
NSDate *value;
NSNumber *ti;
[self synchroniseCache];
ti = [[versionsMessage properties]
objectForKey: @"SyncLastModificationDate"];
if (ti)
value = [NSDate dateWithTimeIntervalSince1970: [ti doubleValue]];
else
value = nil;
return value;
}
- (SOGoFolder *) aclFolder
{
return (SOGoFolder *) sogoObject;
}
/* synchronisation */
/* Tree
{
SyncLastModseq = x;
SyncLastSynchronisationDate = x; ** not updated until something changed
Messages = {
MessageKey = {
Version = x;
Modseq = x;
Deleted = b;
ChangeKey = d;
PredecessorChangeList = { guid1 = globcnt1, guid2 ... };
};
...
};
VersionMapping = {
Version = last-modified;
...
}
}
*/
- (void) _setChangeKey: (NSData *) changeKey
forMessageEntry: (NSMutableDictionary *) messageEntry
{
struct XID *xid;
NSString *guid;
NSData *globCnt;
NSDictionary *changeKeyDict;
NSMutableDictionary *changeList;
xid = [changeKey asXIDInMemCtx: NULL];
guid = [NSString stringWithGUID: &xid->NameSpaceGuid];
globCnt = [NSData dataWithBytes: xid->LocalId.data length: xid->LocalId.length];
talloc_free (xid);
/* 1. set change key association */
changeKeyDict = [NSDictionary dictionaryWithObjectsAndKeys: guid, @"GUID",
globCnt, @"LocalId",
nil];
[messageEntry setObject: changeKeyDict forKey: @"ChangeKey"];
/* 2. append/update predecessor change list */
changeList = [messageEntry objectForKey: @"PredecessorChangeList"];
if (!changeList)
{
changeList = [NSMutableDictionary new];
[messageEntry setObject: changeList
forKey: @"PredecessorChangeList"];
[changeList release];
}
[changeList setObject: globCnt forKey: guid];
}
- (void) _updatePredecessorChangeList: (NSData *) predecessorChangeList
forMessageEntry: (NSMutableDictionary *) messageEntry
withOldChangeKey: (NSData *) oldChangeKey
{
NSData *globCnt, *oldGlobCnt;
NSDictionary *changeKeyDict;
NSString *guid;
NSMutableDictionary *changeList;
struct SizedXid *sizedXIDList;
struct XID xid, *givenChangeKey;
TALLOC_CTX *localMemCtx;
uint32_t i, length;
localMemCtx = talloc_new (NULL);
if (!localMemCtx)
{
[self errorWithFormat: @"No more memory"];
return;
}
if (predecessorChangeList)
{
sizedXIDList = [predecessorChangeList asSizedXidArrayInMemCtx: localMemCtx with: &length];
changeList = [messageEntry objectForKey: @"PredecessorChangeList"];
if (!changeList)
{
changeList = [NSMutableDictionary new];
[messageEntry setObject: changeList
forKey: @"PredecessorChangeList"];
[changeList release];
}
if (sizedXIDList) {
for (i = 0; i < length; i++)
{
xid = sizedXIDList[i].XID;
guid = [NSString stringWithGUID: &xid.NameSpaceGuid];
globCnt = [NSData dataWithBytes: xid.LocalId.data length: xid.LocalId.length];
oldGlobCnt = [changeList objectForKey: guid];
if (!oldGlobCnt || ([globCnt compare: oldGlobCnt] == NSOrderedDescending))
[changeList setObject: globCnt forKey: guid];
}
}
}
if (oldChangeKey)
{
givenChangeKey = [oldChangeKey asXIDInMemCtx: localMemCtx];
if (givenChangeKey) {
guid = [NSString stringWithGUID: &givenChangeKey->NameSpaceGuid];
globCnt = [NSData dataWithBytes: givenChangeKey->LocalId.data length: givenChangeKey->LocalId.length];
changeKeyDict = [messageEntry objectForKey: @"ChangeKey"];
if (!changeKeyDict ||
([guid isEqualToString: [changeKeyDict objectForKey: @"GUID"]]
&& ([globCnt compare: [changeKeyDict objectForKey: @"LocalId"]] == NSOrderedDescending)))
{
/* The given change key is greater than current one stored in
metadata or it does not exist */
[messageEntry setObject: [NSDictionary dictionaryWithObjectsAndKeys: guid, @"GUID",
globCnt, @"LocalId",
nil]
forKey: @"ChangeKey"];
}
}
}
talloc_free (localMemCtx);
}
- (EOQualifier *) componentQualifier
{
if (!componentQualifier)
componentQualifier
= [[EOKeyValueQualifier alloc] initWithKey: @"c_component"
operatorSelector: EOQualifierOperatorEqual
value: [self component]];
return componentQualifier;
}
- (EOQualifier *) contentComponentQualifier
{
EOQualifier *contentComponentQualifier;
NSString *likeString;
likeString = [NSString stringWithFormat: @"%%BEGIN:%@%%",
[[self component] uppercaseString]];
contentComponentQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_content"
operatorSelector: EOQualifierOperatorLike
value: likeString];
[contentComponentQualifier autorelease];
return contentComponentQualifier;
}
- (BOOL) synchroniseCache
{
BOOL rc = YES;
uint64_t newChangeNum;
NSData *changeKey;
NSString *cName, *changeNumber;
NSNumber *ti, *lastModificationDate, *cVersion, *cLastModified, *cDeleted;
EOFetchSpecification *fs;
EOQualifier *searchQualifier, *fetchQualifier;
NSUInteger count, max;
NSArray *fetchResults, *changeNumbers;
NSMutableArray *keys, *modifiedEntries;
NSDictionary *result;
NSMutableDictionary *currentProperties, *messages, *mapping, *messageEntry;
NSCalendarDate *now;
GCSFolder *ocsFolder;
static NSArray *fields = nil;
static EOSortOrdering *sortOrdering = nil;
/* NOTE: we are using NSString instance for "changeNumber" because
NSNumber proved to give very bad performances when used as NSDictionary
keys with GNUstep 1.22.1. The bug seems to be solved with 1.24 but many
distros still ship an older version. */
if (!fields)
fields = [[NSArray alloc]
initWithObjects: @"c_name", @"c_version", @"c_lastmodified",
@"c_deleted", nil];
if (!sortOrdering)
{
sortOrdering = [EOSortOrdering sortOrderingWithKey: @"c_lastmodified"
selector: EOCompareAscending];
[sortOrdering retain];
}
[versionsMessage reloadIfNeeded];
currentProperties = [versionsMessage properties];
lastModificationDate = [currentProperties objectForKey: @"SyncLastModificationDate"];
if (lastModificationDate)
{
searchQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_lastmodified"
operatorSelector: EOQualifierOperatorGreaterThanOrEqualTo
value: lastModificationDate];
fetchQualifier = [[EOAndQualifier alloc]
initWithQualifiers: searchQualifier,
[self contentComponentQualifier],
nil];
[fetchQualifier autorelease];
[searchQualifier release];
}
else
fetchQualifier = [self componentQualifier];
ocsFolder = [sogoObject ocsFolder];
fs = [EOFetchSpecification
fetchSpecificationWithEntityName: [ocsFolder folderName]
qualifier: fetchQualifier
sortOrderings: [NSArray arrayWithObject: sortOrdering]];
fetchResults = [ocsFolder fetchFields: fields
fetchSpecification: fs
ignoreDeleted: NO];
max = [fetchResults count];
if (max > 0)
{
messages = [currentProperties objectForKey: @"Messages"];
if (!messages)
{
messages = [NSMutableDictionary new];
[currentProperties setObject: messages forKey: @"Messages"];
[messages release];
}
mapping = [currentProperties objectForKey: @"VersionMapping"];
if (!mapping)
{
mapping = [NSMutableDictionary new];
[currentProperties setObject: mapping forKey: @"VersionMapping"];
[mapping release];
}
keys = [NSMutableArray arrayWithCapacity: max];
modifiedEntries = [NSMutableArray arrayWithCapacity: max];
for (count = 0; count < max; count++)
{
result = [fetchResults objectAtIndex: count];
cName = [result objectForKey: @"c_name"];
[keys addObject: cName];
cDeleted = [result objectForKey: @"c_deleted"];
if ([cDeleted isKindOfClass: NSNumberK] && [cDeleted intValue])
cVersion = [NSNumber numberWithInt: -1];
else
cVersion = [result objectForKey: @"c_version"];
cLastModified = [result objectForKey: @"c_lastmodified"];
messageEntry = [messages objectForKey: cName];
if (!messageEntry)
{
messageEntry = [NSMutableDictionary new];
[messages setObject: messageEntry forKey: cName];
[messageEntry release];
}
if (![[messageEntry objectForKey: @"c_version"]
isEqual: cVersion])
{
[sogoObject removeChildRecordWithName: cName];
[modifiedEntries addObject: messageEntry];
[messageEntry setObject: cLastModified forKey: @"c_lastmodified"];
[messageEntry setObject: cVersion forKey: @"c_version"];
if (!lastModificationDate
|| ([lastModificationDate compare: cLastModified]
== NSOrderedAscending))
lastModificationDate = cLastModified;
}
}
/* make sure all returned objects have a corresponding mid */
[self ensureIDsForChildKeys: keys];
max = [modifiedEntries count];
if (max > 0)
{
changeNumbers = [[self context] getNewChangeNumbers: max];
for (count = 0; count < max; count++)
{
messageEntry = [modifiedEntries objectAtIndex: count];
changeNumber = [changeNumbers objectAtIndex: count];
cLastModified = [messageEntry objectForKey: @"c_lastmodified"];
[mapping setObject: cLastModified forKey: changeNumber];
[messageEntry setObject: changeNumber forKey: @"version"];
newChangeNum = [changeNumber unsignedLongLongValue];
// A GLOBCNT structure is a 6-byte global namespace counter,
// we strip the first 2 bytes. The first two bytes is the ReplicaId
changeKey = [self getReplicaKeyFromGlobCnt: newChangeNum >> 16];
[self _setChangeKey: changeKey forMessageEntry: messageEntry];
}
now = [NSCalendarDate date];
ti = [NSNumber numberWithDouble: [now timeIntervalSince1970]];
[currentProperties setObject: ti
forKey: @"SyncLastSynchronisationDate"];
[currentProperties setObject: lastModificationDate
forKey: @"SyncLastModificationDate"];
[versionsMessage save];
}
}
return rc;
}
- (BOOL) synchroniseCacheFor: (NSString *) nameInContainer
{
/* Try to synchronise old messages in versions.plist cache using an
specific c_name. It returns a boolean indicating if the
synchronisation was carried out succesfully.
It should be used as last resort, keeping synchroniseCache as the
main sync entry point. */
uint64_t changeNumber;
NSString *changeNumberStr;
NSData *changeKey;
NSNumber *cLastModified, *cDeleted, *cVersion;
EOFetchSpecification *fs;
EOQualifier *searchQualifier, *fetchQualifier;
NSArray *fetchResults;
NSDictionary *result;
NSMutableDictionary *currentProperties, *messages, *mapping, *messageEntry;
GCSFolder *ocsFolder;
static NSArray *fields;
[versionsMessage reloadIfNeeded];
currentProperties = [versionsMessage properties];
messages = [currentProperties objectForKey: @"Messages"];
if (!messages)
{
messages = [NSMutableDictionary new];
[currentProperties setObject: messages forKey: @"Messages"];
[messages release];
}
messageEntry = [messages objectForKey: nameInContainer];
if (!messageEntry)
{
/* Fetch the message by its name */
if (!fields)
fields = [[NSArray alloc]
initWithObjects: @"c_name", @"c_version", @"c_lastmodified",
@"c_deleted", nil];
searchQualifier = [[EOKeyValueQualifier alloc] initWithKey: @"c_name"
operatorSelector: EOQualifierOperatorEqual
value: nameInContainer];
fetchQualifier = [[EOAndQualifier alloc]
initWithQualifiers: searchQualifier,
[self contentComponentQualifier],
nil];
[fetchQualifier autorelease];
[searchQualifier release];
ocsFolder = [sogoObject ocsFolder];
fs = [EOFetchSpecification
fetchSpecificationWithEntityName: [ocsFolder folderName]
qualifier: fetchQualifier
sortOrderings: nil];
fetchResults = [ocsFolder fetchFields: fields
fetchSpecification: fs
ignoreDeleted: NO];
if ([fetchResults count] == 1)
{
result = [fetchResults objectAtIndex: 0];
cLastModified = [result objectForKey: @"c_lastmodified"];
cDeleted = [result objectForKey: @"c_deleted"];
if ([cDeleted isKindOfClass: NSNumberK] && [cDeleted intValue])
cVersion = [NSNumber numberWithInt: -1];
else
cVersion = [result objectForKey: @"c_version"];
changeNumber = [[self context] getNewChangeNumber];
changeNumberStr = [NSString stringWithUnsignedLongLong: changeNumber];
/* Create new message entry in Messages dict */
messageEntry = [NSMutableDictionary new];
[messages setObject: messageEntry forKey: nameInContainer];
[messageEntry release];
/* Store cLastModified, cVersion and the change number */
[messageEntry setObject: cLastModified forKey: @"c_lastmodified"];
[messageEntry setObject: cVersion forKey: @"c_version"];
[messageEntry setObject: changeNumberStr forKey: @"version"];
/* Store the change key */
changeKey = [self getReplicaKeyFromGlobCnt: changeNumber >> 16];
[self _setChangeKey: changeKey forMessageEntry: messageEntry];
/* Store the changeNumber -> cLastModified mapping */
mapping = [currentProperties objectForKey: @"VersionMapping"];
if (!mapping)
{
mapping = [NSMutableDictionary new];
[currentProperties setObject: mapping forKey: @"VersionMapping"];
[mapping release];
}
[mapping setObject: cLastModified forKey: changeNumberStr];
/* Save the message */
[versionsMessage save];
return YES;
}
else
return NO;
}
/* If message entry exists, then synchroniseCache did its job */
return YES;
}
- (void) updateVersionsForMessageWithKey: (NSString *) messageKey
withChangeKey: (NSData *) oldChangeKey
andPredecessorChangeList: (NSData *) pcl
{
NSMutableDictionary *messages, *messageEntry;
[self synchroniseCache];
if (oldChangeKey || pcl)
{
messages = [[versionsMessage properties] objectForKey: @"Messages"];
messageEntry = [messages objectForKey: messageKey];
if (!messageEntry)
[NSException raise: @"MAPIStoreIOException"
format: @"no version record found for message '%@'",
messageKey];
[self _updatePredecessorChangeList: pcl forMessageEntry: messageEntry
withOldChangeKey: oldChangeKey];
[versionsMessage save];
}
}
- (NSNumber *) lastModifiedFromMessageChangeNumber: (NSString *) changeNumber
{
NSDictionary *mapping;
NSNumber *lastModified;
mapping = [[versionsMessage properties] objectForKey: @"VersionMapping"];
lastModified = [mapping objectForKey: changeNumber];
return lastModified;
}
- (NSString *) changeNumberForMessageWithKey: (NSString *) messageKey
{
NSDictionary *messages;
NSString *changeNumber;
messages = [[versionsMessage properties] objectForKey: @"Messages"];
changeNumber = [[messages objectForKey: messageKey]
objectForKey: @"version"];
return changeNumber;
}
- (NSData *) changeKeyForMessageWithKey: (NSString *) messageKey
{
NSDictionary *messages, *changeKeyDict;
NSString *guid;
NSData *globCnt, *changeKey = nil;
messages = [[versionsMessage properties] objectForKey: @"Messages"];
changeKeyDict = [[messages objectForKey: messageKey]
objectForKey: @"ChangeKey"];
if (changeKeyDict)
{
guid = [changeKeyDict objectForKey: @"GUID"];
globCnt = [changeKeyDict objectForKey: @"LocalId"];
changeKey = [NSData dataWithChangeKeyGUID: guid andCnt: globCnt];
}
return changeKey;
}
- (NSData *) predecessorChangeListForMessageWithKey: (NSString *) messageKey
{
NSMutableData *list = nil;
NSDictionary *messages, *changeListDict;
NSArray *keys;
NSMutableArray *changeKeys;
NSUInteger count, max;
NSData *changeKey;
NSString *guid;
NSData *globCnt;
messages = [[versionsMessage properties] objectForKey: @"Messages"];
changeListDict = [[messages objectForKey: messageKey]
objectForKey: @"PredecessorChangeList"];
if (changeListDict)
{
keys = [changeListDict allKeys];
max = [keys count];
changeKeys = [NSMutableArray arrayWithCapacity: max];
for (count = 0; count < max; count++)
{
guid = [keys objectAtIndex: count];
globCnt = [changeListDict objectForKey: guid];
changeKey = [NSData dataWithChangeKeyGUID: guid andCnt: globCnt];
[changeKeys addObject: changeKey];
}
[changeKeys sortUsingFunction: MAPIChangeKeyGUIDCompare
context: nil];
list = [NSMutableData data];
for (count = 0; count < max; count++)
{
changeKey = [changeKeys objectAtIndex: count];
[list appendUInt8: [changeKey length]];
[list appendData: changeKey];
}
}
return list;
}
- (NSArray *) getDeletedKeysFromChangeNumber: (uint64_t) changeNum
andCN: (NSNumber **) cnNbr
inTableType: (uint8_t) tableType
{
NSArray *deletedKeys, *deletedCNames, *records;
NSNumber *lastModified;
NSString *cName, *changeNumber;
NSDictionary *versionProperties, *messageEntry;
NSMutableDictionary *messages;
uint64_t maxChangeNum = changeNum, currentChangeNum;
EOAndQualifier *fetchQualifier;
EOKeyValueQualifier *cDeletedQualifier, *cLastModifiedQualifier;
EOFetchSpecification *fs;
GCSFolder *ocsFolder;
NSUInteger count, max;
if (tableType == MAPISTORE_MESSAGE_TABLE)
{
deletedKeys = [NSMutableArray array];
changeNumber = [NSString stringWithUnsignedLongLong: changeNum];
lastModified = [self lastModifiedFromMessageChangeNumber: changeNumber];
if (lastModified)
{
versionProperties = [versionsMessage properties];
messages = [versionProperties objectForKey: @"Messages"];
ocsFolder = [sogoObject ocsFolder];
cLastModifiedQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_lastmodified"
operatorSelector: EOQualifierOperatorGreaterThanOrEqualTo
value: lastModified];
cDeletedQualifier = [[EOKeyValueQualifier alloc]
initWithKey: @"c_deleted"
operatorSelector: EOQualifierOperatorEqual
value: [NSNumber numberWithInt: 1]];
fetchQualifier = [[EOAndQualifier alloc] initWithQualifiers:
cLastModifiedQualifier,
cDeletedQualifier,
nil];
[fetchQualifier autorelease];
[cLastModifiedQualifier release];
[cDeletedQualifier release];
fs = [EOFetchSpecification
fetchSpecificationWithEntityName: [ocsFolder folderName]
qualifier: fetchQualifier
sortOrderings: nil];
records = [ocsFolder
fetchFields: [NSArray arrayWithObject: @"c_name"]
fetchSpecification: fs
ignoreDeleted: NO];
deletedCNames = [records objectsForKey: @"c_name" notFoundMarker: nil];
max = [deletedCNames count];
for (count = 0; count < max; count++)
{
cName = [deletedCNames objectAtIndex: count];
[sogoObject removeChildRecordWithName: cName];
messageEntry = [messages objectForKey: cName];
if (messageEntry)
{
currentChangeNum
= [[messageEntry objectForKey: @"version"]
unsignedLongLongValue];
if (MAPICNCompare (changeNum, currentChangeNum, NULL)
== NSOrderedAscending)
{
[(NSMutableArray *) deletedKeys addObject: cName];
if (MAPICNCompare (maxChangeNum, currentChangeNum, NULL)
== NSOrderedAscending)
maxChangeNum = currentChangeNum;
}
}
}
if (maxChangeNum != changeNum)
*cnNbr = [NSNumber numberWithUnsignedLongLong: maxChangeNum];
}
}
else
deletedKeys = [super getDeletedKeysFromChangeNumber: changeNum
andCN: cnNbr
inTableType: tableType];
return deletedKeys;
}
- (NSArray *) activeUserRoles
{
SOGoUser *activeUser;
WOContext *woContext;
if (!activeUserRoles)
{
activeUser = [[self context] activeUser];
woContext = [[self userContext] woContext];
activeUserRoles = [activeUser rolesForObject: sogoObject
inContext: woContext];
activeUserRoles = [self expandRoles: activeUserRoles];
[activeUserRoles retain];
}
return activeUserRoles;
}
- (BOOL) subscriberCanCreateMessages
{
return [[self activeUserRoles] containsObject: SOGoRole_ObjectCreator];
}
- (BOOL) subscriberCanDeleteMessages
{
return [[self activeUserRoles] containsObject: SOGoRole_ObjectEraser];
}
/* subclasses */
- (EOQualifier *) aclQualifier
{
return nil;
}
- (NSString *) component
{
[self subclassResponsibility: _cmd];
return nil;
}
@end
-264
View File
@@ -1,264 +0,0 @@
/* MAPIStoreGCSMessage.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/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>
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import "MAPIStoreContext.h"
#import "MAPIStoreGCSFolder.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreUserContext.h"
#import "NSData+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreGCSMessage.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreGCSMessage
- (NSDate *) creationTime
{
return [sogoObject creationDate];
}
- (NSDate *) lastModificationTime
{
return [sogoObject lastModified];
}
- (enum mapistore_error) getPidTagCreatorName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc;
NSString *creator;
creator = [self creator];
if (creator)
{
*data = [creator asUnicodeInMemCtx: memCtx];
rc = MAPISTORE_SUCCESS;
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
return rc;
}
- (enum mapistore_error) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSData *changeKey;
MAPIStoreGCSFolder *parentFolder;
NSString *nameInContainer;
if (isNew)
rc = MAPISTORE_ERR_NOT_FOUND;
else
{
parentFolder = (MAPIStoreGCSFolder *)[self container];
nameInContainer = [self nameInContainer];
changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer];
if (!changeKey)
{
[parentFolder synchroniseCache];
changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer];
}
if (changeKey)
*data = [changeKey asBinaryInMemCtx: memCtx];
else
{
[self warnWithFormat: @"No change key for %@ in folder %@",
nameInContainer,
[parentFolder url]
];
rc = MAPISTORE_ERR_NOT_FOUND;
}
}
return rc;
}
- (enum mapistore_error) getPidTagPredecessorChangeList: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
enum mapistore_error rc = MAPISTORE_SUCCESS;
NSData *changeList;
MAPIStoreGCSFolder *parentFolder;
if (isNew)
rc = MAPISTORE_ERR_NOT_FOUND;
else
{
parentFolder = (MAPIStoreGCSFolder *)[self container];
changeList = [parentFolder
predecessorChangeListForMessageWithKey: [self nameInContainer]];
if (!changeList)
{
[parentFolder synchroniseCache];
changeList = [parentFolder
predecessorChangeListForMessageWithKey: [self nameInContainer]];
}
if (!changeList)
abort ();
*data = [changeList asBinaryInMemCtx: memCtx];
}
return rc;
}
- (uint64_t) objectVersion
{
uint64_t version = ULLONG_MAX;
NSString *changeNumber;
BOOL synced;
if (!isNew)
{
changeNumber = [(MAPIStoreGCSFolder *) container
changeNumberForMessageWithKey: [self nameInContainer]];
if (!changeNumber)
{
[self warnWithFormat: @"attempting to get change number"
@" by synchronising folder..."];
synced = [(MAPIStoreGCSFolder *) container synchroniseCache];
if (synced)
{
changeNumber = [(MAPIStoreGCSFolder *) container
changeNumberForMessageWithKey: [self nameInContainer]];
}
if (!changeNumber)
{
[self warnWithFormat: @"attempting to get change number"
@" by synchronising this specific message..."];
synced = [(MAPIStoreGCSFolder *) container
synchroniseCacheFor: [self nameInContainer]];
if (synced)
{
changeNumber = [(MAPIStoreGCSFolder *) container
changeNumberForMessageWithKey: [self nameInContainer]];
}
if (!changeNumber)
{
[self errorWithFormat: @"still nothing. We crash!"];
abort();
}
}
}
version = [changeNumber unsignedLongLongValue] >> 16;
}
return version;
}
- (void) updateVersions
{
/* Update ChangeKey and PredecessorChangeList on message's save */
NSData *newChangeKey, *predecessorChangeList;
newChangeKey = [properties objectForKey: MAPIPropertyKey (PR_CHANGE_KEY)];
predecessorChangeList = [properties objectForKey: MAPIPropertyKey (PR_PREDECESSOR_CHANGE_LIST)];
[(MAPIStoreGCSFolder *) container
updateVersionsForMessageWithKey: [self nameInContainer]
withChangeKey: newChangeKey
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
@@ -1,36 +0,0 @@
/* MAPIStoreGCSMessageTable.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREGCSMESSAGETABLE_H
#define MAPISTOREGCSMESSAGETABLE_H
#import "MAPIStoreMessageTable.h"
@class EOQualifier;
@interface MAPIStoreGCSMessageTable : MAPIStoreMessageTable
- (NSString *) sortIdentifierForProperty: (enum MAPITAGS) property;
@end
#endif /* MAPISTOREGCSMESSAGETABLE_H */
-260
View File
@@ -1,260 +0,0 @@
/* MAPIStoreGCSMessageTable.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSCalendarDate.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSString.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NSObject+Values.h>
#import <EOControl/EOFetchSpecification.h>
#import <EOControl/EOQualifier.h>
#import <EOControl/EOSortOrdering.h>
#import <GDLContentStore/GCSFolder.h>
#import <SOGo/NSArray+Utilities.h>
#import <SOGo/SOGoGCSFolder.h>
#import "MAPIStoreTypes.h"
#import "MAPIStoreGCSFolder.h"
#import "MAPIStoreGCSMessageTable.h"
#undef DEBUG
#include <mapistore/mapistore.h>
@implementation MAPIStoreGCSMessageTable
- (void) cleanupCaches
{
[(MAPIStoreGCSFolder *) container synchroniseCache];
[super cleanupCaches];
}
- (struct mapi_SPropertyRestriction *) _fixedDatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
inMemCtx: (TALLOC_CTX *) memCtx
{
struct mapi_SPropertyRestriction *translatedRes;
NSCalendarDate *dateValue;
int32_t longDate;
translatedRes = talloc (memCtx, struct mapi_SPropertyRestriction);
translatedRes->ulPropTag = (res->ulPropTag & 0xffff0000) | PT_LONG;
translatedRes->relop = res->relop;
dateValue = NSObjectFromMAPISPropValue (&res->lpProp);
longDate = (int32_t) [dateValue timeIntervalSince1970];
translatedRes->lpProp.ulPropTag = translatedRes->ulPropTag;
translatedRes->lpProp.value.l = longDate;
return translatedRes;
}
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
static SEL operators[] = { EOQualifierOperatorLessThan,
EOQualifierOperatorLessThanOrEqualTo,
EOQualifierOperatorGreaterThan,
EOQualifierOperatorGreaterThanOrEqualTo,
EOQualifierOperatorEqual,
EOQualifierOperatorNotEqual,
EOQualifierOperatorContains };
SEL operator;
id value;
NSString *property;
NSNumber *lastModified;
MAPIRestrictionState rc;
TALLOC_CTX *memCtx = NULL;
if (res->ulPropTag == PidTagChangeNumber)
{
NSString *changeNumber;
value = NSObjectFromMAPISPropValue (&res->lpProp);
changeNumber = [NSString stringWithUnsignedLongLong: [(NSNumber *)value unsignedLongLongValue]];
lastModified = [(MAPIStoreGCSFolder *)
container lastModifiedFromMessageChangeNumber: changeNumber];
//[self logWithFormat: @"change number from oxcfxics: %.16lx", [value unsignedLongLongValue]];
//[self logWithFormat: @" c_lastmodified: %@", lastModified];
if (lastModified)
{
SEL operator;
operator = [self operatorFromRestrictionOperator: res->relop];
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: @"c_lastmodified"
operatorSelector: operator
value: lastModified];
[*qualifier autorelease];
rc = MAPIRestrictionStateNeedsEval;
}
else
{
[self logWithFormat: @"No last modified found for: 0x%.16"PRIx64". Then no restriction applied",
[value unsignedLongLongValue]];
rc = MAPIRestrictionStateAlwaysTrue;
}
}
else
{
property = [self backendIdentifierForProperty: res->ulPropTag];
if (property)
{
if (res->relop < 7)
operator = operators[res->relop];
else
{
operator = NULL;
[NSException raise: @"MAPIStoreRestrictionException"
format: @"unhandled operator type number %d", res->relop];
}
if ((res->ulPropTag & 0xffff) == PT_SYSTIME)
{
memCtx = talloc_zero (NULL, TALLOC_CTX);
res = [self _fixedDatePropertyRestriction: res
inMemCtx: memCtx];
}
value = NSObjectFromMAPISPropValue (&res->lpProp);
if ((res->ulPropTag & 0xffff) == PT_UNICODE)
{
property = [NSString stringWithFormat: @"UPPER(%@)", property];
value = [value uppercaseString];
}
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: property
operatorSelector: operator
value: value];
[*qualifier autorelease];
if (memCtx)
talloc_free (memCtx);
rc = MAPIRestrictionStateNeedsEval;
}
else
{
[self warnUnhandledProperty: res->ulPropTag
inFunction: __FUNCTION__];
rc = MAPIRestrictionStateAlwaysFalse;
}
}
return rc;
}
/* sorting */
- (EOSortOrdering *) _sortOrderingFromSortOrder: (struct SSortOrder *) sortOrder
{
EOSortOrdering *newSortOrdering = nil;
NSString *sortIdentifier;
SEL orderSelector = NULL;
const char *propName;
sortIdentifier = [self sortIdentifierForProperty: sortOrder->ulPropTag];
if (sortIdentifier)
{
if ((sortOrder->ulPropTag & 0xffff) == PT_UNICODE
|| (sortOrder->ulPropTag & 0xffff) == PT_STRING8)
{
if (sortOrder->ulOrder == TABLE_SORT_ASCEND)
orderSelector = EOCompareCaseInsensitiveAscending;
else if (sortOrder->ulOrder == TABLE_SORT_DESCEND)
orderSelector = EOCompareCaseInsensitiveDescending;
else if (sortOrder->ulOrder == TABLE_SORT_MAXIMUM_CATEGORY)
{
orderSelector = EOCompareCaseInsensitiveAscending;
[self errorWithFormat:
@"TABLE_SORT_MAXIMUM_CATEGORY is not handled"];
}
}
else
{
if (sortOrder->ulOrder == TABLE_SORT_ASCEND)
orderSelector = EOCompareAscending;
else if (sortOrder->ulOrder == TABLE_SORT_DESCEND)
orderSelector = EOCompareDescending;
else if (sortOrder->ulOrder == TABLE_SORT_MAXIMUM_CATEGORY)
{
orderSelector = EOCompareAscending;
[self errorWithFormat:
@"TABLE_SORT_MAXIMUM_CATEGORY is not handled"];
}
}
if (orderSelector)
newSortOrdering = [EOSortOrdering sortOrderingWithKey: sortIdentifier
selector: orderSelector];
}
else
{
propName = get_proptag_name (sortOrder->ulPropTag);
if (!propName)
propName = "<unknown>";
[self errorWithFormat:
@"sort unhandled for property: %s (0x%.8x)",
propName, sortOrder->ulPropTag];
}
return newSortOrdering;
}
- (void) setSortOrder: (const struct SSortOrderSet *) set
{
NSMutableArray *newSortOrderings;
EOSortOrdering *sortOrdering;
uint16_t count;
if (set)
{
newSortOrderings = [NSMutableArray arrayWithCapacity: set->cSorts];
/* TODO: */
if (set->cCategories > 0)
[self errorWithFormat: @"we don't handle sort categories yet"];
for (count = 0; count < set->cSorts; count++)
{
sortOrdering = [self _sortOrderingFromSortOrder: set->aSort + count];
if (sortOrdering)
[newSortOrderings addObject: sortOrdering];
}
}
else
newSortOrderings = nil;
ASSIGN (sortOrderings, newSortOrderings);
[self cleanupCaches];
[self logWithFormat: @"new sort orderings: %@", sortOrderings];
}
/* subclasses */
- (NSString *) sortIdentifierForProperty: (enum MAPITAGS) property
{
[self subclassResponsibility: _cmd];
return nil;
}
@end
-37
View File
@@ -1,37 +0,0 @@
/* MAPIStoreMIME.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREMIME_H
#define MAPISTOREMIME_H
@interface MAPIStoreMIME : NSObject
{
NSMutableDictionary *mimeDict;
}
+ (id) sharedMAPIStoreMIME;
- (NSString *) mimeTypeForExtension: (NSString *) extension;
@end
#endif /* MAPISTOREMIME_H */
-154
View File
@@ -1,154 +0,0 @@
/* MAPIStoreMIME.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSData.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSFileHandle.h>
#import <Foundation/NSString.h>
#import "MAPIStoreMIME.h"
/* Seems common to all distros ? */
#define MAPIStoreMIMEFile @"/etc/mime.types"
@implementation MAPIStoreMIME
+ (id) sharedMAPIStoreMIME
{
static MAPIStoreMIME *sharedInstance = nil;
if (!sharedInstance)
sharedInstance = [self new];
return sharedInstance;
}
- (void) _parseLine: (const char *) line
withLength: (NSUInteger) length
{
NSUInteger count = 0, lastWord = 0;
NSString *mimeType = nil, *word;
NSData *wordData;
BOOL comment = NO;
while (count < length && !comment)
{
while (count < length
&& (line[count] == ' ' || line[count] == '\t'))
count++;
lastWord = count;
while (count < length
&& line[count] != ' ' && line[count] != '\t'
&& !comment)
{
if (line[count] == '#')
comment = YES;
else
count++;
}
if (count > lastWord)
{
wordData = [NSData dataWithBytes: line + lastWord
length: count - lastWord];
word = [[NSString alloc] initWithData: wordData
encoding: NSASCIIStringEncoding];
if (word)
{
if (mimeType)
{
[mimeDict setObject: mimeType forKey: word];
[word release];
}
else
mimeType = word;
}
}
}
[mimeType release];
}
- (void) _parseContent: (NSData *) content
{
const char *data;
NSUInteger lineStart = 0, bytesRead = 0, max;
data = [content bytes];
max = [content length];
bytesRead = 0;
lineStart = 0;
while (bytesRead < max)
{
if (data[bytesRead] == '\n')
{
[self _parseLine: data + lineStart withLength: bytesRead - lineStart];
lineStart = bytesRead + 1;
}
else if (data[bytesRead] == '\r')
{
[self _parseLine: data + lineStart withLength: bytesRead - lineStart];
if (bytesRead < (max - 1) && data[bytesRead] == '\n')
lineStart = bytesRead + 2;
else
lineStart = bytesRead + 1;
}
bytesRead++;
}
if (bytesRead > (lineStart + 1))
[self _parseLine: data + lineStart withLength: bytesRead - lineStart];
}
- (void) _readMIMEFile
{
NSFileHandle *inH;
NSData *content;
inH = [NSFileHandle fileHandleForReadingAtPath: MAPIStoreMIMEFile];
content = [inH readDataToEndOfFile];
[self _parseContent: content];
}
- (id) init
{
if ((self = [super init]))
{
mimeDict = [NSMutableDictionary new];
[self _readMIMEFile];
}
return self;
}
- (void) dealloc
{
[mimeDict release];
[super dealloc];
}
- (NSString *) mimeTypeForExtension: (NSString *) extension
{
return [mimeDict objectForKey: [extension lowercaseString]];
}
@end
@@ -1,41 +0,0 @@
/* MAPIStoreMailAttachment.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREMAILATTACHMENT_H
#define MAPISTOREMAILATTACHMENT_H
#import "MAPIStoreAttachment.h"
@class NSDictionary;
@interface MAPIStoreMailAttachment : MAPIStoreAttachment
{
NSDictionary *bodyInfo;
SOGoMailBodyPart *bodyPart;
}
- (void) setBodyInfo: (NSDictionary *) newBodyInfo;
- (void) setBodyPart: (SOGoMailBodyPart *) newBodyPart;
@end
#endif /* MAPISTOREMAILATTACHMENT_H */
-204
View File
@@ -1,204 +0,0 @@
/* MAPIStoreMailAttachment.m - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSCalendarDate.h>
#import <Foundation/NSData.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
#import <NGExtensions/NSObject+Logs.h>
#import <SOGo/NSArray+Utilities.h>
#import <Mailer/SOGoMailBodyPart.h>
#import <Mailer/SOGoMailObject.h>
#import <Mailer/NSDictionary+Mail.h>
#import "MAPIStoreTypes.h"
#import "MAPIStoreMailMessage.h"
#import "NSData+MAPIStore.h"
#import "NSDate+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreMailAttachment.h"
#undef DEBUG
#include <stdbool.h>
#include <gen_ndr/exchange.h>
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreMailAttachment
- (id) init
{
if ((self = [super init]))
{
bodyInfo = nil;
bodyPart = nil;
}
return self;
}
- (void) dealloc
{
[bodyInfo release];
[bodyPart release];
[super dealloc];
}
- (void) setBodyInfo: (NSDictionary *) newBodyInfo
{
ASSIGN (bodyInfo, newBodyInfo);
}
- (void) setBodyPart: (SOGoMailBodyPart *) newBodyPart
{
ASSIGN (bodyPart, newBodyPart);
}
- (enum mapistore_error) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00000001); // afByValue
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachTag: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self mimeAttachTag] asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachSize: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
uint32_t longValue;
longValue = [[bodyInfo objectForKey: @"size"] longValue];
*data = MAPILongValue (memCtx, longValue);
return MAPISTORE_SUCCESS;
}
- (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,
0x68};
*data = [[NSData dataWithBytes: recordBytes length: 16]
asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (NSString *) _fileName
{
return [bodyInfo filename];
}
- (enum mapistore_error) getPidTagAttachLongFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self _fileName] asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *fileName, *baseName, *ext;
fileName = [self _fileName];
baseName = [fileName stringByDeletingPathExtension];
if ([baseName length] > 8)
baseName = [baseName substringToIndex: 8];
ext = [fileName pathExtension];
if ([ext length] > 3)
ext = [ext substringToIndex: 3];
fileName = [NSString stringWithFormat: @"%@.%@", baseName, ext];
*data = [fileName asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *fileName;
fileName = [self _fileName];
if ([fileName isEqualToString: @"sharing_metadata.xml"])
/* Required to disallow user from seeing the attachment by default */
*data = [@"sharing_metadata.xml" asUnicodeInMemCtx: memCtx];
else
*data = [[bodyInfo objectForKey: @"description"]
asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachContentId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[bodyInfo objectForKey: @"bodyId"]
asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachMimeTag: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *mimeTag, *fileName;
fileName = [self _fileName];
if ([fileName isEqualToString: @"sharing_metadata.xml"])
/* Required by [MS-OXWSMSHR] Section 3.1.1 */
mimeTag = [NSString stringWithFormat: @"application/x-sharing-metadata-xml"];
else
mimeTag = [NSString stringWithFormat: @"%@/%@",
[bodyInfo objectForKey: @"type"],
[bodyInfo objectForKey: @"subtype"]];
*data = [[mimeTag lowercaseString] asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (enum mapistore_error) getPidTagAttachDataBinary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[bodyPart fetchBLOBWithPeek: YES] asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
@end
-37
View File
@@ -1,37 +0,0 @@
/* MAPIStoreMailContext.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREMAILCONTEXT_H
#define MAPISTOREMAILCONTEXT_H
#import "MAPIStoreContext.h"
@interface MAPIStoreMailContext : MAPIStoreContext
- (void) updateURLWithFolderName: (NSString *) newFolderName;
@end
@interface MAPIStoreOutboxContext : MAPIStoreMailContext
@end
#endif /* MAPISTOREMAILCONTEXT_H */
-312
View File
@@ -1,312 +0,0 @@
/* MAPIStoreMailContext.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSString.h>
#import <Foundation/NSURL.h>
#import <NGImap4/NSString+Imap4.h>
#import <NGExtensions/NSString+misc.h>
#import <Mailer/SOGoMailAccount.h>
#import <Mailer/SOGoMailFolder.h>
#import "MAPIStoreMailFolder.h"
#import "MAPIStoreUserContext.h"
#import "NSString+MAPIStore.h"
#import <SOGo/NSString+Utilities.h>
#import "MAPIApplication.h"
#import "MAPIStoreMailContext.h"
#include <dlinklist.h>
#undef DEBUG
#include <mapistore/mapistore.h>
static Class MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
@implementation MAPIStoreMailContext
+ (void) initialize
{
MAPIStoreMailFolderK = [MAPIStoreMailFolder class];
MAPIStoreOutboxFolderK = [MAPIStoreOutboxFolder class];
}
+ (NSString *) MAPIModuleName
{
return @"mail";
}
+ (enum mapistore_context_role) MAPIContextRole
{
return MAPISTORE_MAIL_ROLE;
}
static inline NSString *
MakeDisplayFolderName (NSString *folderName)
{
NSArray *parts;
NSString *lastFolder;
NSUInteger max;
parts = [folderName componentsSeparatedByString: @"/"];
max = [parts count];
if (max > 1)
{
lastFolder = [parts objectAtIndex: max - 1];
if ([lastFolder length] == 0)
lastFolder = [parts objectAtIndex: max - 2];
}
else
lastFolder = folderName;
return [[lastFolder substringFromIndex: 6] fromCSSIdentifier];
}
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx
{
struct mapistore_contexts_list *firstContext = NULL, *context;
NSString *urlBase, *stringData, *currentName, *realName, *inboxName, *draftsName, *sentName, *trashName;
NSArray *unprefixedFolders;
NSMutableArray *secondaryFolders;
enum mapistore_context_role role[] = {MAPISTORE_MAIL_ROLE,
MAPISTORE_DRAFTS_ROLE,
MAPISTORE_SENTITEMS_ROLE};
NSString *folderName[3];
NSUInteger count, max;
SOGoMailAccount *accountFolder;
MAPIStoreUserContext *userContext;
WOContext *woContext;
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: indexing];
accountFolder = [[userContext rootFolders] objectForKey: @"mail"];
woContext = [userContext woContext];
inboxName = @"folderINBOX";
folderName[0] = inboxName;
unprefixedFolders = [[accountFolder draftsFolderNameInContext: woContext]
componentsSeparatedByString: @"/"];
draftsName = [NSString stringWithFormat: @"folder%@",
[unprefixedFolders componentsJoinedByString: @"/folder"]];
folderName[1] = draftsName;
unprefixedFolders = [[accountFolder sentFolderNameInContext: woContext]
componentsSeparatedByString: @"/"];
sentName = [NSString stringWithFormat: @"folder%@",
[unprefixedFolders componentsJoinedByString: @"/folder"]];
folderName[2] = sentName;
/* Note: trash is not used as a mail folder, since "Deleted Items" makes use of
the fallback context */
unprefixedFolders = [[accountFolder trashFolderNameInContext: woContext]
componentsSeparatedByString: @"/"];
trashName = [NSString stringWithFormat: @"folder%@",
[unprefixedFolders componentsJoinedByString: @"/folder"]];
urlBase = [NSString stringWithFormat: @"sogo://%@:%@@mail/",
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"]];
for (count = 0; count < 3; count++)
{
context = talloc_zero (memCtx, struct mapistore_contexts_list);
stringData = [NSString stringWithFormat: @"%@%@", urlBase,
[folderName[count] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];
context->url = [stringData asUnicodeInMemCtx: context];
/* remove "folder" prefix */
stringData = MakeDisplayFolderName (folderName[count]);
context->name = [stringData asUnicodeInMemCtx: context];
context->main_folder = true;
context->role = role[count];
context->tag = "tag";
DLIST_ADD_END (firstContext, context, void);
}
/* FIXME: Flush any cache before retrieving the hierarchy */
[accountFolder flushMailCaches];
secondaryFolders = [[accountFolder toManyRelationshipKeysWithNamespaces: NO]
mutableCopy];
[secondaryFolders autorelease];
[secondaryFolders removeObject: inboxName];
[secondaryFolders removeObject: draftsName];
[secondaryFolders removeObject: sentName];
[secondaryFolders removeObject: trashName];
max = [secondaryFolders count];
for (count = 0; count < max; count++)
{
context = talloc_zero (memCtx, struct mapistore_contexts_list);
// secondaryFolders has the names (1) Imap4Encoded ,(2) asCSSIdentifier and (3) "folder"-prefixed
// e.g.: folderProbl&AOg-mes_SP_de_SP_synchronisation
currentName = [secondaryFolders objectAtIndex: count];
// To get the real name we have to revert that (applying the decode functions
// in reverse order)
// e.g.: Problèmes de synchronisation
realName = [[[currentName substringFromIndex: 6]
fromCSSIdentifier]
stringByDecodingImap4FolderName];
// And finally to represent that as URI we have to (1) asCSSIdentifier,
// (2) Imap4Encode (3) AddPercentEscapes and (4) add the "folder" prefix
// e.g.: folderProbl&AOg-mes_SP_de_SP_synchronisation
// In the example there are no percent escapes added because is already ok
stringData = [[[realName asCSSIdentifier]
stringByEncodingImap4FolderName]
stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
stringData = [NSString stringWithFormat: @"folder%@", stringData];
context->url = [[NSString stringWithFormat: @"%@%@", urlBase, stringData] asUnicodeInMemCtx: context];
context->name = [realName asUnicodeInMemCtx: context];
context->main_folder = false;
context->role = MAPISTORE_MAIL_ROLE;
context->tag = "tag";
DLIST_ADD_END (firstContext, context, void);
}
return firstContext;
}
+ (NSString *)
createRootSecondaryFolderWithFID: (uint64_t) fid
andName: (NSString *) newFolderName
forUser: (NSString *) userName
{
NSString *mapistoreURI, *folderName;
MAPIStoreUserContext *userContext;
SOGoMailAccount *accountFolder;
SOGoMailFolder *newFolder;
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: NULL];
accountFolder = [[userContext rootFolders] objectForKey: @"mail"];
folderName = [NSString stringWithFormat: @"folder%@",
[[newFolderName stringByEncodingImap4FolderName] asCSSIdentifier]];
newFolder = [SOGoMailFolder objectWithName: folderName
inContainer: accountFolder];
if ([newFolder create])
mapistoreURI = [NSString stringWithFormat: @"sogo://%@:%@@mail/%@/",
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
[folderName stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]];
else
mapistoreURI = nil;
return mapistoreURI;
}
- (Class) MAPIStoreFolderClass
{
return MAPIStoreMailFolderK;
}
- (id) rootSOGoFolder
{
return [[userContext rootFolders] objectForKey: @"mail"];
}
- (void) updateURLWithFolderName: (NSString *) newFolderName
{
NSString *urlString, *escapedName;
NSMutableArray *pathComponents;
BOOL hasSlash;
NSUInteger max, folderNameIdx;
NSURL *newURL;
/* we do not need to unescape the url here as it will be reassembled later
in the method */
urlString = [contextUrl absoluteString];
hasSlash = [urlString hasSuffix: @"/"];
pathComponents = [[urlString componentsSeparatedByString: @"/"]
mutableCopy];
[pathComponents autorelease];
max = [pathComponents count];
if (hasSlash)
folderNameIdx = max - 2;
else
folderNameIdx = max - 1;
escapedName = [newFolderName stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
[pathComponents replaceObjectAtIndex: folderNameIdx
withObject: escapedName];
urlString = [pathComponents componentsJoinedByString: @"/"];
newURL = [NSURL URLWithString: urlString];
ASSIGN (contextUrl, newURL);
}
@end
@implementation MAPIStoreOutboxContext
+ (NSString *) MAPIModuleName
{
return @"outbox";
}
+ (struct mapistore_contexts_list *) listContextsForUser: (NSString *) userName
withIndexing: (struct indexing_context *) indexing
inMemCtx: (TALLOC_CTX *) memCtx
{
struct mapistore_contexts_list *context;
NSString *url, *folderName;
NSArray *unprefixedFolders;
SOGoMailAccount *accountFolder;
MAPIStoreUserContext *userContext;
WOContext *woContext;
userContext = [MAPIStoreUserContext userContextWithUsername: userName
andTDBIndexing: indexing];
accountFolder = [[userContext rootFolders] objectForKey: @"mail"];
woContext = [userContext woContext];
unprefixedFolders = [[accountFolder draftsFolderNameInContext: woContext]
componentsSeparatedByString: @"/"];
folderName = [NSString stringWithFormat: @"folder%@",
[unprefixedFolders componentsJoinedByString: @"/folder"]];
url = [NSString stringWithFormat: @"sogo://%@:%@@outbox/%@",
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
[userName stringByReplacingOccurrencesOfString: @"@"
withString: @"%40"],
folderName];
context = talloc_zero (memCtx, struct mapistore_contexts_list);
context->url = [url asUnicodeInMemCtx: context];
/* TODO: use a localized version of this display name */
context->name = [@"Outbox" asUnicodeInMemCtx: context];
context->main_folder = true;
context->role = MAPISTORE_OUTBOX_ROLE;
context->tag = "tag";
context->prev = context;
return context;
}
- (Class) MAPIStoreFolderClass
{
return MAPIStoreOutboxFolderK;
}
@end
-72
View File
@@ -1,72 +0,0 @@
/* MAPIStoreMailFolder.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREMAILFOLDER_H
#define MAPISTOREMAILFOLDER_H
#import "MAPIStoreFolder.h"
@class NSNumber;
@class WOContext;
@class SOGoMailAccount;
@class SOGoMailFolder;
@class MAPIStoreMailMessageTable;
@interface MAPIStoreMailFolder : MAPIStoreFolder
{
SOGoMAPIDBMessage *versionsMessage;
NSMutableDictionary *bodyData;
}
- (BOOL) ensureFolderExists;
/* synchronisation & versioning */
- (BOOL) synchroniseCache;
- (void) synchronizeUpdatedFolder: (NSNumber *) lastModseq
withMapping: (NSMutableDictionary *) mapping;
- (BOOL) synchroniseCacheForUID: (NSString *) messageUID;
- (NSNumber *) modseqFromMessageChangeNumber: (NSString *) changeNum;
- (NSString *) messageUIDFromMessageKey: (NSString *) messageKey;
- (NSString *) changeNumberForMessageUID: (NSString *) messageUid;
- (void) setChangeKey: (NSData *) changeKey
forMessageWithKey: (NSString *) messageKey;
- (BOOL) updatePredecessorChangeListWith: (NSData *) changeKey
forMessageWithKey: (NSString *) messageKey;
- (NSData *) changeKeyForMessageWithKey: (NSString *) messageKey;
- (NSData *) predecessorChangeListForMessageWithKey: (NSString *) messageKey;
/* Extra properties from mail messages that already hit the server */
- (void) setExtraProperties: (NSDictionary *) props
forMessage: (NSString *) messageKey;
- (NSDictionary *) extraPropertiesForMessage: (NSString *) messageKey;
@end
/* MAPIStoreOutboxFolder is a special subclass of MAPIStoreMailFolder where
the displayname is always "Outbox" and can not be changed. */
@interface MAPIStoreOutboxFolder : MAPIStoreMailFolder
@end
#endif /* MAPISTOREMAILFOLDER_H */
File diff suppressed because it is too large. Load diff
@@ -1,31 +0,0 @@
/* MAPIStoreMailFolderTable.h - this file is part of SOGo
*
* Copyright (C) 2015 Enrique J. Hernández
*
* Author: Enrique J. Hernández <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.
*/
#ifndef MAPISTOREMAILFOLDERTABLE_H
#define MAPISTOREMAILFOLDERTABLE_H
#import "MAPIStoreFolderTable.h"
@interface MAPIStoreMailFolderTable : MAPIStoreFolderTable
@end
#endif /* MAPISTOREMAILFOLDERTABLE_H */
@@ -1,42 +0,0 @@
/* MAPIStoreMailFolderTable.m - this file is part of SOGo
*
* Copyright (C) 2015 Enrique J. Hernández
*
* 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/NSString.h>
#import "MAPIStoreMailFolderTable.h"
#import "MAPIStoreTypes.h"
@implementation MAPIStoreMailFolderTable
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
switch(property)
{
case PR_DISPLAY_NAME:
case PR_DISPLAY_NAME_UNICODE:
return @"name";
default:
return nil;
}
}
@end
-88
View File
@@ -1,88 +0,0 @@
/* MAPIStoreMailMessage.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREMAILMESSAGE_H
#define MAPISTOREMAILMESSAGE_H
#import "MAPIStoreMessage.h"
@class NSString;
@class NSArray;
@class NSMutableArray;
@class NSMutableDictionary;
@class MAPIStoreAppointmentWrapper;
@class MAPIStoreMailFolder;
@interface MAPIStoreMailMessage : MAPIStoreMessage
{
BOOL headerSetup;
BOOL mailIsEvent;
BOOL mailIsMeetingRequest;
BOOL mailIsSharingObject;
NSMutableArray *bodyContentKeys;
NSMutableDictionary *bodyPartsEncodings;
NSMutableDictionary *bodyPartsCharsets;
NSMutableDictionary *bodyPartsMimeTypes;
NSMutableDictionary *bodyPartsMixed;
NSString *headerCharset;
NSString *headerMimeType;
BOOL bodySetup;
NSArray *bodyContent;
BOOL fetchedAttachments;
MAPIStoreAppointmentWrapper *appointmentWrapper;
}
- (NSString *) subject;
- (enum mapistore_error) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (enum mapistore_error) getPidTagFlagStatus: (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 */
- (void) setBodyContentFromRawData: (NSArray *) rawContent;
- (NSArray *) getBodyContent;
@end
#endif /* MAPISTOREMAILMESSAGE_H */
File diff suppressed because it is too large. Load diff
@@ -1,35 +0,0 @@
/* MAPIStoreMailMessageTable.h - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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 MAPISTOREMAILMESSAGETABLE_H
#define MAPISTOREMAILMESSAGETABLE_H
#import "MAPIStoreMessageTable.h"
@interface MAPIStoreMailMessageTable : MAPIStoreMessageTable
{
BOOL fetchedCoreInfos;
}
@end
#endif /* MAPISTOREMAILMESSAGETABLE_H */
@@ -1,359 +0,0 @@
/* MAPIStoreMailMessageTable.m - this file is part of SOGo
*
* Copyright (C) 2010-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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/NSCharacterSet.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSRange.h>
#import <NGExtensions/NSObject+Logs.h>
#import <EOControl/EOQualifier.h>
#import <SOGo/NSArray+Utilities.h>
#import <Mailer/NSData+Mail.h>
#import <Mailer/SOGoMailFolder.h>
#import <Mailer/SOGoMailObject.h>
#import "MAPIStoreContext.h"
#import "MAPIStoreMailFolder.h"
#import "MAPIStoreMailMessage.h"
#import "MAPIStoreTypes.h"
#import "NSData+MAPIStore.h"
#import "NSString+MAPIStore.h"
#import "MAPIStoreMailMessageTable.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_nameid.h>
@implementation MAPIStoreMailMessageTable
static Class MAPIStoreMailMessageK, NSDataK, NSStringK;
+ (void) initialize
{
MAPIStoreMailMessageK = [MAPIStoreMailMessage class];
NSDataK = [NSData class];
NSStringK = [NSString class];
}
+ (Class) childObjectClass
{
return MAPIStoreMailMessageK;
}
- (id) init
{
if ((self = [super init]))
{
ASSIGN (sortOrderings, [NSArray arrayWithObject: @"ARRIVAL"]);
fetchedCoreInfos = NO;
}
return self;
}
- (void) cleanupCaches
{
[(MAPIStoreMailFolder *) container synchroniseCache];
fetchedCoreInfos = NO;
[super cleanupCaches];
}
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
static NSMutableDictionary *knownProperties = nil;
if (!knownProperties)
{
knownProperties = [NSMutableDictionary new];
[knownProperties setObject: @"DATE"
forKey: MAPIPropertyKey (PR_CLIENT_SUBMIT_TIME)];
[knownProperties setObject: @"DATE"
forKey: MAPIPropertyKey (PR_MESSAGE_DELIVERY_TIME)];
[knownProperties setObject: @"MESSAGE-ID"
forKey: MAPIPropertyKey (PR_INTERNET_MESSAGE_ID_UNICODE)];
}
return [knownProperties objectForKey: MAPIPropertyKey (property)];
}
/* restrictions */
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
id value;
NSNumber *modseq;
value = NSObjectFromMAPISPropValue (&res->lpProp);
switch ((uint32_t) res->ulPropTag)
{
case PR_MESSAGE_CLASS_UNICODE:
if ([value isEqualToString: @"IPM.Note"])
rc = MAPIRestrictionStateAlwaysTrue;
else
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PidLidAppointmentStartWhole:
case PidLidAppointmentEndWhole:
case PidLidRecurring:
//[self logWithFormat: @"apt restriction on mail folder?"];
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PidLidAutoProcessState:
if ([value intValue] == 0)
rc = MAPIRestrictionStateAlwaysTrue;
else
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PR_SEARCH_KEY:
rc = MAPIRestrictionStateAlwaysFalse;
break;
case 0x0fff00fb: /* PR_ENTRY_ID in PtyServerId form */
case 0x0ff600fb:
/* resProperty: struct mapi_SPropertyRestriction
relop : 0x04 (4)
ulPropTag : UNKNOWN_ENUM_VALUE (0xFF600FB)
lpProp: struct mapi_SPropValue
ulPropTag : UNKNOWN_ENUM_VALUE (0xFF600FB)
value : union mapi_SPropValue_CTR(case 251)
bin : SBinary_short cb=21
[0000] 01 01 00 1A 00 00 00 00 00 9C 83 E8 0F 00 00 00 ........ ........
[0010] 00 00 00 00 00 ..... */
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PidTagConversationKey:
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PidTagChangeNumber:
{
value = [NSString stringWithFormat: @"0x%.16llx", [value unsignedLongLongValue]];
modseq = [(MAPIStoreMailFolder *)
container modseqFromMessageChangeNumber: value];
//[self logWithFormat: @"change number from oxcfxics: %.16lx", [value unsignedLongLongValue]];
//[self logWithFormat: @" modseq: %.16lx", [modseq unsignedLongLongValue]];
if (modseq)
{
if (res->relop == RELOP_GT)
modseq = [NSNumber numberWithUnsignedLongLong:
[modseq unsignedLongLongValue] + 1];
}
else
modseq = [NSNumber numberWithUnsignedLongLong: 0];
if (res->relop == RELOP_GT || res->relop == RELOP_GE)
{
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: @"MODSEQ"
operatorSelector: EOQualifierOperatorGreaterThanOrEqualTo
value: modseq];
[*qualifier autorelease];
rc = MAPIRestrictionStateNeedsEval;
}
else
{
/* Ignore other operations as IMAP only support MODSEQ >= X */
[self warnWithFormat: @"Ignoring '%@' as only supported operators are > and >=",
NSStringFromSelector ([self operatorFromRestrictionOperator: res->relop])];
rc = MAPIRestrictionStateAlwaysTrue;
}
}
break;
default:
rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier];
}
return rc;
}
- (MAPIRestrictionState) evaluateContentRestriction: (struct mapi_SContentRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
id value;
value = NSObjectFromMAPISPropValue (&res->lpProp);
if ([value isKindOfClass: NSDataK])
{
value = [[NSString alloc] initWithData: value
encoding: NSUTF8StringEncoding];
[value autorelease];
}
else if (![value isKindOfClass: NSStringK])
[NSException raise: @"MAPIStoreTypeConversionException"
format: @"unhandled content restriction for class '%@'",
NSStringFromClass ([value class])];
switch (res->ulPropTag)
{
case PR_MESSAGE_CLASS_UNICODE:
if ([value isEqualToString: @"IPM.Note"])
rc = MAPIRestrictionStateAlwaysTrue;
else
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PidTagConversationKey:
rc = MAPIRestrictionStateAlwaysFalse;
break;
default:
rc = [super evaluateContentRestriction: res intoQualifier: qualifier];
}
return rc;
}
- (MAPIRestrictionState) evaluateExistRestriction: (struct mapi_SExistRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
MAPIRestrictionState rc;
switch (res->ulPropTag)
{
case PR_MESSAGE_CLASS_UNICODE:
rc = MAPIRestrictionStateAlwaysFalse;
break;
case PR_MESSAGE_DELIVERY_TIME:
rc = MAPIRestrictionStateAlwaysTrue;
break;
case PR_CLIENT_SUBMIT_TIME:
rc = MAPIRestrictionStateAlwaysTrue;
break;
case PR_PROCESSED:
rc = MAPIRestrictionStateAlwaysFalse;
break;
default:
rc = [super evaluateExistRestriction: res intoQualifier: qualifier];
}
return rc;
}
/* sorting */
- (NSString *) _sortIdentifierForProperty: (enum MAPITAGS) property
{
static NSMutableDictionary *knownProperties = nil;
if (!knownProperties)
{
knownProperties = [NSMutableDictionary new];
/* ARRIVAL, CC */
[knownProperties setObject: @"DATE"
forKey: MAPIPropertyKey (PR_CLIENT_SUBMIT_TIME)];
[knownProperties setObject: @"DATE"
forKey: MAPIPropertyKey (PR_MESSAGE_DELIVERY_TIME)];
[knownProperties setObject: @"FROM"
forKey: MAPIPropertyKey (PR_SENT_REPRESENTING_NAME_UNICODE)];
[knownProperties setObject: @"SIZE"
forKey: MAPIPropertyKey (PR_MESSAGE_SIZE)];
[knownProperties setObject: @"SIZE"
forKey: MAPIPropertyKey (PidLidRemoteTransferSize)];
[knownProperties setObject: @"SUBJECT"
forKey: MAPIPropertyKey (PR_NORMALIZED_SUBJECT_UNICODE)];
[knownProperties setObject: @"TO"
forKey: MAPIPropertyKey (PR_DISPLAY_TO_UNICODE)];
}
return [knownProperties objectForKey: MAPIPropertyKey (property)];
}
- (void) setSortOrder: (const struct SSortOrderSet *) set
{
NSMutableArray *newSortOrderings;
NSMutableString *newSortOrdering;
struct SSortOrder *sortOrder;
NSString *sortIdentifier;
const char *propName;
uint16_t count;
if (set)
{
/* TODO: */
if (set->cCategories > 0)
[self errorWithFormat: @"we don't handle sort categories yet"];
newSortOrderings = [NSMutableArray array];
for (count = 0; count < set->cSorts; count++)
{
sortOrder = set->aSort + count;
sortIdentifier
= [self _sortIdentifierForProperty: sortOrder->ulPropTag];
if (sortIdentifier)
{
newSortOrdering = [NSMutableString string];
if (sortOrder->ulOrder == TABLE_SORT_DESCEND)
[newSortOrdering appendString: @" REVERSE"];
else if (sortOrder->ulOrder == TABLE_SORT_MAXIMUM_CATEGORY)
[self errorWithFormat: @"TABLE_SORT_MAXIMUM_CATEGORY is not handled"];
[newSortOrdering appendFormat: @" %@", sortIdentifier];
[newSortOrderings addObject: [newSortOrdering substringFromIndex: 1]];
}
else
{
propName = get_proptag_name (sortOrder->ulPropTag);
if (!propName)
propName = "<unknown>";
[self errorWithFormat:
@"sort unhandled for property: %s (0x%.8x)",
propName, sortOrder->ulPropTag];
}
}
if ([newSortOrderings count] > 0)
ASSIGN (sortOrderings, newSortOrderings);
else
ASSIGN (sortOrderings, [NSArray arrayWithObject: @"ARRIVAL"]);
//[self logWithFormat: @"new sort orderings: '%@'", sortOrderings];
}
else
ASSIGN (sortOrderings, [NSArray arrayWithObject: @"ARRIVAL"]);
[self cleanupCaches];
}
- (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)
{
fetchedCoreInfos = YES;
[(SOGoMailFolder *) [(MAPIStoreMailFolder *) container sogoObject]
prefetchCoreInfosForMessageKeys: [self restrictedChildKeys]];
}
return [super getRow: dataP withRowID: rowId
andQueryType: queryType inMemCtx: memCtx];
}
@end
@@ -1,34 +0,0 @@
/* MAPIStoreMailVolatileMessage.h - this file is part of SOGo
*
* Copyright (C) 2011-2012 Inverse inc
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* 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.
*/
#ifndef MAPISTOREMAILVOLATILEMESSAGE_H
#define MAPISTOREMAILVOLATILEMESSAGE_H
#import "MAPIStoreMessage.h"
@interface MAPIStoreMailVolatileMessage : MAPIStoreMessage
- (enum mapistore_error) submitWithFlags: (enum SubmitFlags) flags;
@end
#endif /* MAPISTOREMAILVOLATILEMESSAGE_H */
File diff suppressed because it is too large. Load diff
Loaded 100 of 1681 files, more files were not shown because too many files have changed in this diff. Show more