Compare commits

..
Author SHA1 Message Date
Luc Charland 1dd4d870e0 Changed the keyname to EventsSortingState 2015-08-06 12:38:26 -04:00
Luc Charland 31b959a7dc Added saving of Calendar Sort to jsonSettings 2015-08-06 12:17:48 -04:00
Francis Lachapelle 2a132b4e8f (css) Cleanup directives already in material 2015-08-06 11:48:42 -04:00
Francis Lachapelle ff1a1e6f59 (html) Cleanup UIxContactFoldersView.wox 2015-08-06 11:26:26 -04:00
Francis Lachapelle a4a75607fa (js,html) Improve sgSubscribe directive 2015-08-06 11:23:16 -04:00
Francis Lachapelle 6641bbded2 (js) Improve User.$filter function 2015-08-06 11:23:16 -04:00
Ludovic Marcotte 78975b9e68 (fix) add proper class to avoid displaying the chips' line 2015-08-06 09:36:43 -04:00
Ludovic Marcotte 2f122f12b6 (fix) don't show a dialog on top of a dialog for acl confirmation 2015-08-05 20:23:11 -04:00
Francis Lachapelle 5e19a889c2 (feat) Handle invitations in appointment viewer 2015-08-05 17:31:22 -04:00
Ludovic Marcotte 87aec2fc01 (feat) added batch export option to cards 2015-08-05 16:02:57 -04:00
Ludovic Marcotte 5327df4c7a (feat) added select all feature to contacts module 2015-08-05 15:04:47 -04:00
Ludovic Marcotte a220ee67b7 (feat) reworked batch menu + added save messages option 2015-08-05 14:39:58 -04:00
Ludovic Marcotte 124ca5d8cf (fix) escape the HTML content from the raw source before returning it 2015-08-05 11:08:36 -04:00
Francis Lachapelle 9dac8e55ff (js) Avoid accidentally closing the composer 2015-08-05 10:14:32 -04:00
Francis Lachapelle 4539fd4c5e (html) Internationalized labels in message viewer 2015-08-05 10:12:51 -04:00
Luc Charland 923ab97309 Added tooltips for saving/view attachments 2015-08-05 10:05:21 -04:00
Luc Charland c56644f0e5 Added tooltips to Contacts 2015-08-05 09:40:12 -04:00
Ludovic Marcotte da119ef3ad (feat) raw source support in contact module 2015-08-04 20:32:43 -04:00
Ludovic Marcotte 6e114b84be (feat) reorganized menu + added view raw source feature 2015-08-04 16:51:33 -04:00
Ludovic Marcotte dff7b59036 (fix) wrong tagging for dialog content 2015-08-04 16:39:02 -04:00
Ludovic Marcotte 7f43f894b0 (fix) update the unseenCount when reading messages 2015-08-04 16:08:17 -04:00
Ludovic Marcotte a27f106a4a (fix) pimped ical viewer 2015-08-04 13:52:31 -04:00
Francis Lachapelle 95a360dd36 (fix) Variable test in Component service 2015-08-04 13:46:55 -04:00
Luc Charland 09224f587f Added a few tooltips for the mail view 2015-08-04 12:54:58 -04:00
Francis Lachapelle ff1b9e7ed1 (fix) Draft initialization 2015-08-04 10:56:55 -04:00
Francis Lachapelle 6d260c58c7 (js) Update Gruntfile.js for changes in vendor js 2015-08-04 10:37:07 -04:00
Francis Lachapelle ba69bd4c82 (css) Improve color picker inside md-avatar 2015-08-04 08:31:40 -04:00
Francis Lachapelle 2a45a2133b (fix) Padding of mail account delegation dialog 2015-08-04 08:31:40 -04:00
Francis Lachapelle 57fbc453a6 (html) Add avatars to ACL editor 2015-08-04 08:31:39 -04:00
Francis Lachapelle f17b3638d7 (js) Fix usage of Settings.activeUser 2015-08-04 08:31:39 -04:00
extrafu 67517e0b28 Update README.md 2015-08-03 20:40:59 -04:00
extrafu 0038ce03fa Merge pull request #12 from vDevices/master
Created README & 'tutorials' subdirectory
2015-08-03 20:39:03 -04:00
Francis Lachapelle d2b2cb186e (js) Fix usage of Settings.activeUser 2015-08-03 16:18:23 -04:00
Francis Lachapelle ca8b64bd88 (js) Fix error when deleting an ACL user 2015-08-03 16:17:02 -04:00
Francis Lachapelle 732b8c9d8a (css) Fullscreen dialogs on small screens 2015-08-03 16:15:59 -04:00
Francis Lachapelle ba6418fb93 (html) Review the toolbar of dialog boxes 2015-08-03 14:44:11 -04:00
Francis Lachapelle ab1cd36c77 Review delegation dialog in Mail app module 2015-08-03 14:40:18 -04:00
Ludovic Marcotte 9f2c5b5f50 (fix) added bg icon 2015-08-03 12:48:29 -04:00
Ludovic Marcotte b6ea1de4c0 (fix) improved message editor 2015-08-03 12:43:21 -04:00
Francis Lachapelle 21f214659e (fix) Some compilation warnings 2015-08-03 12:16:16 -04:00
Francis Lachapelle 82720d341c (fix) Some compilation warnings 2015-08-03 12:03:56 -04:00
Francis Lachapelle a330ff7320 (js) Move Settings to a value in Common ng module
Also removed explicit settings and defaults that were imported in
various app modules. We now always use the Preferences ng service.
2015-08-03 11:57:04 -04:00
extrafu 375eac2be0 Merge pull request #94 from inverse-inc/feature/trailing_spaces
Feature/trailing spaces
2015-08-03 11:00:58 -04:00
Luc Charland 4cf82bd41c removed trailing space to strings 2015-08-03 10:56:24 -04:00
Luc Charland 9f202cfcdc cleaned up a few comments 2015-08-03 10:24:15 -04:00
extrafu 393321b223 Merge pull request #92 from inverse-inc/feature/remove_colon
Feature/remove colon
2015-08-03 09:54:48 -04:00
Luc Charland 6835cd5319 removed double Name translation in 5 languages 2015-08-03 09:51:31 -04:00
Ludovic Marcotte 31bc88d9d3 Updated NEWS file regarding PR93
Conflicts:

	NEWS
2015-08-03 09:19:35 -04:00
Ludovic Marcotte f515106bcc (fix) added patch from PR93 2015-08-03 09:16:55 -04:00
Ludovic Marcotte ec1420c19b (feat) now use mdDialog for message composition 2015-08-02 13:25:38 -04:00
Ludovic Marcotte f44af10cdd (feat) integrated the color picker in the pref module 2015-07-31 15:40:00 -04:00
Ludovic Marcotte e25305980f (fix) improved the account delegation dialog 2015-07-31 14:54:55 -04:00
Ludovic Marcotte 0c7bdac091 (fix) refactored code and we now return the unseenCount when fetching uids 2015-07-31 14:31:38 -04:00
Luc Charland 2f8f8c78f7 Removing colons 2015-07-31 14:14:30 -04:00
Luc Charland 90b7ce7ec3 fixed Appointments path 2015-07-31 13:57:41 -04:00
Luc Charland 6ecea9d702 cleaned up a few comments 2015-07-31 13:57:41 -04:00
Luc Charland a54b8780a8 added first draft of verify_translation 2015-07-31 13:57:41 -04:00
Ludovic Marcotte 40d269c504 (feat) unseen count support folder all accounts/mailboxes 2015-07-31 13:32:14 -04:00
Francis Lachapelle 1d52be415f (html) Improve Calendar properties dialog 2015-07-31 11:18:29 -04:00
Francis Lachapelle 3b9a989abd (js) New color picker directive 2015-07-31 11:16:34 -04:00
Ludovic Marcotte a728616bca (fix) comment typo 2015-07-31 09:05:56 -04:00
Ludovic Marcotte 65b8382020 (fix) move refresh timeout to service classes and enabled repeating timers 2015-07-30 19:47:53 -04:00
Ludovic Marcotte 85f4efab46 (fix) refactored to code 2015-07-30 14:51:14 -04:00
Ludovic Marcotte af7fb1c6ee (fix) modified the template so it shares the same l&f as the contacts one 2015-07-30 13:25:50 -04:00
Ludovic Marcotte a52d42f6b2 (feat) manual+auto refresh support for addressbooks/mailboxes 2015-07-30 13:06:28 -04:00
Francis Lachapelle 1f8edbdd1f (js) Respect SOGoCalendarDefaultReminder in editor 2015-07-30 12:05:33 -04:00
Francis Lachapelle b61eb00b99 (js) Reload lists when (en|dis)abling a calendar
Only the displayed list was refresh. Now we invalidate the hidden list.
2015-07-30 11:55:02 -04:00
Francis Lachapelle 449093c3f0 (fix) Calendar destination of new task
Also removed the possibility to use the "moveToCalendar" parameter. We
should eventually create UIxTaskActions.m as we have
UIxAppointmentActions.m for this kind of actions.
2015-07-30 11:51:02 -04:00
Ludovic Marcotte 0fc7c96924 (fix) use proper values for short/long date formats 2015-07-29 19:10:03 -04:00
Francis Lachapelle b73450e992 (fix) Label color of pseudo-input
It now matches the one of ng-material.
2015-07-29 16:45:16 -04:00
Francis Lachapelle 8e00387152 (fix) CSS padding style of toolbar 2015-07-29 16:44:18 -04:00
Francis Lachapelle b6a5eb0b60 (fix) Disable frequency when editing an occurrence 2015-07-29 16:43:10 -04:00
Francis Lachapelle d7b7824aad Improve display of attendees in event viewer 2015-07-29 16:42:20 -04:00
Francis Lachapelle 3e6c50b7dc (cleanup) Remove ionic templates 2015-07-29 15:54:13 -04:00
Ludovic Marcotte 9291dc29b6 Removed old file 2015-07-29 15:51:52 -04:00
Francis Lachapelle f5927944fa (fix) Missing header file import 2015-07-29 15:48:29 -04:00
Ludovic Marcotte 16885f4ebf (fix) properly handle subparts compilation for message/rfc822 message parts 2015-07-29 15:37:55 -04:00
Francis Lachapelle d3a233b222 (js) Improve Angular modules initialization 2015-07-29 15:16:43 -04:00
Francis Lachapelle 7e10cff395 (js) Restore user's last Calendar view
Also reviewed the handling of Angular modules dependencies.
2015-07-29 11:47:01 -04:00
Francis Lachapelle 762f305914 (cleanup) No longer used JavasScript 2015-07-29 10:11:28 -04:00
Francis Lachapelle e208ee3fde (feat) Open events from day and week views 2015-07-28 20:45:46 -04:00
Francis Lachapelle 571be37c1d (scss) Indentation 2015-07-28 15:53:48 -04:00
Francis Lachapelle 433983e7c4 (fix) DI annotation of sgIMAP controller 2015-07-28 14:37:49 -04:00
Francis Lachapelle d7aae0e667 (fix) _.allKeys doesn't exist in lodash 2015-07-28 14:21:19 -04:00
Francis Lachapelle e87a6de46b (html) Remove previous "hack" for ng-material
The md-menu positioned as a secondary action in a list can now be
properly hidden. ng-material is just getting better :)
2015-07-28 14:16:56 -04:00
Francis Lachapelle 13a779019b (html) Add toolbar to dialog boxes 2015-07-28 14:13:48 -04:00
Ludovic Marcotte 17432deaa7 (fix) reset alarm after popping it 2015-07-28 13:05:05 -04:00
Ludovic Marcotte 7365f77dd5 (feat) new Alarm service + alarms support in all modules 2015-07-28 11:54:49 -04:00
Francis Lachapelle e8dcc6df37 (js) New common ACL Controller 2015-07-28 10:53:29 -04:00
Francis Lachapelle a8765eb41b (fix) Autocompletion in mail editor 2015-07-27 20:43:43 -04:00
Francis Lachapelle c700608f0f (fix) Sidenav list items display of Preferences 2015-07-27 20:11:57 -04:00
Francis Lachapelle 86a0032cc1 Handle the edition of recurring event occurrences 2015-07-27 16:02:05 -04:00
Francis Lachapelle 049c1385d6 (fix) Event propagation when saving component 2015-07-27 13:50:14 -04:00
Francis Lachapelle a168d0227d (js) Use lodash and remove old dependencies
Replaced underscore by lodash
2015-07-27 13:27:12 -04:00
Ludovic Marcotte 40dd3e5875 (fix) reworked c_ prefixes on givenname,cn,sn,o and component.
This makes it easier to map to the quick table and avoid
fields duplications.
2015-07-27 12:47:40 -04:00
Francis Lachapelle dc9a0896e5 (js) Fix possible errors (help from jsjint) 2015-07-24 16:14:53 -04:00
Francis Lachapelle e064dc4a46 (js) Add support for local URL in sgAvatarImage
Directive was previously named sgGravatarImage.

The local URL will be used before falling back to Gravatar.
2015-07-24 15:48:28 -04:00
Francis Lachapelle 843a689094 (js) Enable jshint and uglify 2015-07-24 15:47:29 -04:00
Ludovic Marcotte f09c06f8c4 (feat) show folders stats 2015-07-24 15:35:29 -04:00
Ludovic Marcotte c365d646a2 (feat) ability to set folders as drafts/trash/sent 2015-07-24 14:40:07 -04:00
Ludovic Marcotte cbbb3dd9d4 (feat) show error message (like submission max) when sending mails 2015-07-24 11:21:04 -04:00
Ludovic Marcotte c5a35a64a2 (fix) SOGoMaximumMessageSubmissionCount should be independant from SOGoMaximumRecipientCount 2015-07-24 11:20:51 -04:00
Ludovic Marcotte a03715f74a (fix) show proper icon for shared mailboxes 2015-07-24 10:21:33 -04:00
Francis Lachapelle 51b8ce7400 (doc) Improve documentation of angular filters 2015-07-23 15:33:34 -04:00
Francis Lachapelle 2981b0af00 (js) New 'range' filter for angular 2015-07-23 15:33:33 -04:00
Ludovic Marcotte 194c5635b5 Updates for the release 2015-07-23 13:13:02 -04:00
Francis Lachapelle 73d62800e8 Update Spanish (Argentina) translation 2015-07-23 12:08:25 -04:00
Francis Lachapelle c5834e2f89 Add missing templates for Basque language 2015-07-23 12:08:15 -04:00
Francis Lachapelle ab28476e7e Add missing template for Slovenian language 2015-07-23 12:08:11 -04:00
Francis Lachapelle 538e6fa4b1 Add Chinese (Taiwan) translation 2015-07-23 12:08:04 -04:00
Francis Lachapelle c3aa601f3c (fix) Return value of [iCalPerson+SOGo uidInDomain:] 2015-07-23 12:07:57 -04:00
Francis Lachapelle 613f05ac02 Calendar module optimizations in multidomain setup
Conflicts:
	NEWS
	UI/Common/UIxUserRightsEditor.m
2015-07-23 12:06:54 -04:00
Francis Lachapelle 8f49778501 Fix .wod files for English and Basque 2015-07-23 12:03:45 -04:00
Francis Lachapelle f0b88811d6 Add Slovenian translation 2015-07-23 12:02:42 -04:00
Francis Lachapelle c1d744e47a (js) Reset "selectedCard" when cancelling new card 2015-07-23 12:01:14 -04:00
Ludovic Marcotte 12875539bb (fix) fallback to utf-8/latin1 in rare decoding error cases - this is ugly 2015-07-23 11:21:25 -04:00
Ludovic Marcotte a8dd698425 (feat) added "select all" capability, just an idea 2015-07-23 10:54:46 -04:00
Francis Lachapelle f8b6864553 (js) Remove Mailbox dependency in Preferences 2015-07-22 17:27:46 -04:00
Francis Lachapelle 01f213e65e (fix) Main toolbar of contacts module 2015-07-22 12:11:19 -04:00
Ludovic Marcotte 22ead81c48 (doc) ModuleConstraints for EAS 2015-07-22 11:55:26 -04:00
Francis Lachapelle a7afcbf4a0 (js) Use user's settings when sorting messages 2015-07-22 11:28:08 -04:00
Ludovic Marcotte a8ab01a5eb (fix) fixed EAS conversation ID issues on BB10 (#3152) 2015-07-22 10:27:24 -04:00
Ludovic Marcotte 731264d9dc (fix) make sure ActiveSync is always usable with SQL-based auth sources 2015-07-22 10:14:03 -04:00
Ludovic Marcotte 046c4db2e8 (fix) fixed computation of GlobalObjectId (#3235) 2015-07-22 10:00:28 -04:00
Ludovic Marcotte ac21649633 (feat) added support for DeletesAsMoves over EAS
Conflicts:

	ActiveSync/SOGoActiveSyncDispatcher+Sync.m
2015-07-22 09:56:36 -04:00
Ludovic Marcotte efd182f145 (fix) improved EAS email flagging handling (#3140) 2015-07-22 09:46:44 -04:00
Ludovic Marcotte b6c6e09a5a (fix) compilation warning 2015-07-22 09:26:00 -04:00
Ludovic Marcotte 83a8f388ce Android EAS Lollipop fixes (#3268 and #3269)
Conflicts:

	NEWS
2015-07-22 09:16:49 -04:00
Ludovic Marcotte 8650492989 Applied PR90 as a patch due to too-many merge conflicts when cherry-picking 2015-07-22 09:05:17 -04:00
Francis Lachapelle cc03430ac6 (fix) Don't hide "new" button on small screens 2015-07-21 15:54:26 -04:00
Francis Lachapelle 9c464c15ad (fix) Show/hide completed tasks in list 2015-07-21 15:54:26 -04:00
Ludovic Marcotte 82ed44ee31 (fix) added more proper menu activation for the mailer 2015-07-21 15:48:31 -04:00
Ludovic Marcotte d7c008f2d9 (feat) timezones are now using md-autocomplete 2015-07-21 15:21:57 -04:00
Ludovic Marcotte ea68715f59 (feat) support for drafts autosaving 2015-07-21 11:19:47 -04:00
Francis Lachapelle 601ed94d77 Update product.plist for new component templates 2015-07-21 10:15:02 -04:00
Ludovic Marcotte bee36814e5 (feat) added many missing actions on mail folders 2015-07-21 09:28:54 -04:00
Francis Lachapelle a75524af9f Review task/event viewer/editor
Components will now appear in dialogs instead of a right sidenav.

This commit also introduces read-only viewers for tasks and events.
2015-07-21 08:29:28 -04:00
Ludovic Marcotte 5eeb473fe8 (feat) initial sort/search feature for mails 2015-07-20 16:44:26 -04:00
Francis Lachapelle dfb750caf4 (fix) Resolve addressbook before rendering view 2015-07-20 15:33:51 -04:00
Ludovic Marcotte cdd449fec9 (feat) search capabilities in the addressbook module 2015-07-20 15:03:29 -04:00
Ludovic Marcotte 7c2cb259a2 (feat) sorting capabilities in the addressbook module 2015-07-20 14:24:36 -04:00
Ludovic Marcotte e7a73413d5 (fix) SOGo adjustment regarding https://github.com/angular/material/commit/dbafaa14473b41e262d55f8f6d06f818f4d88654 2015-07-19 08:39:56 -04:00
Francis Lachapelle 4c51d4702f (fix) List members auto-completion 2015-07-16 16:29:54 -04:00
Francis Lachapelle 191a1afe23 (fix) Filtering components lists 2015-07-16 16:29:00 -04:00
Francis Lachapelle 8c8070ff16 (fix) Respect order of cards list 2015-07-16 16:26:09 -04:00
Francis Lachapelle ee0e45cad6 (js) Respect user's default classification 2015-07-16 11:21:55 -04:00
Francis Lachapelle d58030a475 (css) Cleanup and fixes for latest md changes 2015-07-15 16:30:19 -04:00
Francis Lachapelle d1e1d11e4a (html) Move close button of card & msg viewer
The close button is only displayed on small devices (show-sm).
2015-07-15 15:27:51 -04:00
Francis Lachapelle f09f1a4282 (fix) Respect order in list of cards 2015-07-15 15:20:08 -04:00
Francis Lachapelle 25f364991e (fix) Creation of card/list in Contacts module 2015-07-15 15:18:23 -04:00
Francis Lachapelle 730b803ad6 (js) Replace vs-repeat by md-virtual-repeat
There're some issues with mdVirtualRepeat that required some changes to
our app:

1. Having multiple directives with md-virtual-repeat doesn't work well.
That why I added a dedicated div for the md-virtual-repeat directive.
2. ui-sref-active doesn't work well for child nodes of the
md-virtual-repeat element. The class was applied repetitively to a
visible child. I now save which message or card is selected and use the
ng-class directive to highlight the selected list item.
2015-07-15 13:44:17 -04:00
Francis Lachapelle dbb8acca9a (js) Expose 'activeUser' through navController 2015-07-14 16:12:07 -04:00
Francis Lachapelle aee229e700 (js) Make use of 'controllerAs' in Mailer module 2015-07-13 15:22:58 -04:00
Francis Lachapelle 7c6716784e (feat) Events/tasks sorting in Calendar module 2015-07-09 16:35:19 -04:00
Francis Lachapelle 9a3aeb0004 (fix) Tasks list sorting 2015-07-09 16:18:03 -04:00
Ludovic Marcotte 6f6ec58a09 (html) wrap checkbox inside md-button 2015-07-09 16:08:14 -04:00
Ludovic Marcotte 88860e2e38 (fix) don't show "end repeat" for non-repetitive events/tasks 2015-07-08 21:27:24 -04:00
Francis Lachapelle 5bbb768fe8 (html) Improve event editor 2015-07-08 21:16:33 -04:00
Francis Lachapelle 396bc3b0f6 (css) Lower icon button width to 36px 2015-07-08 21:14:25 -04:00
Francis Lachapelle 164654f784 (css) Icon modifiers (rotation) for animation 2015-07-08 21:08:51 -04:00
Francis Lachapelle 9514103031 (js) Improve search toolbar in Calendar module
- new distinct search toolbar
- restored filtering options
- honor user's settings
2015-07-08 14:49:42 -04:00
Francis Lachapelle 4d4458a183 (js) Set focus to title field in component editor 2015-07-08 14:49:42 -04:00
Francis Lachapelle 5a2eb67cb7 (fix) Alignment in bottomSheet 2015-07-08 14:49:41 -04:00
Francis Lachapelle 9bdc365bf0 (js) Allow cancelling of sgSearch 2015-07-08 14:49:41 -04:00
Francis Lachapelle 066bdc5f3f (js) New 'ready' method for Preferences service
This method returns a promise that succeeds when the user's defaults and
settings have been received from the server.
2015-07-08 14:49:40 -04:00
Francis Lachapelle 396892b0e1 (js) Simplify PreferencesController 2015-07-08 14:49:40 -04:00
Francis Lachapelle dd5b325864 (js) Simplify promises handling in User.$filter 2015-07-08 14:49:39 -04:00
Francis Lachapelle fe20cc220f (js) Improve sgSearch directive
The directive now relies on transclusion to compile its content. This
way, we don't limit the directives used inside the content.
2015-07-08 14:49:38 -04:00
Ludovic Marcotte 02112dea8a (feat) can now send out MDN responses 2015-07-08 13:19:16 -04:00
Ludovic Marcotte f369eabd06 (fix) arial labels + icon classes 2015-07-07 09:50:44 -04:00
Ludovic Marcotte 4ab2c57903 (feat) handle priority and return receipt in mail editor (needs layout work) 2015-07-07 08:35:53 -04:00
Francis Lachapelle 9015f82413 (html) Improve events/tasks lists 2015-07-06 15:16:49 -04:00
Francis Lachapelle 44b8dab9c4 (css) Left-align list items in sidenav 2015-07-06 11:14:46 -04:00
Francis Lachapelle 9814a8cd0e (css) No bg-color change in :hover of bottom sheet 2015-07-06 11:11:38 -04:00
Francis Lachapelle ecce179a2f (css) Allow .sg-child-level-[1-12] everywhere 2015-07-06 11:08:50 -04:00
Ludovic Marcotte cf0aded1a4 (feat) show the 'right' folder icons 2015-07-06 11:05:19 -04:00
Ludovic Marcotte a49687fe41 (fix) make use of floating labels 2015-07-04 20:14:32 -04:00
Ludovic Marcotte 3bfc47d105 (fix) fixed icons and controller regarding mailbox delegates 2015-07-04 07:51:20 -04:00
Ludovic Marcotte 01750fa98e (fix) small syntax error 2015-07-04 07:36:15 -04:00
Francis Lachapelle b948384ec9 (js) Preload ACL users in Calendar module 2015-07-03 21:45:59 -04:00
Francis Lachapelle 1c34e71cdc (js) Remove unused dependency on $q in controllers 2015-07-03 21:44:28 -04:00
Francis Lachapelle 2337d4057f Integrate md-icon using the Material Icons font 2015-07-03 21:42:21 -04:00
Francis Lachapelle b39dedd2d2 Add attachUrls to task editor 2015-07-03 21:42:20 -04:00
Ludovic Marcotte 05d59df68b (feat) added mailbox delegation support 2015-07-03 20:40:06 -04:00
Ludovic Marcotte 9225f2b908 (fix) layout improvements when text is folding 2015-07-03 20:07:17 -04:00
Francis Lachapelle e4e18dea5e (js) Rename variable in scope of recurrence editor 2015-07-03 16:02:47 -04:00
Francis Lachapelle b0d8148ca6 (font) Add official Material Design Icons font 2015-07-03 16:02:47 -04:00
Ludovic Marcotte 52253d8c10 (fix) fixed path handling 2015-07-03 15:17:02 -04:00
Ludovic Marcotte 94a34f41b8 (fix) some layout improvements 2015-07-03 14:46:25 -04:00
Ludovic Marcotte d1636314f1 (fix) first big pass at floating label support in all md-selects 2015-07-03 11:29:40 -04:00
Ludovic Marcotte 1ae7cddf09 Silenced NSLog calls 2015-07-03 10:22:48 -04:00
Ludovic Marcotte 5ef2db59f7 (fix) a bit more error handling 2015-07-02 16:11:11 -04:00
Ludovic Marcotte 1a78882c51 (fix) floating label for select on the login page 2015-07-02 13:20:13 -04:00
Ludovic Marcotte 6471524627 (fix) also use floating label for mail composer 2015-07-02 10:54:33 -04:00
Ludovic Marcotte bc9e1f9558 (fix) use md-select floating labels 2015-07-02 10:45:13 -04:00
Francis Lachapelle a408fdff52 (js) Minor JavaScript improvements 2015-07-01 15:21:22 -04:00
Francis Lachapelle cc7eeca2c4 (js) Improve calendar lists controller
- preload both lists (events & tasks)
- don't reload list when switching tab
2015-07-01 15:17:55 -04:00
Francis Lachapelle 35ff82710a Handle attach URLs in appointment editor 2015-07-01 15:00:12 -04:00
Francis Lachapelle ba5f6410ed Return recurrence rule only if frequency is known 2015-07-01 14:11:53 -04:00
Francis Lachapelle 763ce37f8c Allow multiple "attach" values in iCalEntityObject 2015-07-01 14:09:12 -04:00
Ludovic Marcotte f449f0456b (feat) can now copy mails 2015-06-30 17:13:55 -04:00
Francis Lachapelle 06cb06fce6 New UIxTaskEditorTemplate class 2015-06-29 21:04:41 -04:00
Ludovic Marcotte 647f052486 Fix for dfecce7381
Conflicts:

	ActiveSync/SOGoActiveSyncDispatcher+Sync.m
2015-06-29 13:55:12 -04:00
Ludovic Marcotte 013e316e7d re-enabled forwardConstraints code 2015-06-29 09:22:12 -04:00
Ludovic Marcotte 33345ed1f0 (feat) new mailbox sharing capabilities and mailbox menu 2015-06-26 13:13:25 -04:00
Ludovic Marcotte 0b5146655d (fix) do now show the subscribe options for non-GCS folders 2015-06-26 13:01:32 -04:00
Francis Lachapelle d674b33a20 (css) Review cards display in sharing dialog box 2015-06-25 11:31:53 -04:00
Francis Lachapelle c524782395 Initial task editor 2015-06-25 11:30:44 -04:00
Francis Lachapelle c144f736dc Improve JSON API documentation 2015-06-25 11:23:18 -04:00
Francis Lachapelle f4a8638fb4 (json) Add c_iscycle and c_nextalarm in tasks list 2015-06-25 11:21:24 -04:00
Francis Lachapelle 69424be245 Return attributes of iCalEntity if non-empty
Only include classification and status if theyr are not empty.
2015-06-25 11:17:53 -04:00
Francis Lachapelle c3d364558e (html) Remove line under categories in card view 2015-06-23 11:23:51 -04:00
Francis Lachapelle aa6741ee4b Move categories to top in contact editor 2015-06-23 11:22:35 -04:00
Francis Lachapelle 412dca053a (css) Fix for md-cards in ACL editor 2015-06-23 11:21:50 -04:00
Francis Lachapelle b41828a7f1 (html,js) Add reminder/alarm to event editor 2015-06-22 15:49:27 -04:00
Francis Lachapelle bb8c32a77e (html) Minor improvement to preferences module 2015-06-22 10:03:41 -04:00
Francis Lachapelle 1a5763d468 (css) Remove reference to unused font 2015-06-22 10:02:53 -04:00
Francis Lachapelle 8402152a59 Load alarm from UIxComponentEditor
The alarm attributes are now loaded from UIxComponentEditor and not
iCalEntityObject so we can determine if the component's owner is part of
the alarm's attendees.
2015-06-22 09:20:35 -04:00
Francis Lachapelle d89f02ff53 Change signature of [iCalAlarm alarmForEvent:..]
The first argument doesn't have to be a iCalRepeatableEntity; a simple
iCalEntity is enough.
2015-06-19 22:08:08 -04:00
Francis Lachapelle 94cded35d2 Revert "(fix) Adjust md-tabs for latest material"
This reverts commit 6041a9c009.
2015-06-19 14:52:00 -04:00
Francis Lachapelle ba4520da51 Use node-sass 3.x 2015-06-19 13:52:18 -04:00
Francis Lachapelle 92c4ee50fa (css) Remove reference to uninstalled font 2015-06-19 13:46:14 -04:00
Francis Lachapelle 4249d6cc5b Don't use md iconic font v2.0.0 (yet)
We need to evaluate the pros and cons of moving to font ligatures now
available with Angular Material
(https://material.angularjs.org/latest/#/api/material.components.icon/directive/mdIcon).
2015-06-19 13:43:18 -04:00
Ludovic Marcotte e65ff2105e Revert "(fix) ensure calendar objects have a (fake) filename"
This reverts commit a145fdbb53.
2015-06-17 15:57:53 -04:00
Ludovic Marcotte e5c4907aba (fix) improved memory usage 2015-06-17 08:47:15 -04:00
Ludovic Marcotte a49032a6bd (fix) show only the URL of web calendars, when asked 2015-06-15 12:03:38 -04:00
Francis Lachapelle f7f83ae1c7 (css) Review cards display in sharing dialog box 2015-06-15 11:35:20 -04:00
Francis Lachapelle 6b31e3d3b9 (fix) Remove useless ng-show directive (Contacts) 2015-06-15 11:34:48 -04:00
Francis Lachapelle 0ed67f1355 (doc) Improve Angular services documentation 2015-06-15 11:33:21 -04:00
Francis Lachapelle abe8f8f93c (doc) Improve JSON API documentation 2015-06-15 11:32:09 -04:00
Francis Lachapelle 6041a9c009 (fix) Adjust md-tabs for latest material directive 2015-06-15 11:25:32 -04:00
Francis Lachapelle da95a810d4 (fix) Avoid triggering checkbox with md-menu
When clicking on the "more" secondary button of a calendar, trick the
md-list directive to consider the 'md-secondary' class of the md-menu so
the click doesn't trigger the checkbox of the list item.
2015-06-15 11:02:59 -04:00
Ludovic Marcotte f1fc78c71b (fix) invalid scope for notification prefs 2015-06-15 10:10:58 -04:00
Ludovic Marcotte d41458dfdc (fix) hide the dialog after save 2015-06-15 10:07:56 -04:00
Ludovic Marcotte 406e9a3df2 (fix) dropped old calendar sync/tag properties 2015-06-15 10:05:39 -04:00
Ludovic Marcotte b4f9b9095d (feat) first pass at the calendar properties dialog 2015-06-15 09:53:10 -04:00
Francis Lachapelle e18b61f180 Improve API documentation /Calendar/calendarslist 2015-06-15 09:19:21 -04:00
Francis Lachapelle af6e20d627 (fix) Restore methods in UIxCalUserRightsEditor 2015-06-12 16:12:14 -04:00
Francis Lachapelle 8100dfa797 Update {variables,content}.scss for latest md 2015-06-12 15:59:26 -04:00
Ludovic Marcotte 4514d7ce32 (fix) md-content -> md-dialog-content in templates 2015-06-12 15:26:22 -04:00
Ludovic Marcotte 0612c3dff1 Fixed templates 2015-06-12 14:44:33 -04:00
Ludovic Marcotte ee9e559765 (feat) links to calendars 2015-06-12 14:24:33 -04:00
Ludovic Marcotte a89b116940 (feat) allow showing links to address books 2015-06-12 14:24:23 -04:00
Ludovic Marcotte 942c972942 (feat) re-enabled export cards feature 2015-06-12 14:23:51 -04:00
Francis Lachapelle 20914a8812 Improve and fix SASS preprocessing 2015-06-12 14:12:51 -04:00
Francis Lachapelle b85b2ed416 Update angular-material 2015-06-12 12:26:17 -04:00
Ludovic Marcotte 3a1c1226bc (feat) added menu in list of address books 2015-06-12 12:06:00 -04:00
Ludovic Marcotte 6d12c2a2c8 (feat) enabled menu and fabdial support 2015-06-12 12:06:00 -04:00
Ludovic Marcotte 23d7c06829 (feat) improved the attachments handling code for the message editor 2015-06-12 12:06:00 -04:00
Francis Lachapelle 290264262c (js) Improve autocomplete of attendees editor 2015-06-12 12:05:07 -04:00
Francis Lachapelle a95ed0f8e6 Initial ng/md version of the attendees editor 2015-06-12 12:05:06 -04:00
Francis Lachapelle a2383db454 (js) Improve recurrence editor 2015-06-12 12:05:06 -04:00
Francis Lachapelle 1d1f7445cb (html) Remove upper div from image part viewer 2015-06-12 12:05:06 -04:00
Francis Lachapelle b469045de8 (js) Simplify Dialog service 2015-06-12 12:05:05 -04:00
Francis Lachapelle a1c493358f Improve API documentation for appointment editor 2015-06-12 12:05:05 -04:00
Francis Lachapelle 4cece88a42 JSONinfy [SOGoUserHomePage readFreeBusyAction] 2015-06-12 12:05:05 -04:00
Ludovic Marcotte 8124faa6d4 (feat) "Materialization" of the IMIP handling template 2015-06-12 12:03:59 -04:00
Francis Lachapelle fb992db5ad Improve ACL editor (Scheduler & Contacts) 2015-06-12 12:03:58 -04:00
Luc Charland e385bf34d5 added simple event testing json->dav 2015-06-12 12:03:57 -04:00
Ludovic Marcotte 4f75499439 (fix) Materalized link and image templates 2015-06-12 12:03:57 -04:00
Francis Lachapelle 34140e77fc (html) Improve ACL editor 2015-06-12 12:03:56 -04:00
Francis Lachapelle 04b992e1f1 (js) Make use of 'controllerAs' in Contacts module 2015-06-12 12:03:56 -04:00
Francis Lachapelle 11cf483e2c (js) Set height/width of gravatar's image 2015-06-12 12:03:56 -04:00
Francis Lachapelle 6a835c745f (js) Fix resource URL of Acl service 2015-06-12 12:03:56 -04:00
Francis Lachapelle af353fb73f (js) Improve contact chips in card list editor
Exclude list members from auto-completion results.
2015-06-12 12:03:56 -04:00
Francis Lachapelle d159e12b3f (js) Improve contact chips in Preferences module
Exclude users already in the prevent invitations whitelist.
2015-06-12 12:03:55 -04:00
Francis Lachapelle 28477e9709 Add apidoc.json 2015-06-12 12:03:55 -04:00
Luc Charland 9a3f4080c0 test adding single and multiple phones with JSON and getting it with DAV 2015-06-12 12:03:54 -04:00
Francis Lachapelle cdd52a0b37 (css) Cleanup card.scss 2015-06-12 12:03:54 -04:00
Francis Lachapelle e226a32413 Improve login page
Used ngCloak directive to display the form only once AngularJS/Angular
Material is loaded and all components initialized.
2015-06-12 12:03:54 -04:00
Francis Lachapelle 1f83680e12 Add aria attributes in Preferences module 2015-06-12 12:03:54 -04:00
Francis Lachapelle d5f4da3934 (fix) Don't return duplicated timezones 2015-06-12 12:03:53 -04:00
Francis Lachapelle dc91be3c0d Initial recurrence editor for appointments 2015-06-12 12:03:53 -04:00
Francis Lachapelle 7e96f37809 (wox) Add classification to event editor 2015-06-12 12:03:53 -04:00
Francis Lachapelle 0ac27aab50 (js) Improve coding style of Card.service.js 2015-06-12 12:03:53 -04:00
Francis Lachapelle 3350e2fa12 (fix) Syntax of word "occurrence" 2015-06-12 12:03:52 -04:00
Francis Lachapelle e4e5106f97 Set editor mode of Sass files 2015-06-12 12:03:52 -04:00
Francis Lachapelle ed7f979635 (js) Fix dependency injection in Dialog service 2015-06-12 12:03:51 -04:00
Francis Lachapelle 46bfe6befb (fix) Resolve component data completely 2015-06-12 12:03:51 -04:00
Francis Lachapelle 22db835036 Compress production version of CSS 2015-06-12 12:03:51 -04:00
Francis Lachapelle f6f704ddd8 (js) New sgToggleGrid directive
This directive allows to transform the tiles of a md-grid-list to toggle
buttons.
2015-06-12 12:03:51 -04:00
Francis Lachapelle 9222bf80ef (js) Fix mdContactChips in preferencs module
By keeping the same array reference throughout the auto-completion, we
fix the ng-click on a list item. It also avoids constant redraws of the
list.
2015-06-12 12:03:50 -04:00
Francis Lachapelle b017cb1711 Update variables.scss for latest md version 2015-06-12 12:03:50 -04:00
Francis Lachapelle 9db7d3b85d (fix) Show/save whitelisted users for invitations 2015-06-12 12:03:50 -04:00
Francis Lachapelle 18cf3d5f9c (wox) Improve layout of Preferences module 2015-06-12 12:03:49 -04:00
Francis Lachapelle 8e286b5d15 (css) Drop unused "theme" Sass files
Only the original ng-material theme files are used in the build process
of ng-material (using gulp).
2015-06-12 12:03:07 -04:00
Francis Lachapelle ec2b52bf7b (fix) Save event to a different calendar 2015-06-12 12:03:07 -04:00
Francis Lachapelle ac705547e8 (js) Colorize the bg of calendars checkboxes
The background color was affecting only checked checkboxes. Now the
color is applied even for uncheck checkboxes.
2015-06-12 12:02:19 -04:00
Francis Lachapelle a9ad21b395 (js) Improve handling of message flags
We now call the model's methods from the template. Uncluttered the
message controller. Fixed the synchronization of the flags with the
messages list.
2015-06-12 12:02:19 -04:00
Francis Lachapelle ec123b4512 Improve tags chips of message viewer 2015-06-12 12:02:18 -04:00
Francis Lachapelle f27544c72c (js) New sgCompile directive to render mail parts 2015-06-12 12:02:18 -04:00
Francis Lachapelle 9ed65e34ad JSONify mail parts 2015-06-12 12:02:18 -04:00
Ludovic Marcotte 6cd02043af (feat) can now batch delete messages 2015-06-12 12:02:17 -04:00
Ludovic Marcotte 0edc2c1217 Added email button for selected contacts (to be implemented) 2015-06-12 12:02:17 -04:00
Francis Lachapelle 2fa0e91ca7 (js) AddressBook service: Improve documentation 2015-06-12 12:02:17 -04:00
Francis Lachapelle b37892e033 (js) Card service: Improve initialization 2015-06-12 12:02:17 -04:00
Francis Lachapelle 2b6d9db83a API documentation for batchDelete
Also return a proper JSON-payload in case of an error
2015-06-12 12:02:17 -04:00
Ludovic Marcotte 7d54bd5e86 Initial work for muliple selections + new toolbar with ops 2015-06-12 12:02:16 -04:00
Francis Lachapelle 499e66ffe9 (css) Improve contacts and messages lists 2015-06-12 12:02:16 -04:00
Francis Lachapelle 395f3585ca (js) Improve user search in AddressBook ACL editor 2015-06-12 12:02:15 -04:00
Francis Lachapelle 9f9cd68997 (fix) Partial fix for md-contact-chips
Those fixes resolve the JavaScript errors, but the behavior is wrong;
the displayed results are delayed with respect to the search string.
md-contact-chips is expected to change (for the best) soon.
2015-06-12 12:02:15 -04:00
Francis Lachapelle ab38134ba9 Improve user search auto-completion 2015-06-12 12:02:14 -04:00
Francis Lachapelle a52e6604c1 Improve contact list auto-completion 2015-06-12 12:02:14 -04:00
Francis Lachapelle b65573472e Don't use node-sass 3.0.0, yet 2015-06-12 12:02:14 -04:00
Francis Lachapelle 160055a874 Remove unused CSS files 2015-06-12 12:02:13 -04:00
Francis Lachapelle 2d46f4fd33 (js) Improve Contacts controllers 2015-06-12 12:02:13 -04:00
Francis Lachapelle 0eb2ecd2f2 (js) Improve Gravatar support 2015-06-12 12:02:13 -04:00
Francis Lachapelle 8568094266 (wox) Improve mobile display of Contacts 2015-06-12 12:02:12 -04:00
Ludovic Marcotte 5e2bdcd2ba (fix) pimped the login form and added SOGoLoginDomains support 2015-06-12 12:02:12 -04:00
Francis Lachapelle 2095df7865 Update .gitignore 2015-06-12 12:02:12 -04:00
Francis Lachapelle 618d3d9cc0 (js) Fix dependency injections 2015-06-12 12:02:12 -04:00
Francis Lachapelle 874e393948 (js) New file structure for login page (RootPage) 2015-06-12 12:02:11 -04:00
Ludovic Marcotte d056f5581a (fix) do not autocapitalize the username field 2015-06-12 12:02:11 -04:00
Ludovic Marcotte a8f52b30b8 (fix) adjusted the template after refactoring 2015-06-12 12:02:11 -04:00
Francis Lachapelle 1dc5f0d412 (js) New file structure for Angular modules
JavaScript files are now merged by the 'js' Grunt task.
2015-06-12 12:01:21 -04:00
Ludovic Marcotte b1ff1d4365 (fix) many UI improvements in the pref panel 2015-06-12 12:01:19 -04:00
Ludovic Marcotte 7e82ece74c (fix) hide the detail view when we have nothing to show 2015-06-12 11:59:05 -04:00
Francis Lachapelle a5cf7659eb (js) Fix Message service initialization 2015-06-12 11:59:04 -04:00
Luc Charland 43b6006a86 removed the unneeded sleep 2015-06-12 11:59:04 -04:00
Ludovic Marcotte 7eb58db949 (fix) also remove the Draft flag 2015-06-12 11:59:04 -04:00
Ludovic Marcotte 12c8207836 (feat) flag/unflag messages 2015-06-12 11:59:04 -04:00
Ludovic Marcotte b16c17457e (fix) disabled the toggles for priority/return receipt for now 2015-06-12 11:59:04 -04:00
Ludovic Marcotte 2d22c56efe (feat) added replied/forwarded message status support + pimped UI a bit 2015-06-12 11:59:04 -04:00
Ludovic Marcotte 8a74c9f9e0 (fix) recipients handling was broken since moving to chips 2015-06-12 11:59:03 -04:00
Ludovic Marcotte c09e76f2d1 (feat) handle show cc/bcc/attachments in mail composition 2015-06-12 11:59:03 -04:00
Luc Charland 4fa33c0bc2 All tests now pass in version 3 2015-06-12 11:59:03 -04:00
Ludovic Marcotte b0318ca7b6 (feat) chips for mail labels 2015-06-12 11:59:03 -04:00
Francis Lachapelle 8e0230488f (css) Remove Compass dependency 2015-06-12 11:59:02 -04:00
Francis Lachapelle b20707d0ed (css) Add rem function from ng's variables.scss 2015-06-12 11:59:02 -04:00
Ludovic Marcotte cc7c7f7dc7 Fixed wrong subheader name 2015-06-12 11:59:02 -04:00
Francis Lachapelle 8b483136d0 Fix compilation warning in UIxJSONPreferences.m 2015-06-12 11:59:02 -04:00
Francis Lachapelle 2888034ea6 (js) Create new appointment from Calendar module 2015-06-12 11:59:02 -04:00
Francis Lachapelle 520103cffe (js) Extend String with method 'capitalize' 2015-06-12 11:59:01 -04:00
Francis Lachapelle 12d5b57624 (js) Handle web calendars in Calendar model 2015-06-12 11:59:01 -04:00
Francis Lachapelle 523532b153 (js) Resource.post: argument 'id' is optional 2015-06-12 11:59:01 -04:00
Francis Lachapelle fc3c362515 (css) Grow width of message viewer 2015-06-12 11:59:00 -04:00
Francis Lachapelle 0c213c9e66 (js) Improve code of Calendar module
Integrated usage of 'controllerAs'.
2015-06-12 11:59:00 -04:00
Francis Lachapelle 494e2be680 (js) Save addressbook search string
This allow to show the email address that matches the search string (if
it does)
2015-06-12 11:59:00 -04:00
Francis Lachapelle d9184d2363 Format HTML + remove fab button from mail viewer 2015-06-12 11:59:00 -04:00
Francis Lachapelle d9b67a85f2 Return the proper HTTP code when saving an event 2015-06-12 11:59:00 -04:00
Francis Lachapelle e59a4b4246 Use of Dialog.prompt service in Contacts module 2015-06-12 11:58:59 -04:00
Francis Lachapelle 666d36736f Fix/improve search filter of Contacts module 2015-06-12 11:58:59 -04:00
Francis Lachapelle 33b035b360 LDIF to vCard: Handle multiple emails & phones 2015-06-12 11:58:59 -04:00
Ludovic Marcotte 41bc68946d Improved the UI of the bottom sheet content 2015-06-12 11:58:59 -04:00
Ludovic Marcotte f515543e33 (fix) many adjustments regarding auxiliary accounts 2015-06-12 11:58:58 -04:00
Francis Lachapelle 6d64242382 (fix) Restore radio-button.scss 2015-06-12 11:58:58 -04:00
Francis Lachapelle d3916e6e5e Improve API documentation 2015-06-12 11:58:57 -04:00
Francis Lachapelle f2833a2781 JSONify [UIxCalMainActions addWebCalendarAction] 2015-06-12 11:58:57 -04:00
Francis Lachapelle 9e8d991099 Display relative dates in Calendar module 2015-06-12 11:58:57 -04:00
Ludovic Marcotte 1e3cb57567 (fix) removal of mail account 2015-06-12 11:58:57 -04:00
Ludovic Marcotte bc67ffe20d (feat) Gravatar support for mail/contacts 2015-06-12 11:58:57 -04:00
Francis Lachapelle d0ee85e77a Add button to create new mailbox from account root 2015-06-12 11:58:57 -04:00
Francis Lachapelle b390a4b117 (css) Enlarge width of "detail" view 2015-06-12 11:58:56 -04:00
Francis Lachapelle bb05ce89c9 (js) Improve Dialog service 2015-06-12 11:58:56 -04:00
Francis Lachapelle 16b75b1deb Improve lists in sidenav
- the ripple effect is now visible when clicking on list items;
- the fab icon has been moved over the items list;
- colorized the checkboxes of the calendars list.
2015-06-12 11:58:56 -04:00
Ludovic Marcotte 4dbd796fd5 Added color "avatar" for mail labels 2015-06-12 11:58:55 -04:00
Ludovic Marcotte affa6ba656 (fix) new calendar category now showing color too 2015-06-12 11:58:54 -04:00
Ludovic Marcotte 8074e67b84 (fix) default calendar category colors 2015-06-12 11:58:54 -04:00
Ludovic Marcotte d43d31d144 (fix) correctly initialize arrays 2015-06-12 11:58:54 -04:00
Ludovic Marcotte 966a088a0f (fix) correctly initialize the PreventInvitationsWhitelist array 2015-06-12 11:58:53 -04:00
Ludovic Marcotte ebf4c1a9c7 (fix) also handle forwardAddress 2015-06-12 11:58:53 -04:00
Ludovic Marcotte dd13abd701 Fixed pref module 2015-06-12 11:58:53 -04:00
Ludovic Marcotte aa4dc45aa7 fix over previous commit 2015-06-12 11:50:50 -04:00
Ludovic Marcotte e1d8854d10 (fix) correctly generate the Sieve script 2015-06-12 11:50:50 -04:00
Luc Charland 243726f096 Changed preferences to use JSON for v3 2015-06-12 11:50:50 -04:00
Ludovic Marcotte f49610f058 (fix) renamed md-content -> md-dialog-content regarding changes in angular-material 2015-06-12 11:49:37 -04:00
Ludovic Marcotte a166d1b4cf Using chips for adding/viewing contact categories 2015-06-12 11:47:50 -04:00
Francis Lachapelle 8557b2a161 (fix) Reset button of contact and event editors 2015-06-12 11:47:50 -04:00
Francis Lachapelle d77f75da49 (fix) Save card in Contacts module 2015-06-12 11:47:50 -04:00
Ludovic Marcotte 0f1b0bfbbe Fixed ui routing for card editor 2015-06-12 11:47:50 -04:00
Ludovic Marcotte 91c92e3a11 added new calendar feature 2015-06-12 11:47:50 -04:00
Ludovic Marcotte 1f5248371c Disabled unuseful md-select for now 2015-06-12 11:47:49 -04:00
Ludovic Marcotte dbf614a2dc Re-enabled textures 2015-06-12 11:47:49 -04:00
Francis Lachapelle c957b4b45f Initial component editor in Scheduler module 2015-06-12 11:47:49 -04:00
Ludovic Marcotte feee156c0a Added calendar sharing capability 2015-06-12 11:47:48 -04:00
Francis Lachapelle 0d62ec0bea (js) Split Calendars list by type
The list of calendars is now splitted by type: personal calendars and
other's calendars (subscriptions).

The constructor of the Calendar model has been improved.
2015-06-12 11:47:48 -04:00
Francis Lachapelle 550fc09ee4 Add attribute isReadOnly to event/task JSON view 2015-06-12 11:47:47 -04:00
Ludovic Marcotte 5e3b3e6987 Added ACL sharing capabilities for address books 2015-06-12 11:47:47 -04:00
Ludovic Marcotte 77269e5cd6 Used the avatar for consistency with other dialogs 2015-06-12 11:47:46 -04:00
Francis Lachapelle 8c9a074688 (css) Add sticky component for subheaders 2015-06-12 11:47:46 -04:00
Francis Lachapelle 5247200bf0 (css) Improve lists and subheaders components 2015-06-12 11:47:46 -04:00
Francis Lachapelle 96ebc32d8a Split AddressBooks list by type
The list of addressbook books is now splitted by type: personal
addressbooks, other's addressbooks (subscriptions) and global
addressbooks (from sogo.conf, per domain).

The main ui-view has been splitted and therefore an additional
controller has been created.

The constructor of the AddressBook model has been improved.
2015-06-12 11:47:46 -04:00
Ludovic Marcotte 19c12add73 Added the capability to create address books 2015-06-12 11:47:46 -04:00
Ludovic Marcotte ecf30daaf3 Removed useless file 2015-06-12 11:47:45 -04:00
Ludovic Marcotte 47e7201eb6 added list avatar, make use of it 2015-06-12 11:47:45 -04:00
Ludovic Marcotte 174accdb23 Display category color 2015-06-12 11:47:45 -04:00
Francis Lachapelle 62468d21ef Improve template for sgSubscribe directive 2015-06-12 11:46:50 -04:00
Ludovic Marcotte 9571befbfd Added logoff feature 2015-06-12 11:46:50 -04:00
Ludovic Marcotte 36189e4203 Added calendar subscription 2015-06-12 11:46:50 -04:00
Ludovic Marcotte 428f2586c7 Added addressbook subscription support 2015-06-12 11:46:49 -04:00
Ludovic Marcotte 5ea57f195b Allow creation or list/contact 2015-06-12 11:46:49 -04:00
Ludovic Marcotte 11179cf27d Use a label instead of subheader, it's more sexy 2015-06-12 11:46:49 -04:00
Ludovic Marcotte 2ff6131483 Added list editor/viewer, fixed contact editor 2015-06-12 11:46:49 -04:00
Francis Lachapelle 7b874d08d4 Improve sidenav lists 2015-06-12 11:46:48 -04:00
Luc Charland 3858911007 Changed login from urlencoded to json 2015-06-12 11:46:48 -04:00
Ludovic Marcotte a25a01495f Added chips for prevent invitations 2015-06-12 11:46:48 -04:00
Francis Lachapelle 781d55cc37 Force colors of sgFolderStylesheet 2015-06-12 11:46:06 -04:00
Francis Lachapelle 5d5d8bc201 (html) Fix list of messages of selected mailbox 2015-06-12 11:46:06 -04:00
Luc Charland 0cdd19e3aa fixed a missing semi-colon 2015-06-12 11:46:05 -04:00
Francis Lachapelle 0f21c02a5f (html) Fix template of sgFolderTree directive 2015-06-12 11:46:05 -04:00
Francis Lachapelle ecad0c367f (html) Fix list of messages of selected mailbox 2015-06-12 11:46:05 -04:00
Francis Lachapelle eeca191103 (css) Cleanup sidenav component
Remove duplicated definitions from angular material source and prepare
for right sidenav.
2015-06-12 11:46:05 -04:00
Francis Lachapelle 3f27e5b775 (css) Dirty fix for vs-repeat damages 2015-06-12 11:46:04 -04:00
Ludovic Marcotte 991351999e Removed unused statement 2015-06-12 11:46:04 -04:00
Ludovic Marcotte c76bca3f68 arial label 2015-06-12 11:46:04 -04:00
Ludovic Marcotte 0529de2c1c Removed useless stuff 2015-06-12 11:46:03 -04:00
Francis Lachapelle b141031ccd Initialize arrays of new message instance 2015-06-12 11:46:03 -04:00
Francis Lachapelle 6971632165 (scss) Remove deprecated textfield component 2015-06-12 11:46:02 -04:00
Francis Lachapelle b9eb0f9a69 (scss) Integrate md-chips 2015-06-12 11:46:02 -04:00
Francis Lachapelle 0924b5154e Replace ngTagsInput by md-chips + md-autocomplete 2015-06-12 11:46:02 -04:00
Benoit Favreault 14597f8f16 Update angular-material to commit 96559458633f90dafd543d3a88f9a2165fd76ac3 2015-06-12 11:46:01 -04:00
Benoit Favreault fc69d6b1d4 Change paper palette defaults hues
Fix mobile show-hide
2015-06-12 11:46:01 -04:00
Benoit Favreault 321cfb8467 Update angular-material to commit 77504e9ff178abf02c0886d7f6cfad7d68239fca 2015-06-12 11:46:01 -04:00
Francis Lachapelle da9dbd8ad5 (fix) Restore checkbox.scss 2015-06-12 11:46:01 -04:00
Francis Lachapelle 4626039e5c (fix) JavaScript errors on Mail preferences tab 2015-06-12 11:46:01 -04:00
Benoit Favreault 41f598c9ed Reset SchdulerUI.scss to [6ee715d] 2015-06-12 11:45:38 -04:00
Benoit Favreault f080536b3f Resolve conflict 2015-06-12 11:45:38 -04:00
Benoit Favreault af57fa84e4 Update angular-material [commit 42db19dd5571eb88ba8d2a9667d183d9f3d61da7] 2015-06-12 11:45:38 -04:00
Benoit Favreault 46a262acfa Cleaning unused scss files 2015-06-12 11:45:38 -04:00
Francis Lachapelle a276ac366e Set width/position of events blocks and add colors 2015-06-12 11:45:10 -04:00
Francis Lachapelle 82d1d5e701 Review calendar views templates
Changed month view to a md-grid-list.
Added some colors.
2015-06-12 11:45:10 -04:00
Francis Lachapelle 305c13d720 Add common template UIxTopnavToolbarTemplate.wox 2015-06-12 11:45:09 -04:00
Ludovic Marcotte 0de02262d0 (fix) make sure we can always add filters 2015-06-12 11:45:09 -04:00
Ludovic Marcotte d581054214 (fix) fixed default values for many prefs 2015-06-12 11:45:09 -04:00
Francis Lachapelle e8acb225e4 Add md-grid-list and md-autocomplete components 2015-06-12 11:45:08 -04:00
Ludovic Marcotte 6e36154b1b (fix) retagged properly for latest angular-material changes 2015-06-12 11:45:08 -04:00
Francis Lachapelle 8f47e62dd2 Calendar module: add month view 2015-06-12 11:44:35 -04:00
Ludovic Marcotte a2c469d46a (fix) correctly handle PreventInvitationsWhitelist 2015-06-12 11:44:35 -04:00
Ludovic Marcotte 6f59955340 (fix) sanitize autoReplyEmailAddresses 2015-06-12 11:44:35 -04:00
Ludovic Marcotte 70e5b1d4aa (fix) pref template now looks like others 2015-06-12 11:44:34 -04:00
Ludovic Marcotte f262347149 (fix) more defaults values in the prefs 2015-06-12 11:44:34 -04:00
Ludovic Marcotte 7168779684 (feat) added password change support 2015-06-12 11:44:34 -04:00
Ludovic Marcotte d21715d8f1 (fix) right localized string + one for account locked 2015-06-12 11:43:53 -04:00
Ludovic Marcotte 1fe5e39254 Default value for short date format 2015-06-12 11:43:52 -04:00
Ludovic Marcotte 023362797b Icons and flexbox additions to the guide 2015-06-12 11:43:52 -04:00
Ludovic Marcotte 772a682655 (fix) correctly localize mail labels from common bundle 2015-06-12 11:43:52 -04:00
Francis Lachapelle 4252b66b6e Initial SOGo developer's guide 2015-06-12 11:43:52 -04:00
Francis Lachapelle 91acb9d0c5 Integrate UIxSidenavToolbarTemplate in all modules 2015-06-12 11:43:51 -04:00
Francis Lachapelle 171b5085ab Fix GNUmakefile for latest underscore package 2015-06-12 11:42:40 -04:00
Benoit Favreault c38a23d9b1 Hot-fix for build problem 2015-06-12 11:42:39 -04:00
Benoit Favreault 92ecdd52ad Hot-fix for build problem (commit/74dda0206595acb1c48f7d328fd96b64025542bb) 2015-06-12 11:42:39 -04:00
Ludovic Marcotte 8b093f9001 (fix) broken template, additional </div> closing tag 2015-06-12 11:42:39 -04:00
Benoit Favreault 5797e70358 Made bottom sheet opaque 2015-06-12 11:42:39 -04:00
Benoit Favreault a75719e151 Fix fab-button positionning 2015-06-12 11:42:38 -04:00
Benoit Favreault a5c9f41375 Fixed "fantom account" 2015-06-12 11:42:38 -04:00
Benoit Favreault 00d2154c0e fix card background color (angular-material regression)
Change views container justification
hide sg-menu components
2015-06-12 11:42:38 -04:00
Francis Lachapelle 0fc027e5e9 Set the doctype to HTML5 2015-06-12 11:42:37 -04:00
Francis Lachapelle 5f7abec980 Gruntfile.js: add postcss:dist to build task 2015-06-12 11:42:37 -04:00
Francis Lachapelle 6c4a82571c Calendar module: add day view 2015-06-12 11:42:37 -04:00
Francis Lachapelle 7ef01304ee Add debounce to sgSearch Angular directive 2015-06-12 11:42:37 -04:00
Francis Lachapelle 8d66f62cad [fix] JS syntax error on login page 2015-06-12 11:42:37 -04:00
Benoit Favreault eaeae77be4 Fix (tried to) regressions introduced by angular-material update 2015-06-12 11:42:08 -04:00
Benoit Favreault 1477bd6eae Regression fixes 2015-06-12 11:42:08 -04:00
Benoit Favreault fe8c1b927c Fix mobile transitions (sort of) 2015-06-12 11:42:07 -04:00
Benoit Favreault a554158686 Fix mobile transitions (sort of) 2015-06-12 11:42:07 -04:00
Benoit Favreault f6cb8f226a Edit scss-lint to prevent false positive warnings 2015-06-12 11:42:07 -04:00
Benoit Favreault 5224a7b304 Fix fab-button positioning (still some strange corner-cases from md sources) 2015-06-12 11:42:07 -04:00
Benoit Favreault b5bea16abb Add sassyJSON library 2015-06-12 11:42:07 -04:00
Benoit Favreault 3441a66040 Add paper texture to toolbar and sidenav 2015-06-12 11:42:06 -04:00
Benoit Favreault e69c47854a Fine-tune layout 2015-06-12 11:41:28 -04:00
Benoit Favreault 2c8d1b5db7 Alternate mobile transitions 2015-06-12 11:41:27 -04:00
Francis Lachapelle 2446677172 [fix] Add definition of UIxSidenavToolbarTemplate 2015-06-12 11:41:27 -04:00
Francis Lachapelle abe9a85c4f SOGo.SchedulerUI AngularJS module 2015-06-12 11:41:26 -04:00
Francis Lachapelle a57bf56165 [fix] Possible exception in UIxCalendarSelector.m 2015-06-12 11:41:26 -04:00
Francis Lachapelle 9a1c2b6a11 New ng directives for Calendar module
- sgCalendarDayTable
- sgCalendarDayBlock
2015-06-12 11:41:26 -04:00
Francis Lachapelle 4b47e5de83 Calendar module: initial AngularJS-based templates 2015-06-12 11:41:25 -04:00
Francis Lachapelle 22c9b61246 Extend String and Date native JS objects 2015-06-12 11:41:25 -04:00
Francis Lachapelle e9db6cda61 UIxCalListingActions: improve style and syntax 2015-06-12 11:41:25 -04:00
Francis Lachapelle 44c49abbec Calendar list: use 'name' instead of 'displayName' 2015-06-12 11:41:25 -04:00
Francis Lachapelle 8b6a3d0e3f Initial JavaScript models for calendar module 2015-06-12 11:41:25 -04:00
Francis Lachapelle d72f83ee95 Save calendar: use 'name' instead of 'displayName' 2015-06-12 11:41:24 -04:00
Benoit Favreault ba35bc801f Add a grunt task target postcss:dev (no minification) 2015-06-12 11:41:24 -04:00
Ludovic Marcotte 10a017503e Now enforce SOGoMailCustomFromEnabled 2015-06-12 11:41:24 -04:00
Ludovic Marcotte bb1977fa93 Wiped unused scss file 2015-06-12 11:40:07 -04:00
Ludovic Marcotte cf4593917f More form validation 2015-06-12 11:40:07 -04:00
Francis Lachapelle ae2990d8d6 Review core scss following ng-material changes 2015-06-12 11:40:06 -04:00
Benoit Favreault 05e58b30cc Replace mobile detail-view transitions
Minor adjustments to layout
2015-06-12 11:39:49 -04:00
Ludovic Marcotte 2bc44dec9b Improved preferences module (save/load, checks on enabled modules, etc.) 2015-06-12 11:38:08 -04:00
Benoit Favreault 48b74b0f6b Add responsiveness (First draft) 2015-06-12 11:35:54 -04:00
Francis Lachapelle 516e5fd303 Add current date in top bar 2015-06-12 11:35:54 -04:00
Ludovic Marcotte 0241cacbf9 Added some data validation 2015-06-12 11:35:53 -04:00
Benoit Favreault 78da72f3cb Replace specific list-view by generic (class-based) view 2015-06-12 11:35:52 -04:00
Benoit Favreault 660af9abfd Amend previous:
Add a view-detail class (for more generic use)
Fix the regression (scroll) problem on contact editor
2015-06-12 11:35:52 -04:00
Benoit Favreault b4f2b470dc Add a scss-lint config file 2015-06-12 11:35:52 -04:00
Benoit Favreault f99dae331d Add a view-detail class (for more generic use)
Fix the regression (scroll) problem on contact editor
2015-06-12 11:35:52 -04:00
Benoit Favreault 655fe5f731 Fix regression on Contact editor 2015-06-12 11:35:52 -04:00
Francis Lachapelle 72968f2e6e Indentation of Gruntfile.js 2015-06-12 11:35:51 -04:00
Ludovic Marcotte 0f2e3df164 More cleanups, defaults values for mail/contact/calendar labels and data validation 2015-06-12 11:35:51 -04:00
Benoit Favreault 818af41ea6 Add breakpoints management librairies
Add grunt-contrib-compass (required)
Edit gruntfile.js (add compass tasks)

--don't forget to update bower components
2015-06-12 11:34:29 -04:00
Benoit Favreault 6153e88f62 Add animation params 2015-06-12 11:34:29 -04:00
Ludovic Marcotte 6636fe3625 Disabled lots of unused code (to be removed) in v3/prefs 2015-06-12 11:34:28 -04:00
Ludovic Marcotte 96d2a4cea8 Preferences saving support 2015-06-12 11:27:17 -04:00
Francis Lachapelle 2edfd1863b Addressbook module: improve routing views handling 2015-06-12 11:26:07 -04:00
Benoit Favreault 766c421b53 Remove margin from date in msg list 2015-06-12 11:26:07 -04:00
Francis Lachapelle f909fe657f Webmail: fix cancel button of message editor 2015-06-12 11:26:07 -04:00
Francis Lachapelle 885140c92a Addressbook module: fix edit button 2015-06-12 11:26:07 -04:00
Francis Lachapelle 6bf22795f3 Improve bower.json 2015-06-12 11:26:07 -04:00
Francis Lachapelle 3864264787 JS Card model: initialize birthday as Date object 2015-06-12 11:26:06 -04:00
Francis Lachapelle a3aaf36477 Contact editor: remove extra bottom padding 2015-06-12 11:26:06 -04:00
Francis Lachapelle 4f6babcdcc Add cancel button to Webmail editor 2015-06-12 11:26:06 -04:00
Ludovic Marcotte 56763e1aca Removed dead code, support for adding calendar categories, disabled unused tab 2015-06-12 11:26:05 -04:00
Francis Lachapelle a787521977 Restore md-button in sgSearch directive 2015-06-12 11:22:46 -04:00
Benoit Favreault ca1831271b Make iconButton round to display a more elegant ripple-effect 2015-06-12 11:22:45 -04:00
Benoit Favreault d6a294b89f Fix breakpoints in scss and js (in await for a more elegant solution) 2015-06-12 11:22:45 -04:00
Francis Lachapelle 6b1fe301a6 Fix mail search criteria 2015-06-12 11:22:45 -04:00
Francis Lachapelle 8d003a7c35 Return used space of quota as a number in JSON 2015-06-12 11:22:45 -04:00
Francis Lachapelle db9e3a5401 Use sgSearch directive in Webmail module 2015-06-12 11:22:45 -04:00
Francis Lachapelle 01d4134a23 Use sgSearch directive in addressbook module 2015-06-12 11:22:44 -04:00
Francis Lachapelle 44164c0f43 Improve and document Webmail search options 2015-06-12 11:22:44 -04:00
Francis Lachapelle 68eec08de6 New sgSearch Angular directive 2015-06-12 11:22:44 -04:00
Francis Lachapelle 0e3cbe8c98 Improve "load images" button from Webmail 2015-06-12 11:22:44 -04:00
Benoit Favreault 4ab4ac0f11 Fix card.view template to prevent useless element (<ui-view="undefined">) injection 2015-06-12 11:22:43 -04:00
Benoit Favreault 8cebc00f7a Polish UI (Contact and Mail)
- Unifiy & simplify markup
- Add visual consistency
2015-06-12 11:22:43 -04:00
Benoit Favreault 01f1cbbd75 Fix minor deprecations in Preferences template 2015-06-12 11:22:43 -04:00
Benoit Favreault 6a304b3e07 Fix sidenav icon-button 2015-06-12 11:22:43 -04:00
Ludovic Marcotte 5b674abcf1 Fixed preferences module wrt recent changes 2015-06-12 11:22:43 -04:00
Benoit Favreault e756053f8b Replace bottom-bar by bottom-sheet
Adjust sidenav layout
Unify background colors
2015-06-12 11:18:00 -04:00
Benoit Favreault 69d0a3ad57 Minor adjustment to toolbar date 2015-06-12 11:17:59 -04:00
Benoit Favreault a57713523b Finish the toolbars
Add an app button on sidenav
Add a logout select on sidenav
2015-06-12 11:17:59 -04:00
Benoit Favreault 9fc713dc5f Create a 'css' grunt task (sass + postcss) 2015-06-12 11:17:59 -04:00
Benoit Favreault 31bb97aaec Update angular-material [dc2d204] master 2015-06-12 11:17:58 -04:00
Francis Lachapelle 1d8dbbfe2c Restore compose mail button 2015-06-12 11:17:58 -04:00
Francis Lachapelle fc72d3b12a Cleanup references to ZURB Foundation 2015-06-12 11:17:58 -04:00
iRouge bdbbc5be47 Fix login window according to specs 2015-06-12 11:17:57 -04:00
Francis Lachapelle f1cdb3a472 Cleanup dead code from js/Common/ui.js 2015-06-12 11:17:57 -04:00
iRouge fdb4cd71eb Fix sidenav toolbar (logo and buttons) 2015-06-12 11:17:56 -04:00
iRouge 90cd79a21b Adjust Contact view (center card in right container) 2015-06-12 11:17:55 -04:00
iRouge 90c359779e Fix Contact editor layout 2015-06-12 11:17:55 -04:00
iRouge 0cd4688e64 Update material-angular (release 0.8.3) 2015-06-12 11:17:55 -04:00
iRouge 9c42350caa Add aria-label to iconButtons 2015-06-12 11:17:55 -04:00
iRouge 1ac49415d1 Remove (useless) "close" button on sidenav 2015-06-12 11:17:54 -04:00
iRouge bed46ba2eb Correct sources to prevent angular.js deprecation Warning
Correct scss to prevent 404 server response
2015-06-12 11:17:54 -04:00
iRouge 02cdc869be Apply iconButton to Contact and Mail 2015-06-12 11:17:54 -04:00
iRouge 4264d054ca Create Sass component: iconButton 2015-06-12 11:17:53 -04:00
iRouge b6f83f3275 Update angular-material 2015-06-12 11:17:53 -04:00
iRouge 1fc846bf5c Update angular-material 2015-06-12 11:17:53 -04:00
iRouge 2d2edabb18 Add action "create new contact" to button 2015-06-12 11:17:53 -04:00
iRouge dcfa43ab28 Update angular-material 2015-06-12 11:17:53 -04:00
iRouge b0d7fff56a Add Selected-state to lists elements (Contacts and Messages) -- Amend previous 2015-06-12 11:17:52 -04:00
iRouge be4d56b7e1 Add Selected-state to lists elements (Contacts and Messages) 2015-06-12 11:17:52 -04:00
Francis Lachapelle fefd4fc7c7 Fix md-select 2015-06-12 11:17:52 -04:00
iRouge 855acccd6d Update angular-material 2015-06-12 11:17:52 -04:00
iRouge 80d6c0226a Adjust UI for Contact, Contact editor, Messages and Message editor 2015-06-12 11:17:51 -04:00
Francis Lachapelle 15dab4dfe5 Add placeholder to type selects of contact editor 2015-06-12 11:17:51 -04:00
Francis Lachapelle dbb08a762a Fix "add" buttons of contact editor 2015-06-12 11:17:51 -04:00
Francis Lachapelle af144585a5 Cleanup formatting of attributes in HTML templates 2015-06-12 11:17:50 -04:00
Francis Lachapelle 6a25ccfe96 Remove data- prefix in attributes of HTML tags 2015-06-12 11:17:50 -04:00
Francis Lachapelle dd84782427 Cleanup .gitignore 2015-06-12 11:17:49 -04:00
iRouge 012d953d65 Add an input-container to search field in Contact toolbar 2015-06-12 11:17:49 -04:00
iRouge 5819cc75d3 Style Contact Editor UI: Ready to test
Some functional bugs remaining
2015-06-12 11:17:49 -04:00
Ludovic Marcotte 5c3f0138f5 First pass at the v3 pref module
The UI needs to be styled. We also need to properly load "default"
values from the system/domain/user defaults and save them correctly
too.
2015-06-12 11:17:49 -04:00
Francis Lachapelle 575676deb8 Add search field in AddressBook module 2015-06-12 10:50:10 -04:00
Francis Lachapelle 4b9eb44790 Initial integration of md-select in contact editor 2015-06-12 10:50:10 -04:00
Francis Lachapelle dc538f969e Cleanup dependencies in bower.json 2015-06-12 10:50:10 -04:00
iRouge e32f6d3086 Update angular-material 2015-06-12 10:50:09 -04:00
Francis Lachapelle 4bce4ff988 Update angular-material 2015-06-12 10:50:09 -04:00
iRouge fe071a5435 Style contact editor (email addresses with select) 2015-06-12 10:50:09 -04:00
iRouge 6b58f3a080 Style contact editor (model for add and remove) 2015-06-12 10:50:08 -04:00
iRouge 1d61e33a51 Update angular-material (select are fixed !) 2015-06-12 10:50:08 -04:00
iRouge 79dc49b905 Style contact editor layout (needs more work) 2015-06-12 10:50:08 -04:00
iRouge b81f98236c Style contact-view layout 2015-06-12 10:50:08 -04:00
iRouge b7adf2814d Refactor:
- use lowercase and hyphen name for new component according to Sass Guidelines
- change every uses by hand (thanks to my stupid IDE WebStorm)
2015-06-12 10:50:07 -04:00
iRouge 5980f8e90e Create new Sass component: pseudo-input 2015-06-12 10:50:07 -04:00
iRouge cfed9c2058 Update angular-material 2015-06-12 10:50:07 -04:00
iRouge 16440998de Fix Messages editor:
- textarea field
- labels and placeholders color
2015-06-12 10:50:07 -04:00
iRouge 1264dbad73 Skin Contact editor according to Material Design specs (still buggy) 2015-06-12 10:50:06 -04:00
iRouge 3fb8a42856 Fix login layout ;-) (md-select are still buggy) 2015-06-12 10:50:06 -04:00
Francis Lachapelle 4a4658e29d Add missing npm modules for grunt postcss 2015-06-12 10:50:06 -04:00
Francis Lachapelle 7ff934a5cb Remove dependency of hammer.js 2015-06-12 10:50:06 -04:00
Ludovic Marcotte 6d4147fa34 fixed templates 2015-06-12 10:50:05 -04:00
iRouge b2c71ceae9 Add box-shadow to Mail editor 2015-06-12 10:50:05 -04:00
iRouge 4185cc37fe Style the plain-text Mail editor
Style Contacts
Style Contact editor (buggy)
Change postcss config
2015-06-12 10:50:05 -04:00
Ludovic Marcotte 79a0a3684c Use md-select on the root page 2015-06-12 10:50:04 -04:00
Benoit Favreault dcd6c5fd5a Add autoprefixer and its dependancies (fix the buggy flex boxes in Safari and some older browsers) 2015-06-12 10:50:04 -04:00
Francis Lachapelle cc24b9b599 Add md-select SASS component 2015-06-12 10:50:04 -04:00
Francis Lachapelle 1569306ea0 Update angular-material subrepo 2015-06-12 10:50:04 -04:00
iRouge a1f0c9fd6e Update angular-material 2015-06-12 10:50:03 -04:00
Francis Lachapelle da22cd854b Fix compilation of UIxTaskEditor.m 2015-06-12 10:50:03 -04:00
Francis Lachapelle 94105e937a Improve JSON getter/setter for todos 2015-06-12 10:50:03 -04:00
Francis Lachapelle f47a22068f JSON: fix handling of dates of all-day events 2015-06-12 10:50:03 -04:00
Francis Lachapelle 177c933af4 Lowercase the status property of vEvent & vToDo 2015-06-12 10:50:02 -04:00
Francis Lachapelle bbc5a2a048 Fix compilation warning of SOGoAppointmentObject.m 2015-06-12 10:50:02 -04:00
Ludovic Marcotte 48ffe8fb7e Minor improvement to the template 2015-06-12 10:50:01 -04:00
Ludovic Marcotte e3d4a7a373 Deleted old CSS 2015-06-12 10:50:01 -04:00
Francis Lachapelle 4ddf92aadb JSON: Return ISO8601 dates in calendar components 2015-06-12 10:50:01 -04:00
Francis Lachapelle e226825bde Add [NSCalendarDate+SOGo iso8601DateString] 2015-06-12 10:50:01 -04:00
iRouge d8a816a335 Add toolbars Icons (several bugs, some remaining) 2015-06-12 10:50:00 -04:00
Ludovic Marcotte b9e7e24344 Fixed remember login option 2015-06-12 10:50:00 -04:00
Francis Lachapelle 23ce8904a9 Restore color transistion in sidenav.scss 2015-06-12 10:49:59 -04:00
Francis Lachapelle d1271799f4 Update angular-material version in bower.json 2015-06-12 10:49:59 -04:00
Ludovic Marcotte e5726d2840 WiP - some improvements to the login form 2015-06-12 10:49:58 -04:00
iRouge fcd5abfafc Update angular-material version 0.8.0-rc1 2015-06-12 10:49:57 -04:00
Francis Lachapelle 67c62fe85c Fix compilation of UIxComponentEditor.m 2015-06-12 10:49:57 -04:00
Francis Lachapelle f9271b747c Initial JSON actions to get/set an event 2015-06-12 10:48:00 -04:00
iRouge f694f57638 Minor tweaks to Mailer UI 2015-06-11 15:57:27 -04:00
iRouge 522108bdd3 [Amend previous commit]Styled ngTags for Mail editor and propose a chip-like version of tags 2015-06-11 15:57:27 -04:00
iRouge 780d757d6b Styled ngTags for Mail editor and propose a chip-like version of tags 2015-06-11 15:57:27 -04:00
iRouge df8b4e302f Styled ngTags but no hasFocus state 2015-06-11 15:57:27 -04:00
iRouge 1bb66bbf7d Skin the Mail editor except ng-tags 2015-06-11 15:57:26 -04:00
iRouge a1299fea97 Skin the Mail editor 2015-06-11 15:57:26 -04:00
Francis Lachapelle 221e49a5d1 Improve [iCalTrigger asDictionary] 2015-06-11 15:57:26 -04:00
iRouge d123b2d5d4 Change PseudoField-label font-weight 2015-06-11 15:57:26 -04:00
iRouge 4f2fc5c99e Fixed the message headers design (markup and scss)
Create a "PseudoField" component that mimics Material Design input fields
2015-06-11 15:57:25 -04:00
Francis Lachapelle e429dc3ff1 Add [iCalByDayMask initWithDaysAndOccurences:] 2015-06-11 15:57:25 -04:00
iRouge 9e7a051d25 Update angular-material 2015-06-11 15:57:25 -04:00
iRouge 75f38173c5 Adjust Messages header view
Add ngMaterial directives tomessage composer
2015-06-11 15:57:24 -04:00
Francis Lachapelle 4cd6ffcaec Messages list: add ng directives to icons 2015-06-11 15:57:24 -04:00
iRouge 12807457d4 Update angular-material 2015-06-11 15:57:24 -04:00
Ludovic Marcotte aefb27fc5c Initial (and fugly) materialization of the login page 2015-06-11 15:57:23 -04:00
iRouge cd32bcf961 Fine-tune presentation of Mailer UI
- Colors
- Icons
- Dimmensions
- Typography
2015-06-11 15:57:22 -04:00
iRouge 16f275af52 Add SOGo logo 2015-06-11 15:57:22 -04:00
iRouge 419f1bd698 Adjust containers width according to Google's specs 2015-06-11 15:57:21 -04:00
iRouge e00416e1b8 Apply colours to components 2015-06-11 15:57:21 -04:00
iRouge daaa4284cb Add Sass version of SOGo's palettes, mixin to generate theme-class and a getter function for convenient access to colours trough any scss 2015-06-11 15:57:20 -04:00
Francis Lachapelle 33e70cd3f3 Remove dependancy to angular-material.css 2015-06-11 15:57:20 -04:00
iRouge 44e56c92d0 Update Angular-Material to 0.7.1 : HEAD origin/master origin/HEAD master 2015-06-11 15:57:19 -04:00
iRouge 6404536d19 Add md-colors module 2015-06-11 15:57:19 -04:00
iRouge e7b7e9cefe Adjust z-indexes and box-shadows 2015-06-11 15:57:19 -04:00
iRouge 174b6f365b Typograpy : Messages list subheader 2015-06-11 15:57:18 -04:00
iRouge 08a76aef97 Adapt markup to typographic styles
- Mail Messages List
2015-06-11 15:57:18 -04:00
Francis Lachapelle bd61c354f0 Fix references to font files in typography.scss 2015-06-11 15:57:17 -04:00
Francis Lachapelle 13144aad3b Preparation for build of a unique CSS 2015-06-11 15:57:17 -04:00
iRouge b163e59563 Adjust typography for autoSrollList 2015-06-11 15:57:17 -04:00
iRouge 09fa2be5bd Typography auto-scroll List 2015-06-11 15:57:17 -04:00
Francis Lachapelle 36c931b596 Preparation for build of a unique CSS 2015-06-11 15:57:16 -04:00
Francis Lachapelle 6040838396 Don't use bower package of the font Fira 2015-06-11 15:57:16 -04:00
Francis Lachapelle 1a81abebaa Remove unused files from scss directory 2015-06-11 15:57:16 -04:00
iRouge a191c7a382 Typography : Google Material Design standard styles
- Layout is broken
2015-06-11 15:57:15 -04:00
iRouge 907df81436 Typography-2 2015-06-11 15:57:14 -04:00
iRouge 8f01b0c739 Add Fira Sans to font folder 2015-06-11 15:57:14 -04:00
Francis Lachapelle 8c974e6c1a Add Fira font 2015-06-11 15:57:10 -04:00
iRouge e73ed8ae44 Add bower sass-cache to gitignore 2015-06-11 15:57:10 -04:00
iRouge f59b078faa Typography 2 2015-06-11 15:57:09 -04:00
iRouge 6319b6f531 Typography 2015-06-11 15:57:09 -04:00
Francis Lachapelle 9671fbf506 Remove .sass-cache directory 2015-06-11 15:57:09 -04:00
iRouge 670d2bc382 Generate basic font-size according to Google Material design specs 2015-06-11 15:57:08 -04:00
Francis Lachapelle 6f6338bb64 Fix font file name in SASS 2015-06-11 15:57:06 -04:00
iRouge 1528b32cc7 Update fontes icônes 2015-06-11 15:57:06 -04:00
Francis Lachapelle e1b155b455 Remove fonts managed by bower & grunt 2015-06-11 15:57:06 -04:00
iRouge 72ae466541 Embedded Icon font source has base64 data URI in CSS 2015-06-11 15:57:06 -04:00
Francis Lachapelle 5cc14bb729 Remove reference to bower_components in CSS 2015-06-11 15:57:02 -04:00
Francis Lachapelle 79a5d61efb Improve sgFolderTree
Replaced the A link by a button and renamed the childLevel# CSS class by
a more appropriate sg-child-level-# class.
2015-06-11 15:57:02 -04:00
Francis Lachapelle c664648eb6 Fix processing of SCSS with Grunt
We now use the Ruby implementation of SASS (grunt-contrib-sass) since
libsass is not compatible with Compass.
2015-06-11 15:57:01 -04:00
Francis Lachapelle df6d957721 Fix mailbox rename operation 2015-06-11 15:57:01 -04:00
Francis Lachapelle ee9ef2f0e4 Remove unused SASS files 2015-06-11 15:57:01 -04:00
Francis Lachapelle 383ccdbc82 Add CSS animation to mailboxes tree 2015-06-11 15:57:00 -04:00
Francis Lachapelle 225d039f89 Improve sgFolderTree directive (mailboxes tree) 2015-06-11 15:57:00 -04:00
Francis Lachapelle 7f74d5a3d9 New sgEnter Angular directive 2015-06-11 15:57:00 -04:00
Francis Lachapelle 862068eeb5 Improve JSON getters for events 2015-06-11 15:56:59 -04:00
iRouge 56607a1baf Refactor contact editor form element templates markup and style 2015-06-11 15:56:34 -04:00
iRouge 750a41f19a CSS files for convenience 2015-06-11 15:56:34 -04:00
iRouge 6651b02ba2 Replace valueless attributes by classes 2015-06-11 15:56:33 -04:00
iRouge 3054c04261 Add a utility to replace attributes without values by classes 2015-06-11 15:56:33 -04:00
iRouge 04132023e6 Clean-up markup in templates 2015-06-11 15:56:33 -04:00
iRouge 60bd406eac Add import to bower_components ngMaterial 2015-06-11 15:56:33 -04:00
iRouge 7dc7662adf Fix a broken tag in UIxPageEditorTemplate 2015-06-11 15:56:33 -04:00
iRouge 047138984a Fix an update version issue 2015-06-11 15:56:32 -04:00
iRouge 1a7bfee6b6 define base theme : add palette definitions to module initialization 2015-06-11 15:56:32 -04:00
iRouge ee4c1c0706 define theme 2015-06-11 15:56:32 -04:00
iRouge eea5cf8d0b Edit gitignore to ignore built API doc 2015-06-11 15:56:32 -04:00
iRouge 67076cdffb Update angular-material 2015-06-11 15:56:31 -04:00
Francis Lachapelle 80785304f1 JSONify [UIxCalendarProperties saveAction] 2015-06-11 15:56:31 -04:00
Francis Lachapelle c934b3d9c0 Improve API doc of UIxContactEditor 2015-06-11 15:54:15 -04:00
Francis Lachapelle 794c1999bc Add bower package "material-design-iconic-font"
We actually don't use "material-design-fonticons"
2015-06-11 15:54:14 -04:00
Francis Lachapelle aaed279c50 Extend JSON response of calendar properties 2015-06-11 15:54:14 -04:00
Francis Lachapelle bd6a430d3a Add bower package "material-design-fonticons" 2015-06-11 15:54:14 -04:00
iRouge 746afe0f60 Add scss devtools 2015-06-11 15:54:13 -04:00
iRouge 1b807bd6f3 Icons to the message-template toolbar 2015-06-11 15:54:13 -04:00
iRouge 6e26040e19 Icon component (zavoloklom.github.io/material-design-iconic-font/index.html) 2015-06-11 15:54:13 -04:00
iRouge 6fde77ac3f Bottombar visibility 2015-06-11 15:54:13 -04:00
iRouge 296e8f09e5 Reformat code (indent) 2015-06-11 15:54:12 -04:00
iRouge 3b43cabc68 Revert [a5ba017bc3] (Regression fix) 2015-06-11 15:54:12 -04:00
Francis Lachapelle cc34d56a0e FIx compilation of UIxMailUserRightsEditor.m 2015-06-11 15:54:11 -04:00
Francis Lachapelle 6080e800d7 Improve API documentation 2015-06-11 15:54:11 -04:00
Francis Lachapelle f2587aa385 JSON-based getter operations for Calendar module 2015-06-11 15:54:11 -04:00
Francis Lachapelle cf8c4c482d Add static method in iCalPerson for partstate 2015-06-11 15:54:11 -04:00
Francis Lachapelle 8986a18dac Review mail user rights editor 2015-06-11 15:54:10 -04:00
Francis Lachapelle 9829cd4027 Minor improvements to Contacts user rights editor 2015-06-11 15:54:10 -04:00
Francis Lachapelle 2e2da46d84 JSON-based Contacts list: don't escape HTML
HTML is now sanitized on the client-side by AngularJS.
2015-06-11 15:54:10 -04:00
Francis Lachapelle 37e91733ca Improve API documentation 2015-06-11 15:54:09 -04:00
Francis Lachapelle c29719f49d Remove newAction from UIx{Appointment,Task}Editor
We now rely on [UIxFolderActions newguidAction]
2015-06-11 15:54:09 -04:00
iRouge a5a2028da7 Contact Form 2015-06-11 15:54:08 -04:00
Francis Lachapelle b8ad85b2e2 Rename ng-templates to match names of .wox files 2015-06-11 15:54:08 -04:00
iRouge 50b45678e3 Regression fix 2015-06-11 15:54:08 -04:00
iRouge bcce9ac76a Report body inline style in Sass
Create bottombar component
2015-06-11 15:54:08 -04:00
Francis Lachapelle 137e8e7290 Add [iCal(Repeatable)EntityObject attribtues]
Those methods are used to get the common attributes of a iCalendar
component (vEvent or vTodo).
2015-06-11 15:54:07 -04:00
Francis Lachapelle a22195beec Add method [iCalTrigger asDictionary]
This method is used to get a JSON representation of an alarm trigger.
2015-06-11 15:54:07 -04:00
Francis Lachapelle 99af190e29 Remove used .ttf font files 2015-06-11 15:54:07 -04:00
Francis Lachapelle 01736318d8 Expose [iCalRecurrenceRule frequencyForValue:]
This method was missing from its header file.
2015-06-11 15:49:38 -04:00
Francis Lachapelle f0108a5069 Add method [iCalByDayMask asRuleArray]
This method is used to get a JSON representation of a BYDAY attribute of
a recurrence rule.
2015-06-11 15:49:37 -04:00
iRouge f4f53ec21e Report body inline style in Sass
Create bottombar component
2015-06-11 15:49:37 -04:00
iRouge 8e76c699dd Restructure Sass files and folders for proper application Sass development 2015-06-11 15:49:37 -04:00
iRouge 256d5e1bac Restructure Sass files and folders for proper application Sass development 2015-06-11 15:49:37 -04:00
iRouge 5217c0ac64 Restructure Sass files and folders for proper application Sass development 2015-06-11 15:49:36 -04:00
Francis Lachapelle a87bbc2de5 Enable toggleCtrl in Webmail 2015-06-11 15:49:33 -04:00
Francis Lachapelle d3f0abf3ef Simplify links to modules in UIxPageFrame.wox 2015-06-11 15:49:32 -04:00
Francis Lachapelle 9b73d4e9a5 Add user identification in sgSettings constant 2015-06-11 15:49:32 -04:00
Francis Lachapelle 4f632174ce Initial integration of ngMaterial in Contacts 2015-06-11 15:49:32 -04:00
Francis Lachapelle 263ff962a1 Update .gitignore 2015-06-11 15:49:32 -04:00
Francis Lachapelle b9414a77ab Move md theming config to ui.js (SOGo.UI) 2015-06-11 15:49:31 -04:00
iRouge f180617a3f Update Angular-material 2015-06-11 15:49:31 -04:00
iRouge 5919580b5d MODULE-TYPO
- Ajustements, message-view
2015-06-11 15:49:31 -04:00
iRouge 25213605bb MODULE-TYPO
- Sass set-up
- md-list
- md-theming (install)
2015-06-11 15:49:31 -04:00
iRouge c7309d7dc8 Views tweaking and todos 2015-06-11 15:49:28 -04:00
iRouge 7e2c60e495 Should had been include with preceeding 2015-06-11 15:49:28 -04:00
iRouge a98320783f Fought with ms-layouts (and they won) 2015-06-11 15:49:27 -04:00
iRouge c196e11fde Correct Bottom-Bar Buttons url 2015-06-11 15:49:27 -04:00
iRouge 414f0fbb26 Rows adjustments 2015-06-11 15:49:27 -04:00
Francis Lachapelle 8286fb68a4 Improve JSON API documentation 2015-06-11 15:49:27 -04:00
Francis Lachapelle 64615ea6fa Update .gitignore 2015-06-11 15:49:26 -04:00
iRouge aa64e86a43 Theme css & fonts 2015-06-11 15:49:26 -04:00
Francis Lachapelle 2cd3920532 Add angular-material as a git module 2015-06-11 15:49:22 -04:00
Benoit Favreault 23bd56a854 Edit gitignore (add .idea) 2015-06-11 15:49:21 -04:00
Francis Lachapelle 307d38c13d Populate bottom navigation bar 2015-06-11 15:49:21 -04:00
Francis Lachapelle f1490e7b92 Initial integration of ngMaterial in Webmail 2015-06-11 15:49:21 -04:00
Francis Lachapelle 8148209fc8 Improve instanciation of Resource in Card model 2015-06-11 15:49:21 -04:00
Francis Lachapelle f3597616ea Minor improvements to SOGo.ContactsUI ng module 2015-06-11 15:49:20 -04:00
Francis Lachapelle 34d7a3bf52 Improve error handling in JavaScript promises 2015-06-11 15:49:20 -04:00
Francis Lachapelle 1a1d51f427 Contacts module: optimize ng-repeat directives 2015-06-11 15:49:20 -04:00
Francis Lachapelle 0d9c78c60b Contacts module: add tooltips to icon buttons 2015-06-11 15:49:20 -04:00
Francis Lachapelle 2644dc9305 Webmail: add possibility to rename a mailbox 2015-06-11 15:49:20 -04:00
Francis Lachapelle c00e09f40b JSONify [UIxMailFolderActions renameFolderAction]
This commit also introduces an initial effort to have a documentation
for the JSON-based Web API following the apiDoc format
(http://apidocjs.com/).
2015-06-11 15:49:19 -04:00
Francis Lachapelle 3526cadc96 Webmail: add "load images" button to mail viewer 2015-06-11 15:49:19 -04:00
Francis Lachapelle c514cb64bc Webmail: Add forward button to messages 2015-06-11 15:49:19 -04:00
Francis Lachapelle 225c998a97 Add CC field to mail editor 2015-06-11 15:49:18 -04:00
Francis Lachapelle 90f07c28f9 JSONify [UIxMailActions forwardAction] 2015-06-11 15:49:18 -04:00
Francis Lachapelle ad012cfd60 Save message to IMAP server before saving plist
By first appending the message to the mailbox, we obtain the IMAP ID and
save it to the local plist. Having the message ID, we can delete it when
saving/appending a new version of the draft to the mailbox.
2015-06-11 15:49:18 -04:00
Francis Lachapelle 5bbdecbec2 Webmail: add reply button 2015-06-11 15:48:15 -04:00
Francis Lachapelle 9065a8038a JSONify [UIxMailActions replyToAll:] 2015-06-11 15:48:14 -04:00
Francis Lachapelle 8c2bcc92b5 Update JavaScript dependencies
Upgrading to AngularJS 1.3.
2015-06-11 15:48:14 -04:00
Francis Lachapelle bc86ff1e04 Fix position of new or renamed addressbook 2015-06-11 15:48:14 -04:00
Francis Lachapelle 4248cbcb16 Webmail: new option to create subfolder 2015-06-11 15:48:14 -04:00
Francis Lachapelle 2d076358d3 Improve Mail module
- JSONinfied mail folder create and delete actions
- restored sgFolderTree directive
- extended folder types with "shared" and "otherUsers"
- added mailbox creation at the account level
2015-06-11 15:48:14 -04:00
Francis Lachapelle 2d026b5ca5 JSONify [UIxMailFolderActions createFolderAction] 2015-06-11 15:48:13 -04:00
Francis Lachapelle b552882011 Fix template reference when creating new card 2015-06-11 15:42:35 -04:00
Francis Lachapelle de273973b4 Add wox templates to Mail and Contacts modules 2015-06-11 15:42:35 -04:00
Francis Lachapelle 3aec2828b4 Improve JavaScript of Mail module
- activated file uploader of mail editor
- renamed method $update to $reload
- automatically mark messages as read
- use ui-sref-active from ui-router instead of ng-class
2015-06-11 15:42:34 -04:00
Francis Lachapelle 533d7110c7 Improve webmail editor
- Fixed handling of saving drafts
- Fixed handling of message type (HTML/plain)
- Added primitive handling of attachments
2015-06-11 15:42:34 -04:00
Francis Lachapelle 32196b56db Fix short formatting of cards for mail editor 2015-06-11 15:42:34 -04:00
Francis Lachapelle 5db79ce218 Mail draft: use JSON in edit action 2015-06-11 15:42:33 -04:00
Francis Lachapelle 9e97c11401 Don't store draft on disk when not required 2015-06-11 15:42:33 -04:00
Francis Lachapelle af09691964 Auto-completion of mail addresses in mail editor 2015-06-11 15:42:33 -04:00
Francis Lachapelle fe41798b19 Fix handling of recipient addresses in mail editor 2015-06-11 15:42:33 -04:00
Francis Lachapelle 09d469927f Add tags input to edit mail recipients 2015-06-11 15:42:32 -04:00
Francis Lachapelle e01e0adac8 Fix mailto links in mail viewer 2015-06-11 15:42:32 -04:00
Francis Lachapelle fb63689573 Initial mail editor 2015-06-11 15:42:32 -04:00
Francis Lachapelle 74177e4d04 Change key for envelope addresses metadata 2015-06-11 15:40:27 -04:00
Francis Lachapelle ac06a4d4ce Fix detection of mailbox type 2015-06-11 15:40:26 -04:00
Francis Lachapelle fd40cb71ac Fix premature nil in JSON dict of UIxMailView.m 2015-06-11 15:40:26 -04:00
Francis Lachapelle df019f515f Webmail: normalize format of addresses in JSON 2015-06-11 15:40:26 -04:00
Francis Lachapelle 5a106e1613 Address formatter returns metadata as a dictionary 2015-06-11 15:40:26 -04:00
Francis Lachapelle 6d899008ca Improve SOGoDraftObject to avoid crash when saving 2015-06-11 15:40:25 -04:00
Francis Lachapelle ee1f56ad27 Improve sgFolderTree directive for mobile 2015-06-11 15:40:25 -04:00
Ludovic Marcotte 61e25184fc Added Delete and Export features for mailboxes. Initial work for the mobile version. 2015-06-11 15:40:24 -04:00
Francis Lachapelle 4e9a187c85 Fix resolution of mailboxes with a special purpose 2015-06-11 15:40:24 -04:00
Francis Lachapelle 60ae5f0eb2 Improve CSS of AddressBook module 2015-06-11 15:40:24 -04:00
Francis Lachapelle 28f7811e86 Improve CSS of AddressBook module 2015-06-11 15:40:24 -04:00
Francis Lachapelle 876b21437f Fix JavaScript of login page of mobile version 2015-06-11 15:40:23 -04:00
Francis Lachapelle 1ca1a8c249 Add mobile version to webmail and improvements 2015-06-11 15:40:23 -04:00
Francis Lachapelle cdd1131699 Add sgFocus directive + factory 2015-06-11 15:40:23 -04:00
Francis Lachapelle 6ce64828e8 AngularJS module SOGo.MailerUI 2015-06-11 15:40:23 -04:00
Francis Lachapelle 1fc15061ed Webmail: Use a relative date in messages list 2015-06-11 15:40:23 -04:00
Francis Lachapelle 0ee725b945 Contacts JS models: improve documentation 2015-06-11 15:40:22 -04:00
Francis Lachapelle 2f17e94fef Initial AngularJS version of Webmail (desktop) 2015-06-11 15:40:22 -04:00
Francis Lachapelle 1c9da902d3 Add JSON payload to webmail "headers" action 2015-06-11 15:40:22 -04:00
Ludovic Marcotte 7e11806bf9 We can now show links to the address book 2015-06-11 15:40:21 -04:00
Francis Lachapelle f2efd3fb49 Add new AngularJS modules
- external module for recursion
- external module for virtual scrolling
- internal module for common UI services
2015-06-11 15:40:21 -04:00
Francis Lachapelle 54444ddf3b AngularJS SOGo.UICommon module 2015-06-11 15:40:21 -04:00
Francis Lachapelle a64a8172be Webmail: include all accounts metadata 2015-06-11 15:40:20 -04:00
Francis Lachapelle 3b4731d6b7 Add virtual scrolling AngularJS module
Integrated virtual scrolling in contacts.
2015-06-11 15:40:20 -04:00
Francis Lachapelle 2cb5aecdcb Add sgFolderTree directive 2015-06-11 15:40:20 -04:00
Francis Lachapelle 277bdd2b1c Mailer: replace HTML view by JSON object 2015-06-11 15:40:20 -04:00
Francis Lachapelle bd9da51e83 Mailer: remove HTML from list of messages in JSON 2015-06-11 15:40:20 -04:00
Francis Lachapelle e5ce053a62 Convert allFoldersMetadata to a tree structure
When parsing the mailboxes list, we now generated a hierarchical
structure of the metadata. Each mailbox (a dictionary) can now have a
'children' key that is an array of mailboxes.
2015-06-11 15:40:20 -04:00
Francis Lachapelle ec56079635 Address Book module: Fix selection of card 2015-06-11 15:38:16 -04:00
Francis Lachapelle 78a349fecd Improve CSS of addressbooks list 2015-06-11 15:38:16 -04:00
Francis Lachapelle 8c7846a1fa Propagate theme in modules relative URLs 2015-06-11 15:38:16 -04:00
Francis Lachapelle 2af7e85f81 Move SOGoContactGCSFolder->save to SOGoGCSFolder 2015-06-11 15:38:16 -04:00
Francis Lachapelle 441834edbf Mobile version: move ng template 'menu'
The 'menu.html' AngularJS template is moved to UIxPageFrame.wox to be
used by all modules.
2015-06-11 15:38:15 -04:00
Ludovic Marcotte 28f9963f87 Adjusted the minimum version of Foundation 2015-06-11 15:38:15 -04:00
Ludovic Marcotte e964496759 Revert "Added required patch for previous commit"
This reverts commit 18a363a07b.
2015-06-11 15:38:15 -04:00
Francis Lachapelle ca14a0d4b3 Improve folder subscription widget 2015-06-11 15:38:14 -04:00
Francis Lachapelle 989cb0bca2 Fix overflow of subscriptions dropdown 2015-06-11 15:38:14 -04:00
Francis Lachapelle 25b0d872c0 Add addressbook subscriptions widget 2015-06-11 15:38:14 -04:00
Francis Lachapelle 4016fdd430 New AngularJS directives
sgDropdownContentToggle, sgUserTypeahead, sgSubscribe
2015-06-11 15:38:13 -04:00
Francis Lachapelle 55f0d5a959 Add verification of parameter for "foldersSearch" 2015-06-11 15:38:13 -04:00
Francis Lachapelle 6395d7cd6a New Resource.prototype.userResource function 2015-06-11 15:38:13 -04:00
Francis Lachapelle 7812e3757d Return properties of folder upon subscribe (JSON) 2015-06-11 15:38:12 -04:00
Francis Lachapelle 93540b4fc6 Improve ACL editor template 2015-06-11 15:38:12 -04:00
Francis Lachapelle c063832d0d Move ACL editor into a separate template
The user rights remain dynamic, based on the object type (addressbook vs
mailbox vs calendar).
2015-06-11 15:38:12 -04:00
Francis Lachapelle 97ce3e6b72 Multiple improvements regarding ACLs 2015-06-11 15:38:12 -04:00
Francis Lachapelle bd39312b19 Fix compilation warnings regarding ACLs
Also change the data structure of the JSON returned by [UIxAclEditor
aclsAction]. The user's displayName has been removed and replace by the
"cn" and "c_email" attributes. This will probably affect the Thunderbird
extensions.
2015-06-11 15:38:12 -04:00
Alexandre Cloutier 22faf5c285 refactor codes and applied comments 2015-06-11 15:38:11 -04:00
Alexandre Cloutier c82143fd2e Refactor acl object and applied comments 2015-06-11 15:38:11 -04:00
Alexandre Cloutier 9b026ebbcd Contacts - export addressBook 2015-06-11 15:38:10 -04:00
Alexandre Cloutier 4e8d3ce900 add dialog window for public and allusers access 2015-06-11 15:38:10 -04:00
Alexandre Cloutier df3ad5445c Modification for ContactsUserRightsEditor 2015-06-11 15:38:10 -04:00
Alexandre Cloutier 9113ca54f7 Created user-modal.js, code refactoring
Conflicts:

	UI/Common/UIxAclEditor.m
	UI/Common/UIxUserRightsEditor.m
	UI/Common/product.plist
	UI/Contacts/UIxContactsUserRightsEditor.m
	UI/Templates/ContactsUI/UIxContactFoldersView.wox
	UI/WebServerResources/js/Common/resource.js
	UI/WebServerResources/js/ContactsUI.js
2015-06-11 15:38:10 -04:00
Alexandre Cloutier f3c26671af GUI for mobile version of AclUsers
Conflicts:

	UI/Common/UIxAclEditor.m
	UI/Common/UIxUserRightsEditor.m
	UI/WebServerResources/js/Common/acl-model.js
2015-06-11 15:38:09 -04:00
Francis Lachapelle e4b1c0d5b9 Fix buttons in card editor 2015-06-11 15:27:09 -04:00
Francis Lachapelle 3364263247 Improve handling of contact lists 2015-06-11 15:27:09 -04:00
Francis Lachapelle 61c48d37e4 Fix creation of new contacts when editing a list 2015-06-11 15:27:09 -04:00
Alexandre Cloutier 5b83b0c7b6 Enable search by fullname and email 2015-06-11 15:27:09 -04:00
Alexandre Cloutier 7e43b13f21 GUI contact list creation 2015-06-11 15:27:08 -04:00
Francis Lachapelle 57791e384b Revert "Creation of aclUsers window"
This reverts commit ee5ef02f50.
2015-06-11 15:27:08 -04:00
Francis Lachapelle 63b20c4ba2 Revert "rebase modification"
This reverts commit 45c5bbd36a.
2015-06-11 15:27:08 -04:00
Francis Lachapelle e11eea7548 Revert "file lost through rebasing"
This reverts commit a952402c39.
2015-06-11 15:27:08 -04:00
Francis Lachapelle f7df4c1fa0 Allow reverting edition of addressbook name w/ESC 2015-06-11 15:27:07 -04:00
Francis Lachapelle 4457997276 AngularJS sgEscape directive for SOGo.UIDesktop 2015-06-11 15:27:07 -04:00
Francis Lachapelle 16628ab104 Fix installation of ionic JS in Gruntfile.js 2015-06-11 15:27:07 -04:00
Alexandre Cloutier 56b765c6a5 delete unused .png 2015-06-11 15:27:06 -04:00
Alexandre Cloutier 3bf1224c9b file lost through rebasing 2015-06-11 15:27:06 -04:00
Alexandre Cloutier edbd661104 rebase modification 2015-06-11 15:27:05 -04:00
Alexandre Cloutier 8ef222ab44 Creation of aclUsers window 2015-06-11 15:27:05 -04:00
Francis Lachapelle 654c8d26b7 Contact editor: fix cancel and reset buttons 2015-06-11 15:27:05 -04:00
Francis Lachapelle 31ea7a5ab5 Improve contact module models
- Fixed reset behavior
- Created an abstract state for the card viewer and editor
- Moved the card instance from the $rootScope.addressbook to the $scope
2015-06-11 15:27:05 -04:00
Francis Lachapelle 342441ecf8 Improve JavaScript coding style
To comitted code now passes the Airbnb pattern using jscs
2015-06-11 15:27:03 -04:00
Francis Lachapelle df37fd8b92 AddressBook JS model: rename $all to $findAll 2015-06-11 15:27:03 -04:00
Francis Lachapelle 32d732caf0 Update GNUmakefile for WebServerResources 2015-06-11 15:27:02 -04:00
Francis Lachapelle 3e2173db7a Improve JavaScript coding style
To comitted code now passes the Airbnb pattern using jscs
2015-06-11 15:27:02 -04:00
Francis Lachapelle 17ee62f4de Improve usage of ui.router with "resolve" 2015-06-11 15:27:02 -04:00
Francis Lachapelle f363257e51 Use angularModule variable in mobile templates 2015-06-11 15:27:02 -04:00
Francis Lachapelle 865bf096f5 Don't add an empty category to a contact 2015-06-11 15:27:01 -04:00
Francis Lachapelle c4802df024 Remove debugging output 2015-06-11 15:27:01 -04:00
Francis Lachapelle 130194a740 Update GNUmakefile for WebServerResources 2015-06-11 15:27:01 -04:00
Francis Lachapelle 21f63c15fc Cleanup of Web server resources 2015-06-11 15:27:00 -04:00
Francis Lachapelle bb9e8c0348 Remove trailing slash from template theme name 2015-06-11 15:26:38 -04:00
Francis Lachapelle 16cd231ce3 New .button.outline CSS style 2015-06-11 15:26:37 -04:00
Francis Lachapelle 20497e49e3 Add creation & deletion of addressbooks 2015-06-11 15:26:37 -04:00
Francis Lachapelle b97bf2b25f JSON'ed [UIxParentFolderActions createFolder] 2015-06-11 15:26:37 -04:00
Francis Lachapelle 4f7a5d6ef5 Rename ng module SOGo.RootPage to SOGo.MainUI 2015-06-11 15:26:37 -04:00
Francis Lachapelle f321abc63a Desktop list editor, mobile contact editor 2015-06-11 15:26:36 -04:00
Francis Lachapelle 4b0ef6086a Cleanup contact and list viewers 2015-06-11 15:26:36 -04:00
Francis Lachapelle b57a8163fe Add link to switch to mobile version 2015-06-11 15:26:36 -04:00
Francis Lachapelle 86a6f5c67b Add Angular module assignation in page frame 2015-06-11 15:26:35 -04:00
Francis Lachapelle e40b42c213 Move setAttributes from NGVCard to UIx*Editors 2015-06-11 15:26:35 -04:00
Francis Lachapelle 2f6bc1c4ff Update .gitignore 2015-06-11 15:25:31 -04:00
Francis Lachapelle 958f0b4958 Contacts: Add possibility to add/delete objects 2015-06-11 15:25:31 -04:00
Francis Lachapelle 0c720bb902 New ng-module for common desktop widgets 2015-06-11 15:25:30 -04:00
Francis Lachapelle 34b3f2ac0c Improve build scripts of Web frontend 2015-06-11 15:25:30 -04:00
Francis Lachapelle ef4de28ed4 ContactView: lowercase the card tag 2015-06-11 15:25:30 -04:00
Francis Lachapelle c98d580b29 Return contact UID when saving contact 2015-06-11 15:25:30 -04:00
Francis Lachapelle a2460f9368 Add "newguid" action accessible from any folder 2015-06-11 15:25:29 -04:00
Francis Lachapelle c0eac04437 Adapt SOGoContactGCSFolder contact representation
To match [UIxContactViewer dataAction].
2015-06-11 15:25:29 -04:00
Francis Lachapelle 7f9be26541 Improve localization func to support placeholders 2015-06-11 15:25:28 -04:00
Francis Lachapelle c8ea3da5bc Improve detection of theme-specific JavaScript 2015-06-11 15:25:28 -04:00
Francis Lachapelle a70287870b Improve build scripts of Web frontend 2015-06-11 15:25:28 -04:00
Francis Lachapelle e4ec5313db Improve grunt tasks to copy fonts files 2015-06-11 15:25:27 -04:00
Francis Lachapelle a07d918fbf Add category to CardElement
New method to return a JSON representation of the element.
2015-06-11 15:25:27 -04:00
Francis Lachapelle 8da98367db Fix path to ionic scss files 2015-06-11 15:25:26 -04:00
Francis Lachapelle af5489bf57 Fix redirection URLs in JavaScript 2015-06-11 15:25:26 -04:00
Francis Lachapelle 54103124e8 Restore/move missing images 2015-06-11 15:25:25 -04:00
Francis Lachapelle 459c040d8a Initial mobile theme using ionic 2015-06-11 15:25:25 -04:00
Francis Lachapelle f248f81583 Improve template of Contacts module 2015-06-11 15:25:25 -04:00
Francis Lachapelle a6d8dcc5b6 Common JavaScript utlity functions 2015-06-11 15:25:25 -04:00
Francis Lachapelle b4d6667f88 Remove duplicated method 2015-06-11 15:25:24 -04:00
Francis Lachapelle 77b80e27c6 Add support for themes 2015-06-11 15:25:24 -04:00
Francis Lachapelle 16d04e998f Improve Sass of SOGoRootPage & Contacts modules 2015-06-11 15:25:24 -04:00
Francis Lachapelle d52d7582ca Improve build scripts of Web frontend 2015-06-11 15:25:23 -04:00
Francis Lachapelle e817a3b3d0 Improve JavaScript of SOGoRootPage module 2015-06-11 15:25:23 -04:00
Francis Lachapelle 2d6f8e4ea6 Improve JavaScript for Contacts module 2015-06-11 15:25:23 -04:00
Francis Lachapelle fbe412db08 Allow js/img/css subfolders in WebServerResources 2015-06-11 15:25:22 -04:00
Francis Lachapelle 24f01e72c2 JSON-based operations for root page 2015-06-11 15:25:22 -04:00
Francis Lachapelle 6970acfaa4 AngularJS-based templates 2015-06-11 15:25:22 -04:00
Francis Lachapelle 0a49031b01 JSON-based operations on contacts 2015-06-11 15:23:27 -04:00
Francis Lachapelle 29e147ee86 Initial Sass and JavaScript files 2015-06-11 15:19:22 -04:00
Francis Lachapelle c21ec86365 Icons font 2015-06-11 15:19:21 -04:00
Francis Lachapelle 825c45f872 Initial JavaScript models for addressbooks module 2015-06-11 15:19:21 -04:00
Francis Lachapelle 3ad4352ffe Initial cleanup of Web server resources 2015-06-11 15:19:21 -04:00
Alexandre Cloutier a45dc96885 applied comments 2015-06-11 15:17:26 -04:00
Alexandre Cloutier b041ec6e65 activeTasks updates dynamically 2015-06-11 15:15:39 -04:00
Alexandre Cloutier 257d731e04 multiColumns print view + bugFixes 2015-06-11 15:15:39 -04:00
Alexandre Cloutier 720a946d39 The multiColumns view 2015-06-11 15:15:39 -04:00
Pablo Carranza 2d5f2d88fa Revert "Started Ubuntu w/PostgreSQL tutorial"
This reverts commit 51d2372976.
2013-11-05 22:32:35 -06:00
Pablo Carranza eb5ca2cba6 Revert "Update ubuntu_postgresql.md"
This reverts commit 92d68de332.
2013-11-05 22:31:54 -06:00
Pablo Carranza 54cd55ebef Update README.md 2013-10-19 13:15:13 -05:00
Pablo Carranza 5f4ab6eaaf Update README.md 2013-10-19 13:11:36 -05:00
Pablo Carranza 1d8e6b6295 Update README.md 2013-10-19 13:03:40 -05:00
Pablo Carranza aa791b2571 Create README.md 2013-10-19 12:42:31 -05:00
Pablo Carranza 92d68de332 Update ubuntu_postgresql.md 2013-10-19 12:25:19 -05:00
Pablo Carranza 51d2372976 Started Ubuntu w/PostgreSQL tutorial 2013-10-19 12:17:39 -05:00
2377 changed files with 88824 additions and 140904 deletions

No files matched your search

+27 -12
View File
@@ -1,18 +1,33 @@
config.make
tags
*._*
*/obj/
*._*
*/*/obj/
*/*/*/obj/
*/*/*.SOGo/
*.css
*.pyc
*.sax
*.wox/
*.swp
*.wox/
*/*/*.SOGo/
*/*/*/obj/
*/*/obj/
*/obj/
.scss-lint-config.yml_
Documentation/*.docbook
Documentation/*.pdf
SoObjects/SOGo/SOGo.framework/
SoObjects/SOGo/derived_src/
Tests/*/config.py
*.pyc
._*
Documentation/*.docbook
Documentation/*.pdf
UI/WebServerResources/.bowerrc
UI/WebServerResources/.sass-cache/
UI/WebServerResources/bower_components/
UI/WebServerResources/css/
UI/WebServerResources/css/styles.css
UI/WebServerResources/css/styles.css.map
UI/WebServerResources/js/Common.js*
UI/WebServerResources/js/Contacts.js*
UI/WebServerResources/js/Mailer.js*
UI/WebServerResources/js/Preferences.js*
UI/WebServerResources/js/Scheduler.js*
UI/WebServerResources/js/vendor/
UI/WebServerResources/node_modules/
UI/WebServerResources/scss/.sass-cache/
config.make
doc
tags
+3
View File
@@ -0,0 +1,3 @@
[submodule "UI/WebServerResources/angular-material"]
path = UI/WebServerResources/angular-material
url = https://github.com/angular/material
-99
View File
@@ -15,28 +15,19 @@ 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.is = UI/MailerUI/Icelandic.lproj/Localizable.strings
trans.it = UI/MailerUI/Italian.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.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
[sogo.ui-preferencesui]
@@ -53,28 +44,19 @@ 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.is = UI/PreferencesUI/Icelandic.lproj/Localizable.strings
trans.it = UI/PreferencesUI/Italian.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.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]
@@ -91,28 +73,19 @@ 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.is = UI/Scheduler/Icelandic.lproj/Localizable.strings
trans.it = UI/Scheduler/Italian.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.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
[sogo.ui-contacts]
@@ -129,28 +102,19 @@ 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.is = UI/Contacts/Icelandic.lproj/Localizable.strings
trans.it = UI/Contacts/Italian.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.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
[sogo.ui-mainui]
@@ -167,28 +131,19 @@ 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.is = UI/MainUI/Icelandic.lproj/Localizable.strings
trans.it = UI/MainUI/Italian.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.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
[sogo.ui-common]
@@ -205,28 +160,19 @@ 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.is = UI/Common/Icelandic.lproj/Localizable.strings
trans.it = UI/Common/Italian.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.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
[sogo.ui-administrationui]
@@ -243,28 +189,19 @@ 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.is = UI/AdministrationUI/Icelandic.lproj/Localizable.strings
trans.it = UI/AdministrationUI/Italian.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.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
[sogo.soobjects-appointments]
@@ -281,28 +218,19 @@ 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.is = SoObjects/Appointments/Icelandic.lproj/Localizable.strings
trans.it = SoObjects/Appointments/Italian.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.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
[sogo.soobjects-contacts]
@@ -319,28 +247,19 @@ 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.is = SoObjects/Contacts/Icelandic.lproj/Localizable.strings
trans.it = SoObjects/Contacts/Italian.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.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
[sogo.soobjects-mailer]
@@ -357,28 +276,19 @@ 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.is = SoObjects/Mailer/Icelandic.lproj/Localizable.strings
trans.it = SoObjects/Mailer/Italian.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.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
[sogo.ui-mailpartviewers]
@@ -395,26 +305,17 @@ 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.is = UI/MailPartViewers/Icelandic.lproj/Localizable.strings
trans.it = UI/MailPartViewers/Italian.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.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
@@ -1,27 +0,0 @@
const tracker = {
filename: "Version",
updater: require("./Scripts/standard-version-updater.js")
}
module.exports = {
tagPrefix: "SOGo-",
issueUrlFormat: "https://www.sogo.nu/bugs/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 -4
View File
@@ -1,4 +1 @@
ifeq ($(HAS_LIBRARY_ssl),yes)
ADDITIONAL_CPPFLAGS += -DHAVE_OPENSSL=1
BUNDLE_LIBS += -lcrypto
endif
# compilation settings
+1 -1
View File
@@ -101,7 +101,7 @@ static NSArray *asElementArray = nil;
int i, count;
if (!asElementArray)
asElementArray = [[NSArray alloc] initWithObjects: @"Attendee", @"Category", @"Exception", nil];
asElementArray = [[NSArray alloc] initWithObjects: @"Attendee", @"Category", nil];
data = [NSMutableDictionary dictionary];
+53 -287
View File
@@ -46,50 +46,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "NSDate+ActiveSync.h"
#include "NSString+ActiveSync.h"
#import <NGObjWeb/WOContext+SoObjects.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
@implementation NGVCard (ActiveSync)
//
// This function is called for each elements which can be ghosted according to specs.
// https://msdn.microsoft.com/en-us/library/gg650908%28v=exchg.80%29.aspx
//
- (BOOL) _isGhosted: (NSString *) element
inContext: (WOContext *) context
{
NSArray *supportedElements;
supportedElements = [context objectForKey: @"SupportedElements"];
// If the client does not include a Supported element in the initial Sync command request for
// a folder, then all of the elements that can be ghosted are considered not ghosted.
if (!supportedElements)
return NO;
// If the client includes an empty Supported element in the initial Sync command request for
// a folder, then all elements that can be ghosted are considered ghosted.
if (![supportedElements count])
return YES;
// If the client includes a Supported element that contains child elements in the initial
// Sync command request for a folder, then each child element of that Supported element is
// considered not ghosted. All elements that can be ghosted that are not included as child
// elements of the Supported element are considered ghosted.
if (!([supportedElements indexOfObject: element] == NSNotFound))
return YES;
return NO;
}
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
NSArray *emails, *addresses, *categories, *elements;
NSMutableArray *other_addresses;
CardElement *n, *homeAdr, *workAdr, *otherAdr;
NSMutableString *s, *a;
CardElement *n, *homeAdr, *workAdr;
NSMutableString *s;
NSString *url;
id o;
@@ -100,7 +63,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ((o = [n flattenedValueAtIndex: 0 forKey: @""]))
[s appendFormat: @"<LastName xmlns=\"Contacts:\">%@</LastName>", [o activeSyncRepresentationInContext: context]];
if ((o = [n flattenedValueAtIndex: 1 forKey: @""]))
[s appendFormat: @"<FirstName xmlns=\"Contacts:\">%@</FirstName>", [o activeSyncRepresentationInContext: context]];
@@ -143,7 +106,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"<JobTitle xmlns=\"Contacts:\">%@</JobTitle>", [o activeSyncRepresentationInContext: context]];
if ((o = [self preferredEMail]))
[s appendFormat: @"<Email1Address xmlns=\"Contacts:\">%@</Email1Address>", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<Email1Address xmlns=\"Contacts:\">%@</Email1Address>", o];
// Secondary email addresses (2 and 3)
@@ -153,7 +116,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
o = [[emails objectAtIndex: i] flattenedValuesForKey: @""];
[s appendFormat: @"<Email%dAddress xmlns=\"Contacts:\">%@</Email%dAddress>", i+2, [o activeSyncRepresentationInContext: context], i+2];
[s appendFormat: @"<Email%dAddress xmlns=\"Contacts:\">%@</Email%dAddress>", i+2, o, i+2];
if (i == 1)
break;
@@ -183,22 +146,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ([addresses count])
{
homeAdr = [addresses objectAtIndex: 0];
a = [NSMutableString string];
if ((o = [homeAdr flattenedValueAtIndex: 2 forKey: @""]))
[a appendString: [o activeSyncRepresentationInContext: context]];
if ((o = [homeAdr flattenedValueAtIndex: 1 forKey: @""]) && [o length])
[a appendFormat: @"\n%@", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<HomeStreet xmlns=\"Contacts:\">%@</HomeStreet>", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<HomeStreet xmlns=\"Contacts:\">%@</HomeStreet>", a];
if ((o = [homeAdr flattenedValueAtIndex: 3 forKey: @""]))
[s appendFormat: @"<HomeCity xmlns=\"Contacts:\">%@</HomeCity>", [o activeSyncRepresentationInContext: context]];
if ((o = [homeAdr flattenedValueAtIndex: 4 forKey: @""]))
[s appendFormat: @"<HomeState xmlns=\"Contacts:\">%@</HomeState>", [o activeSyncRepresentationInContext: context]];
if ((o = [homeAdr flattenedValueAtIndex: 5 forKey: @""]))
[s appendFormat: @"<HomePostalCode xmlns=\"Contacts:\">%@</HomePostalCode>", [o activeSyncRepresentationInContext: context]];
@@ -214,15 +171,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ([addresses count])
{
workAdr = [addresses objectAtIndex: 0];
a = [NSMutableString string];
if ((o = [workAdr flattenedValueAtIndex: 2 forKey: @""]))
[a appendString: [o activeSyncRepresentationInContext: context]];
if ((o = [workAdr flattenedValueAtIndex: 1 forKey: @""]) && [o length])
[a appendFormat: @"\n%@", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<BusinessStreet xmlns=\"Contacts:\">%@</BusinessStreet>", a];
[s appendFormat: @"<BusinessStreet xmlns=\"Contacts:\">%@</BusinessStreet>", [o activeSyncRepresentationInContext: context]];
if ((o = [workAdr flattenedValueAtIndex: 3 forKey: @""]))
[s appendFormat: @"<BusinessCity xmlns=\"Contacts:\">%@</BusinessCity>", [o activeSyncRepresentationInContext: context]];
@@ -237,48 +188,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"<BusinessCountry xmlns=\"Contacts:\">%@</BusinessCountry>", [o activeSyncRepresentationInContext: context]];
}
// Other Address
other_addresses = [[self childrenWithTag: @"adr"] mutableCopy];
[other_addresses removeObjectsInArray: [self childrenWithTag: @"adr" andAttribute: @"type" havingValue: @"work"]];
[other_addresses removeObjectsInArray: [self childrenWithTag: @"adr" andAttribute: @"type" havingValue: @"home"]];
if ([other_addresses count])
{
otherAdr = [other_addresses objectAtIndex: 0];
a = [NSMutableString string];
if ((o = [otherAdr flattenedValueAtIndex: 2 forKey: @""]))
[a appendString: [o activeSyncRepresentationInContext: context]];
if ((o = [otherAdr flattenedValueAtIndex: 1 forKey: @""]) && [o length])
[a appendFormat: @"\n%@", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<OtherStreet xmlns=\"Contacts:\">%@</OtherStreet>", a];
if ((o = [otherAdr flattenedValueAtIndex: 3 forKey: @""]))
[s appendFormat: @"<OtherCity xmlns=\"Contacts:\">%@</OtherCity>", [o activeSyncRepresentationInContext: context]];
if ((o = [otherAdr flattenedValueAtIndex: 4 forKey: @""]))
[s appendFormat: @"<OtherState xmlns=\"Contacts:\">%@</OtherState>", [o activeSyncRepresentationInContext: context]];
if ((o = [otherAdr flattenedValueAtIndex: 5 forKey: @""]))
[s appendFormat: @"<OtherPostalCode xmlns=\"Contacts:\">%@</OtherPostalCode>", [o activeSyncRepresentationInContext: context]];
if ((o = [otherAdr flattenedValueAtIndex: 6 forKey: @""]))
[s appendFormat: @"<OtherCountry xmlns=\"Contacts:\">%@</OtherCountry>", [o activeSyncRepresentationInContext: context]];
}
// Other, less important fields
if ((o = [self birthday]))
{
[s appendFormat: @"<Birthday xmlns=\"Contacts:\">%@</Birthday>",
[[o dateByAddingYears: 0 months: 0 days: 0
hours: -12 minutes: 0
seconds: 0]
activeSyncRepresentationInContext: context]];
}
[s appendFormat: @"<Birthday xmlns=\"Contacts:\">%@</Birthday>", [o activeSyncRepresentationInContext: context]];
if ((o = [self note]))
{
@@ -305,7 +217,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
inContext: (WOContext *) context
{
CardElement *element;
NSMutableArray *addressLines, *other_addresses;
id o;
// Contact's note
@@ -315,8 +226,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Categories
if ((o = [theValues objectForKey: @"Categories"]) && [o length])
[self setCategories: o];
else
[[self children] removeObjectsInArray: [self childrenWithTag: @"Categories"]];
// Birthday
if ((o = [theValues objectForKey: @"Birthday"]))
@@ -324,11 +233,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
o = [o calendarDate];
[self setBday: [o descriptionWithCalendarFormat: @"%Y-%m-%d" timeZone: nil locale: nil]];
}
else if (![self _isGhosted: @"Birthday" inContext: context])
{
[self setBday: @""];
}
//
// Business address information
@@ -340,48 +244,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// BusinessCountry
//
element = [self elementWithTag: @"adr" ofType: @"work"];
if ((o = [theValues objectForKey: @"BusinessStreet"]) || ![self _isGhosted: @"BusinessStreet" inContext: context])
{
addressLines = [NSMutableArray arrayWithArray: [o componentsSeparatedByString: @"\n"]];
[element setSingleValue: @""
atIndex: 1 forKey: @""];
[element setSingleValue: [addressLines count] ? [addressLines objectAtIndex: 0] : @""
atIndex: 2 forKey: @""];
// Extended address line. If there are more than 2 address lines we add them to the extended address line.
if ([addressLines count] > 1)
{
[addressLines removeObjectAtIndex: 0];
[element setSingleValue: [addressLines componentsJoinedByString: @" "]
atIndex: 1 forKey: @""];
}
}
if ((o = [theValues objectForKey: @"BusinessCity"]) || ![self _isGhosted: @"BusinessCity" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"BusinessCity"]
atIndex: 3 forKey: @""];
}
if ((o = [theValues objectForKey: @"BusinessState"]) || ![self _isGhosted: @"BusinessState" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"BusinessState"]
atIndex: 4 forKey: @""];
}
if ((o = [theValues objectForKey: @"BusinessPostalCode"]) || ![self _isGhosted: @"BusinessPostalCode" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"BusinessPostalCode"]
atIndex: 5 forKey: @""];
}
if ((o = [theValues objectForKey: @"BusinessCountry"]) || ![self _isGhosted: @"BusinessCountry" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"BusinessCountry"]
atIndex: 6 forKey: @""];
}
[element setSingleValue: @""
atIndex: 1 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"BusinessStreet"]
atIndex: 2 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"BusinessCity"]
atIndex: 3 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"BusinessState"]
atIndex: 4 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"BusinessPostalCode"]
atIndex: 5 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"BusinessCountry"]
atIndex: 6 forKey: @""];
//
// Home address information
@@ -393,126 +267,35 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// HomeCountry
//
element = [self elementWithTag: @"adr" ofType: @"home"];
if ((o = [theValues objectForKey: @"HomeStreet"]) || ![self _isGhosted: @"HomeStreet" inContext: context])
{
addressLines = [NSMutableArray arrayWithArray: [o componentsSeparatedByString: @"\n"]];
[element setSingleValue: @""
atIndex: 1 forKey: @""];
[element setSingleValue: [addressLines count] ? [addressLines objectAtIndex: 0] : @""
atIndex: 2 forKey: @""];
// Extended address line. If there are more then 2 address lines we add them to the extended address line.
if ([addressLines count] > 1)
{
[addressLines removeObjectAtIndex: 0];
[element setSingleValue: [addressLines componentsJoinedByString: @" "]
atIndex: 1 forKey: @""];
}
}
if ((o = [theValues objectForKey: @"HomeCity"]) || ![self _isGhosted: @"HomeCity" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"HomeCity"]
atIndex: 3 forKey: @""];
}
if ((o = [theValues objectForKey: @"HomeState"]) || ![self _isGhosted: @"HomeState" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"HomeState"]
atIndex: 4 forKey: @""];
}
if ((o = [theValues objectForKey: @"HomePostalCode"]) || ![self _isGhosted: @"HomePostalCode" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"HomePostalCode"]
atIndex: 5 forKey: @""];
}
if ((o = [theValues objectForKey: @"HomeCountry"]) || ![self _isGhosted: @"HomeCountry" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"HomeCountry"]
atIndex: 6 forKey: @""];
}
// OtherCountry
//
other_addresses = [[self childrenWithTag: @"adr"] mutableCopy];
[other_addresses removeObjectsInArray: [self childrenWithTag: @"adr" andAttribute: @"type" havingValue: @"work"]];
[other_addresses removeObjectsInArray: [self childrenWithTag: @"adr" andAttribute: @"type" havingValue: @"home"]];
if ([other_addresses count])
element = [other_addresses objectAtIndex: 0];
else
{
element = [CardElement elementWithTag: @"adr"];
[self addChild: element];
}
if ((o = [theValues objectForKey: @"OtherStreet"]) || ![self _isGhosted: @"OtherStreet" inContext: context])
{
addressLines = [NSMutableArray arrayWithArray: [o componentsSeparatedByString: @"\n"]];
[element setSingleValue: @""
atIndex: 1 forKey: @""];
[element setSingleValue: [addressLines count] ? [addressLines objectAtIndex: 0] : @""
atIndex: 2 forKey: @""];
// Extended address line. If there are more then 2 address lines we add them to the extended address line.
if ([addressLines count] > 1)
{
[addressLines removeObjectAtIndex: 0];
[element setSingleValue: [addressLines componentsJoinedByString: @" "]
atIndex: 1 forKey: @""];
}
}
if ((o = [theValues objectForKey: @"OtherCity"]) || ![self _isGhosted: @"OtherCity" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"OtherCity"]
atIndex: 3 forKey: @""];
}
if ((o = [theValues objectForKey: @"OtherState"]) || ![self _isGhosted: @"OtherState" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"OtherState"]
atIndex: 4 forKey: @""];
}
if ((o = [theValues objectForKey: @"OtherPostalCode"]) || ![self _isGhosted: @"OtherPostalCode" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"OtherPostalCode"]
atIndex: 5 forKey: @""];
}
if ((o = [theValues objectForKey: @"OtherCountry"]) || ![self _isGhosted: @"OtherCountry" inContext: context])
{
[element setSingleValue: [theValues objectForKey: @"OtherCountry"]
atIndex: 6 forKey: @""];
}
[element setSingleValue: @""
atIndex: 1 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"HomeStreet"]
atIndex: 2 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"HomeCity"]
atIndex: 3 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"HomeState"]
atIndex: 4 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"HomePostalCode"]
atIndex: 5 forKey: @""];
[element setSingleValue: [theValues objectForKey: @"HomeCountry"]
atIndex: 6 forKey: @""];
// Company's name
if ((o = [theValues objectForKey: @"CompanyName"]))
[self setOrg: o units: nil];
else if (![self _isGhosted: @"CompanyName" inContext: context])
[self setOrg: @"" units: nil];
// Department
if ((o = [theValues objectForKey: @"Department"]))
[self setOrg: nil units: [NSArray arrayWithObjects:o,nil]];
else if (![self _isGhosted: @"Department" inContext: context])
[self setOrg: nil units: [NSArray arrayWithObjects:@"",nil]];
// Email addresses
if ((o = [theValues objectForKey: @"Email1Address"]) || ![self _isGhosted: @"Email1Address" inContext: context])
if ((o = [theValues objectForKey: @"Email1Address"]))
{
element = [self elementWithTag: @"email" ofType: @"work"];
[element setSingleValue: [o pureEMailAddress] forKey: @""];
}
if ((o = [theValues objectForKey: @"Email2Address"]) || ![self _isGhosted: @"Email2Address" inContext: context])
if ((o = [theValues objectForKey: @"Email2Address"]))
{
element = [self elementWithTag: @"email" ofType: @"home"];
[element setSingleValue: [o pureEMailAddress] forKey: @""];
@@ -520,7 +303,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// SOGo currently only supports 2 email addresses ... but AS clients might send 3
// FIXME: revise this when the GUI revamp is done in SOGo
if ((o = [theValues objectForKey: @"Email3Address"]) || ![self _isGhosted: @"Email3Address" inContext: context])
if ((o = [theValues objectForKey: @"Email3Address"]))
{
element = [self elementWithTag: @"email" ofType: @"three"];
[element setSingleValue: [o pureEMailAddress] forKey: @""];
@@ -530,62 +313,45 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// MiddleName
// Suffix (II)
// Title (Mr.)
if ((o = [theValues objectForKey: @"FileAs"]) || ![self _isGhosted: @"FileAs" inContext: context])
[self setFn: [theValues objectForKey: @"FileAs"]];
[self setFn: [theValues objectForKey: @"FileAs"]];
[self setNWithFamily: [theValues objectForKey: @"LastName"]
given: [theValues objectForKey: @"FirstName"]
additional: nil prefixes: nil suffixes: nil];
// IM information
if ((o = [theValues objectForKey: @"IMAddress"]) || ![self _isGhosted: @"IMAddress" inContext: context])
[[self uniqueChildWithTag: @"x-aim"]
setSingleValue: [theValues objectForKey: @"IMAddress"]
forKey: @""];
[[self uniqueChildWithTag: @"x-aim"]
setSingleValue: [theValues objectForKey: @"IMAddress"]
forKey: @""];
//
// Phone numbrrs
//
if ((o = [theValues objectForKey: @"BusinessPhoneNumber"]) || ![self _isGhosted: @"BusinessPhoneNumber" inContext: context])
{
element = [self elementWithTag: @"tel" ofType: @"work"];
[element setSingleValue: [theValues objectForKey: @"BusinessPhoneNumber"] forKey: @""];
}
element = [self elementWithTag: @"tel" ofType: @"work"];
[element setSingleValue: [theValues objectForKey: @"BusinessPhoneNumber"] forKey: @""];
if ((o = [theValues objectForKey: @"HomePhoneNumber"]) || ![self _isGhosted: @"HomePhoneNumber" inContext: context])
{
element = [self elementWithTag: @"tel" ofType: @"home"];
[element setSingleValue: [theValues objectForKey: @"HomePhoneNumber"] forKey: @""];
}
element = [self elementWithTag: @"tel" ofType: @"home"];
[element setSingleValue: [theValues objectForKey: @"HomePhoneNumber"] forKey: @""];
if ((o = [theValues objectForKey: @"MobilePhoneNumber"]) || ![self _isGhosted: @"MobilePhoneNumber" inContext: context])
{
element = [self elementWithTag: @"tel" ofType: @"cell"];
[element setSingleValue: [theValues objectForKey: @"MobilePhoneNumber"] forKey: @""];
}
element = [self elementWithTag: @"tel" ofType: @"cell"];
[element setSingleValue: [theValues objectForKey: @"MobilePhoneNumber"] forKey: @""];
if ((o = [theValues objectForKey: @"BusinessFaxNumber"]) || ![self _isGhosted: @"BusinessFaxNumber" inContext: context])
{
element = [self elementWithTag: @"tel" ofType: @"fax"];
[element setSingleValue: [theValues objectForKey: @"BusinessFaxNumber"] forKey: @""];
}
element = [self elementWithTag: @"tel" ofType: @"fax"];
[element setSingleValue: [theValues objectForKey: @"BusinessFaxNumber"] forKey: @""];
if ((o = [theValues objectForKey: @"PagerNumber"]) || ![self _isGhosted: @"PagerNumber" inContext: context])
{
element = [self elementWithTag: @"tel" ofType: @"pager"];
[element setSingleValue: [theValues objectForKey: @"PagerNumber"] forKey: @""];
}
element = [self elementWithTag: @"tel" ofType: @"pager"];
[element setSingleValue: [theValues objectForKey: @"PagerNumber"] forKey: @""];
// Job's title
if ((o = [theValues objectForKey: @"JobTitle"]) || ![self _isGhosted: @"JobTitle" inContext: context])
if ((o = [theValues objectForKey: @"JobTitle"]))
[self setTitle: o];
// WebPage (work)
if ((o = [theValues objectForKey: @"WebPage"]) || ![self _isGhosted: @"WebPage" inContext: context])
if ((o = [theValues objectForKey: @"WebPage"]))
[[self elementWithTag: @"url" ofType: @"work"]
setSingleValue: o forKey: @""];
if ((o = [theValues objectForKey: @"NickName"]) || ![self _isGhosted: @"NickName" inContext: context])
if ((o = [theValues objectForKey: @"NickName"]))
[self setNickname: o];
if ((o = [theValues objectForKey: @"Picture"]))
-1
View File
@@ -53,7 +53,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (NSString *) itemid;
- (BOOL) acceptsMultiPart;
- (NSData *) convertHexStringToBytes;
- (NSString *) protocolVersion;
@end
+94 -31
View File
@@ -46,6 +46,99 @@ static NSArray *easCommandParameters = nil;
@implementation NSString (ActiveSync)
//
// This is a copy from NSString+XMLEscaping.m from SOPE.
// The difference here is that we use wchar_t instead of unichar.
// This is needed to get the rigth numeric character reference.
// e.g. SMILING FACE WITH OPEN MOUTH
// ok: wchar_t -> &#128515; wrong: unichar -> &#55357; &#56835;
//
// We avoir naming it like the one in SOPE since if the ActiveSync
// bundle is loaded, it'll overwrite the one provided by SOPE.
//
- (NSString *) _stringByEscapingXMLStringUsingCharacters {
register unsigned i, len, j;
register wchar_t *buf;
const wchar_t *chars;
unsigned escapeCount;
if ([self length] == 0) return @"";
NSData *data = [self dataUsingEncoding:NSUTF32StringEncoding];
chars = [data bytes];
len = [data length]/4;
/* check for characters to escape ... */
for (i = 0, escapeCount = 0; i < len; i++) {
switch (chars[i]) {
case '&': case '"': case '<': case '>': case '\r':
escapeCount++;
break;
default:
if (chars[i] > 127)
escapeCount++;
break;
}
}
if (escapeCount == 0 ) {
/* nothing to escape ... */
return [[self copy] autorelease];
}
buf = calloc((len + 5) + (escapeCount * 16), sizeof(wchar_t));
for (i = 0, j = 0; i < len; i++) {
switch (chars[i]) {
/* escape special chars */
case '\r':
buf[j] = '&'; j++; buf[j] = '#'; j++; buf[j] = '1'; j++;
buf[j] = '3'; j++; buf[j] = ';'; j++;
break;
case '&':
buf[j] = '&'; j++; buf[j] = 'a'; j++; buf[j] = 'm'; j++;
buf[j] = 'p'; j++; buf[j] = ';'; j++;
break;
case '"':
buf[j] = '&'; j++; buf[j] = 'q'; j++; buf[j] = 'u'; j++;
buf[j] = 'o'; j++; buf[j] = 't'; j++; buf[j] = ';'; j++;
break;
case '<':
buf[j] = '&'; j++; buf[j] = 'l'; j++; buf[j] = 't'; j++;
buf[j] = ';'; j++;
break;
case '>':
buf[j] = '&'; j++; buf[j] = 'g'; j++; buf[j] = 't'; j++;
buf[j] = ';'; j++;
break;
default:
/* escape big chars */
if (chars[i] > 127) {
unsigned char nbuf[32];
unsigned int k;
sprintf((char *)nbuf, "&#%i;", (int)chars[i]);
for (k = 0; nbuf[k] != '\0'; k++) {
buf[j] = nbuf[k];
j++;
}
}
else if (chars[i] == 0x9 || chars[i] == 0xA || chars[i] == 0xD || chars[i] >= 0x20) { // ignore any unsupported control character
/* nothing to escape */
buf[j] = chars[i];
j++;
}
break;
}
}
self = [[NSString alloc] initWithBytesNoCopy: buf
length: (j*sizeof(wchar_t))
encoding: NSUTF32StringEncoding
freeWhenDone: YES];
return [self autorelease];
}
- (NSString *) sanitizedServerIdWithType: (SOGoMicrosoftActiveSyncFolderType) folderType
{
if (folderType == ActiveSyncEventFolder)
@@ -65,7 +158,7 @@ static NSArray *easCommandParameters = nil;
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
return [self safeStringByEscapingXMLString: YES];
return [self _stringByEscapingXMLStringUsingCharacters];
}
- (int) activeSyncFolderType
@@ -138,31 +231,6 @@ static NSArray *easCommandParameters = nil;
return o;
}
- (NSString *) protocolVersion
{
NSMutableArray *components;
components = [NSMutableArray arrayWithArray: [[[self componentsSeparatedByString: @"?"] lastObject] componentsSeparatedByString: @"&"]];
// We handle BASE64 encoded queryStrings. See http://msdn.microsoft.com/en-us/library/ee160227%28v=exchg.80%29.aspx for details.
if ([components count] == 1)
{
NSData *queryString;
const char* qs_bytes;
queryString = [[components objectAtIndex: 0] dataByDecodingBase64];
if (![queryString length])
return nil;
qs_bytes = (const char*)[queryString bytes];
return [NSString stringWithFormat:@"%.1f", (float)((uint8_t)qs_bytes[0]/10)];
}
return nil;
}
- (NSString *) _valueForParameter: (NSString *) theParameter
{
NSMutableArray *components;
@@ -203,11 +271,6 @@ static NSArray *easCommandParameters = nil;
// Command code, 1 byte, ie.: cmd=
cmd_code = qs_bytes[1];
// Check whether the command code is within the known range.
if (cmd_code < 0 || cmd_code > 22)
return nil;
[components addObject: [NSString stringWithFormat: @"cmd=%@", [easCommandCodes objectAtIndex: cmd_code]]];
// Device ID length and Device ID (variable)
File diff suppressed because it is too large. Load diff
+1 -13
View File
@@ -1,6 +1,6 @@
/*
Copyright (c) 2014-2015, Inverse inc.
Copyright (c) 2014, Inverse inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -31,26 +31,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SOGoActiveSyncConstants.h"
@class NSCalendarDate;
@class NSException;
@class NSMutableDictionary;
@class NSURL;
@class NSNumber;
static volatile BOOL easShouldTerminate = NO;
@interface SOGoActiveSyncDispatcher : NSObject
{
NSURL *folderTableURL;
NSDictionary *imapFolderGUIDS;
id context;
NSNumber *syncRequest;
BOOL debugOn;
}
- (NSMutableDictionary *) globalMetadataForDevice;
- (id) collectionFromId: (NSString *) theCollectionId
type: (SOGoMicrosoftActiveSyncFolderType) theFolderType;
@@ -63,6 +52,5 @@ static volatile BOOL easShouldTerminate = NO;
- (NSURL *) folderTableURL;
- (void) ensureFolderTableExists;
- (BOOL) easShouldTerminate;
@end
File diff suppressed because it is too large. Load diff
-2
View File
@@ -42,8 +42,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context;
- (void) takeActiveSyncValues: (NSDictionary *) theValues
inContext: (WOContext *) context;
- (NSString *) storeMail: (NSDictionary *) theValues
inContext: (WOContext *) _context;
@end
+44 -377
View File
@@ -34,8 +34,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSString.h>
#import <Foundation/NSCharacterSet.h>
#import <Foundation/NSTimeZone.h>
#import <NGCards/iCalCalendar.h>
#import <NGCards/iCalDateTime.h>
@@ -47,12 +45,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <NGExtensions/NGQuotedPrintableCoding.h>
#import <NGExtensions/NSString+misc.h>
#import <NGExtensions/NSString+Encoding.h>
#import <NGExtensions/NGHashMap.h>
#import <NGImap4/NGImap4Envelope.h>
#import <NGImap4/NGImap4EnvelopeAddress.h>
#import <NGImap4/NSString+Imap4.h>
#import <NGImap4/NGImap4Connection.h>
#import <NGImap4/NGImap4Client.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WOApplication.h>
@@ -67,7 +62,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Mailer/SOGoMailLabel.h>
#import <SOGo/SOGoUserDefaults.h>
#import <SOGo/SOGoUserFolder.h>
#include "iCalTimeZone+ActiveSync.h"
#include "NSData+ActiveSync.h"
@@ -78,12 +72,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <Appointments/iCalPerson+SOGo.h>
#include <Mailer/NSString+Mail.h>
#include <Mailer/SOGoMailBodyPart.h>
#import <Mailer/SOGoMailLabel.h>
#import <Mailer/SOGoMailFolder.h>
#import <Mailer/SOGoMailObject.h>
#import <Mailer/SOGoMailAccount.h>
#import <Mailer/SOGoMailAccounts.h>
#include <SOGo/SOGoUser.h>
#include <SOGo/NSString+Utilities.h>
@@ -174,7 +162,7 @@ struct GlobalObjectId {
const char *bytes;
uid = [event uid];
uidAsASCII = [uid dataUsingEncoding: NSASCIIStringEncoding];
uidAsASCII = [uid decodeFromHexidecimal];
newGlobalId = (struct GlobalObjectId*)calloc(sizeof(uint8_t), sizeof(struct GlobalObjectId) + 0x0c + [uidAsASCII length]);
prefix = @"040000008200e00074c5b7101a82e008";
@@ -484,131 +472,18 @@ struct GlobalObjectId {
return d;
}
//
//
//
- (BOOL) _sanitinizeNeeded: (NSArray *) theParts
{
NSString *encoding, *charset;
int i;
for (i = 0; i < [theParts count]; i++)
{
encoding = [[theParts objectAtIndex: i ] objectForKey: @"encoding"];
charset = [[[theParts objectAtIndex: i ] objectForKey: @"parameterList"] objectForKey: @"charset"];
if (encoding && ([encoding caseInsensitiveCompare: @"7bit"] == NSOrderedSame || [encoding caseInsensitiveCompare: @"8bit"] == NSOrderedSame) &&
charset && ![charset caseInsensitiveCompare: @"utf-8"] == NSOrderedSame
&& ![charset caseInsensitiveCompare: @"us-ascii"] == NSOrderedSame)
{
return YES;
}
if ([self _sanitinizeNeeded: [[theParts objectAtIndex: i ] objectForKey: @"parts"]])
return YES;
}
return NO;
}
- (BOOL) _isSigned: (NSDictionary *) thePart
{
NSMutableDictionary *currentPart;
NSArray *subparts;
NSString *type, *subtype;
NSUInteger i;
type = [[thePart objectForKey: @"type"] lowercaseString];
subtype = [[thePart objectForKey: @"subtype"] lowercaseString];
if ([type isEqualToString: @"multipart"])
{
if ([subtype isEqualToString: @"signed"])
return YES;
subparts = [thePart objectForKey: @"parts"];
for (i = 0; i < [subparts count]; i++)
{
currentPart = [subparts objectAtIndex: i];
if ([self _isSigned: currentPart])
return YES;
}
}
return NO;
}
- (BOOL) _isSmimeEncrypted: (NSDictionary *) thePart
{
NSMutableDictionary *currentPart;
NSArray *subparts;
NSString *type, *subtype;
NSUInteger i;
type = [[thePart objectForKey: @"type"] lowercaseString];
subtype = [[thePart objectForKey: @"subtype"] lowercaseString];
if ([type isEqualToString: @"multipart"])
{
subparts = [thePart objectForKey: @"parts"];
for (i = 0; i < [subparts count]; i++)
{
currentPart = [subparts objectAtIndex: i];
if ([self _isSmimeEncrypted: currentPart])
return YES;
}
}
else if ([type isEqualToString: @"application"] && ([subtype isEqualToString: @"pkcs7-mime"] ||
[subtype isEqualToString: @"x-pkcs7-mime"]))
return YES;
return NO;
}
- (BOOL) _isPGP: (NSDictionary *) thePart
{
NSMutableDictionary *currentPart;
NSArray *subparts;
NSString *type, *subtype, *protocol;
NSUInteger i;
type = [[thePart objectForKey: @"type"] lowercaseString];
subtype = [[thePart objectForKey: @"subtype"] lowercaseString];
protocol = [[[thePart objectForKey: @"parameterList"] objectForKey: @"protocol"] lowercaseString];
if ([type isEqualToString: @"multipart"])
{
if (([protocol isEqualToString: @"application/pgp-signature"] || [protocol isEqualToString: @"application/pgp-encrypted"]))
return YES;
subparts = [thePart objectForKey: @"parts"];
for (i = 0; i < [subparts count]; i++)
{
currentPart = [subparts objectAtIndex: i];
if ([self _isPGP: currentPart])
return YES;
}
}
else if ([type isEqualToString: @"application"] && [subtype isEqualToString: @"pgp-encrypted"])
return YES;
return NO;
}
//
//
//
- (NSData *) _preferredBodyDataUsingType: (int) theType
mimeSupport: (int) theMimeSupport
nativeType: (int *) theNativeType
{
NSString *type, *subtype, *encoding;
NSData *d;
BOOL isSMIME, sanitinizeNeeded;
type = [[[self bodyStructure] valueForKey: @"type"] lowercaseString];
subtype = [[[self bodyStructure] valueForKey: @"subtype"] lowercaseString];
isSMIME = NO;
d = nil;
// We determine the native type
@@ -619,16 +494,8 @@ struct GlobalObjectId {
else if ([type isEqualToString: @"multipart"])
*theNativeType = 4;
if (([self _isSigned: [self bodyStructure]] ||
[self _isSmimeEncrypted: [self bodyStructure]] ||
[self _isPGP: [self bodyStructure]]) && theMimeSupport > 0)
{
*theNativeType = 4;
isSMIME = YES;
}
// We get the right part based on the preference
if ((theType == 1 || theType == 2) && !isSMIME)
if (theType == 1 || theType == 2)
{
if ([type isEqualToString: @"text"] && ![subtype isEqualToString: @"calendar"])
{
@@ -669,12 +536,12 @@ struct GlobalObjectId {
d = [self _preferredBodyDataInMultipartUsingType: theType nativeTypeFound: theNativeType];
}
}
else if (theType == 4 || isSMIME)
else if (theType == 4)
{
// We sanitize the content if the content-transfer-encoding is 8bit and charset is not utf-8 or us-ascii.
sanitinizeNeeded = [self _sanitinizeNeeded: [NSArray arrayWithObject: [self bodyStructure]]];
if (sanitinizeNeeded && !isSMIME)
// We sanitize the content *ONLY* for Outlook clients and if the content-transfer-encoding is 8bit. Outlook has strange issues
// with quoted-printable/base64 encoded text parts. It just doesn't decode them.
encoding = [[self lookupInfoForBodyPart: @""] objectForKey: @"encoding"];
if ([[context objectForKey: @"DeviceType"] isEqualToString: @"WindowsOutlook15"] || ([encoding caseInsensitiveCompare: @"8bit"] == NSOrderedSame))
d = [self _sanitizedMIMEMessage];
else
d = [self content];
@@ -705,35 +572,6 @@ struct GlobalObjectId {
}
- (NSString *) _truncateContent: (NSString *) theContent
limit: (int) theLimit
truncated: (int *) wasTruncated
{
if ([theContent length] > theLimit)
{
int i, len;
theContent = [theContent substringToIndex: theLimit];
*wasTruncated = 1;
// We search for the first "space" character starting from the
// end and we truncate the string once more. We do this to avoid
// truncating the content in the middle of a XML entity
len = theLimit-1;
for (i = len; i >= 0; i--)
{
if (isspace([theContent characterAtIndex: i]))
break;
}
return [theContent substringToIndex: i];
}
*wasTruncated = 0;
return theContent;
}
//
//
//
@@ -793,7 +631,7 @@ struct GlobalObjectId {
iCalCalendar *calendar;
NSData *calendarData;
calendarData = [bodyPart fetchBLOBWithPeek: YES];
calendarData = [bodyPart fetchBLOB];
calendar = nil;
NS_DURING
@@ -818,17 +656,16 @@ struct GlobalObjectId {
{
NSData *d, *globalObjId;
NSArray *attachmentKeys;
iCalCalendar *calendar;
NSString *p;
NSMutableString *s;
id value;
int preferredBodyType, mimeSupport, mimeTruncation, nativeBodyType;
uint32_t v;
preferredBodyType = [[context objectForKey: @"BodyPreferenceType"] intValue];
mimeSupport = [[context objectForKey: @"MIMESupport"] intValue];
mimeTruncation = [[context objectForKey: @"MIMETruncation"] intValue];
uint32_t v;
NSString *p;
id value;
iCalCalendar *calendar;
int preferredBodyType, nativeBodyType;
s = [NSMutableString string];
@@ -945,7 +782,7 @@ struct GlobalObjectId {
else if ([method isEqualToString: @"COUNTER"])
className = @"IPM.Schedule.Meeting.Resp.Tent";
else if ([method isEqualToString: @"CANCEL"])
className = @"IPM.Schedule.Meeting.Canceled";
className = @"IPM.Schedule.Meeting.Cancelled";
else
className = @"IPM.Appointment";
@@ -973,12 +810,7 @@ struct GlobalObjectId {
// Location
if ([[event location] length])
{
if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 16.0)
[s appendFormat: @"<Location xmlns=\"AirSyncBase:\"><DisplayName>%@</DisplayName></Location>", [[event location] activeSyncRepresentationInContext: context]];
else
[s appendFormat: @"<Location xmlns=\"Email:\">%@</Location>", [[event location] activeSyncRepresentationInContext: context]];
}
[s appendFormat: @"<Location xmlns=\"Email:\">%@</Location>", [[event location] activeSyncRepresentationInContext: context]];
[s appendFormat: @"<Organizer xmlns=\"Email:\">%@</Organizer>", [[[event organizer] mailAddress] activeSyncRepresentationInContext: context]];
@@ -1019,7 +851,7 @@ struct GlobalObjectId {
[s appendFormat: @"<GlobalObjId xmlns=\"Email:\">%@</GlobalObjId>", [globalObjId activeSyncRepresentationInContext: context]];
// We set the right message type - we must set AS version to 14.1 for this
if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.1)
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.1"])
[s appendFormat: @"<MeetingMessageType xmlns=\"Email2:\">%d</MeetingMessageType>", 1];
[s appendString: @"</MeetingRequest>"];
@@ -1030,13 +862,7 @@ struct GlobalObjectId {
else
{
// MesssageClass and ContentClass
if ([self _isSigned: [self bodyStructure]])
[s appendFormat: @"<MessageClass xmlns=\"Email:\">%@</MessageClass>", @"IPM.Note.SMIME.MultipartSigned"];
else if ([self _isSmimeEncrypted: [self bodyStructure]])
[s appendFormat: @"<MessageClass xmlns=\"Email:\">%@</MessageClass>", @"IPM.Note.SMIME"];
else
[s appendFormat: @"<MessageClass xmlns=\"Email:\">%@</MessageClass>", @"IPM.Note"];
[s appendFormat: @"<MessageClass xmlns=\"Email:\">%@</MessageClass>", @"IPM.Note"];
[s appendFormat: @"<ContentClass xmlns=\"Email:\">%@</ContentClass>", @"urn:content-classes:message"];
}
@@ -1050,8 +876,10 @@ struct GlobalObjectId {
[s appendFormat: @"<InternetCPID xmlns=\"Email:\">%@</InternetCPID>", @"65001"];
// Body - namespace 17
preferredBodyType = [[context objectForKey: @"BodyPreferenceType"] intValue];
nativeBodyType = 1;
d = [self _preferredBodyDataUsingType: preferredBodyType mimeSupport: mimeSupport nativeType: &nativeBodyType];
d = [self _preferredBodyDataUsingType: preferredBodyType nativeType: &nativeBodyType];
if (calendar && !d)
{
@@ -1140,87 +968,44 @@ struct GlobalObjectId {
AUTORELEASE(content);
content = [content activeSyncRepresentationInContext: context];
len = [content length];
truncated = 0;
// We handle MIMETruncation
switch (mimeTruncation)
{
case 0:
{
content = @"";
len = 0; truncated = 1;
}
break;
case 1:
content = [self _truncateContent: content limit: 4096 truncated: &truncated];
len = [content length];
break;
case 2:
content = [self _truncateContent: content limit: 5120 truncated: &truncated];
len = [content length];
break;
case 3:
content = [self _truncateContent: content limit: 7168 truncated: &truncated];
len = [content length];
break;
case 4:
content = [self _truncateContent: content limit: 10240 truncated: &truncated];
len = [content length];
break;
case 5:
content = [self _truncateContent: content limit: 20480 truncated: &truncated];
len = [content length];
break;
case 6:
content = [self _truncateContent: content limit: 51200 truncated: &truncated];
len = [content length];
break;
case 7:
content = [self _truncateContent: content limit: 102400 truncated: &truncated];
len = [content length];
break;
case 8:
default:
truncated = 0;
}
len = [content length];
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<Body xmlns=\"Email:\">%@</Body>", content];
[s appendFormat: @"<BodyTruncated xmlns=\"Email:\">%d</BodyTruncated>", truncated];
}
else
{
{
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
// Set the correct type if client requested text/html but we got text/plain.
// For s/mime mails type is always 4 if mimeSupport is 1 or 2.
// Set the correct type if client requested text/html but we got text/plain
if (preferredBodyType == 2 && nativeBodyType == 1)
[s appendString: @"<Type>1</Type>"];
else if (([self _isSigned: [self bodyStructure]] ||
[self _isSmimeEncrypted: [self bodyStructure]] ||
[self _isPGP: [self bodyStructure]]) && mimeSupport > 0)
[s appendString: @"<Type>4</Type>"];
else
[s appendFormat: @"<Type>%d</Type>", preferredBodyType];
[s appendFormat: @"<Truncated>%d</Truncated>", truncated];
[s appendFormat: @"<Preview></Preview>"];
[s appendFormat: @"<Data>%@</Data>", content];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", len];
if (!truncated)
{
[s appendFormat: @"<Data>%@</Data>", content];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", len];
}
[s appendString: @"</Body>"];
}
}
// Attachments -namespace 16
attachmentKeys = [self fetchFileAttachmentKeys];
if ([attachmentKeys count] && !([self _isSigned: [self bodyStructure]]))
if ([attachmentKeys count])
{
int i;
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
[s appendString: @"<Attachments xmlns=\"Email:\">"];
else
[s appendString: @"<Attachments xmlns=\"AirSyncBase:\">"];
@@ -1235,24 +1020,18 @@ struct GlobalObjectId {
// FileReference must be a unique identifier across the whole store. We use the following structure:
// mail/<foldername>/<message UID/<pathofpart>
// mail/INBOX/2
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
[s appendFormat: @"<AttName>mail/%@/%@/%@</AttName>", [[[self container] relativeImap4Name] stringByEscapingURL], [self nameInContainer], [value objectForKey: @"path"]];
else
[s appendFormat: @"<FileReference>mail/%@/%@/%@</FileReference>", [[[self container] relativeImap4Name] stringByEscapingURL], [self nameInContainer], [value objectForKey: @"path"]];
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<AttMethod>%d</AttMethod>", 1];
[s appendFormat: @"<AttSize>%d</AttSize>", [[value objectForKey: @"size"] intValue]];
}
else
{
if ([[value objectForKey: @"bodyId"] length])
{
[s appendFormat: @"<ContentId>%@</ContentId>", [[value objectForKey: @"bodyId"] activeSyncRepresentationInContext: context]];
[s appendFormat: @"<IsInline>%d</IsInline>", 1];
}
[s appendFormat: @"<Method>%d</Method>", 1]; // See: http://msdn.microsoft.com/en-us/library/ee160322(v=exchg.80).aspx
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", [[value objectForKey: @"size"] intValue]];
//[s appendFormat: @"<IsInline>%d</IsInline>", 1];
@@ -1289,31 +1068,19 @@ struct GlobalObjectId {
[s appendFormat: @"</Categories>"];
}
if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 14.0)
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.0"] ||
[[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.1"])
{
id value;
NSString *reference;
value = [[self mailHeaders] objectForKey: @"references"];
if ([value isKindOfClass: [NSArray class]])
reference = [[[value objectAtIndex: 0] componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] objectAtIndex: 0];
else
reference = [[value componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] objectAtIndex: 0];
reference = [[[[self mailHeaders] objectForKey: @"references"] componentsSeparatedByString: @" "] objectAtIndex: 0];
if ([reference length] > 0)
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[reference dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
else if ([[self inReplyTo] length] > 0)
else if ([self inReplyTo])
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[[self inReplyTo] dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
else if ([[self messageId] length] > 0)
else if ([self messageId])
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[[self messageId] dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
if ([self replied])
[s appendFormat: @"<LastVerbExecuted xmlns=\"Email2:\">%d</LastVerbExecuted>", 1];
else if ([self forwarded])
[s appendFormat: @"<LastVerbExecuted xmlns=\"Email2:\">%d</LastVerbExecuted>", 3];
else
[s appendFormat: @"<LastVerbExecuted xmlns=\"Email2:\">%d</LastVerbExecuted>", 0];
}
// FIXME - support these in the future
@@ -1438,104 +1205,4 @@ struct GlobalObjectId {
}
}
- (NSString *) storeMail: (NSDictionary *) theValues
inContext: (WOContext *) _context
{
NSString *dateReceived, *folder, *s;
NGMimeMessageGenerator *generator;
NGMimeMessage *bounceMessage;
NSDictionary *identity;
NGMutableHashMap *map;
NGImap4Client *client;
NSData *message_data;
id o, result;
int bodyType;
identity = [[context activeUser] primaryIdentity];
message_data = nil;
bodyType = 1;
if ((o = [[theValues objectForKey: @"Body"] objectForKey: @"Type"]))
bodyType = [o intValue];
if (bodyType == 4)
{
s = [[theValues objectForKey: @"Body"] objectForKey: @"Data"];
message_data = [s dataUsingEncoding: NSUTF8StringEncoding];
}
if (bodyType == 1 || bodyType == 2)
{
map = [[[NGMutableHashMap alloc] initWithCapacity: 1] autorelease];
[map setObject: [NSString stringWithFormat: @"%@ <%@>", [identity objectForKey: @"fullName"], [identity objectForKey: @"email"]] forKey: @"from"];
if ((o = [theValues objectForKey: @"To"]))
[map setObject: o forKey: @"to"];
if ((o = [theValues objectForKey: @"Subject"]))
[map setObject: o forKey: @"subject"];
o = [[theValues objectForKey: @"DateReceived"] calendarDate];
if (!o)
o = [NSCalendarDate date];
#if GNUSTEP_BASE_MINOR_VERSION < 21
dateReceived = [o descriptionWithCalendarFormat: @"%a, %d %b %Y %H:%M:%S %z"
timeZone: [NSTimeZone timeZoneWithName: @"GMT"]
locale: nil];
#else
dateReceived = [o descriptionWithCalendarFormat: @"%a, %d %b %Y %H:%M:%S %z"
timeZone: [NSTimeZone timeZoneWithName: @"GMT"]
locale: [NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObjects: @"Jan", @"Feb", @"Mar", @"Apr",
@"May", @"Jun", @"Jul", @"Aug",
@"Sep", @"Oct", @"Nov", @"Dec", nil],
@"NSShortMonthNameArray",
[NSArray arrayWithObjects: @"Sun", @"Mon", @"Tue", @"Wed", @"Thu",
@"Fri", @"Sat", nil],
@"NSShortWeekDayNameArray",
nil]];
#endif
[map setObject: dateReceived forKey: @"date"];
[map setObject: [NSString generateMessageID] forKey: @"message-id"];
[map setObject: (bodyType == 1 ? @"text/plain; charset=utf-8" : @"text/html; charset=utf-8")
forKey: @"content-type"];
[map setObject: @"quoted-printable" forKey: @"content-transfer-encoding"];
bounceMessage = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
[bounceMessage setBody: [[NSString stringWithFormat: @"%@", [[theValues objectForKey: @"Body"] objectForKey: @"Data"] ] dataUsingEncoding: NSUTF8StringEncoding]];
generator = [[[NGMimeMessageGenerator alloc] init] autorelease];
message_data = [generator generateMimeFromPart: bounceMessage];
}
if (message_data)
{
client = [[self imap4Connection] client];
if (![imap4 doesMailboxExistAtURL: [container imap4URL]])
{
[[self imap4Connection] createMailbox: [[self imap4Connection] imap4FolderNameForURL: [container imap4URL]]
atURL: [[self mailAccountFolder] imap4URL]];
[imap4 flushFolderHierarchyCache];
}
folder = [imap4 imap4FolderNameForURL: [container imap4URL]];
result = [client append: message_data
toFolder: folder
withFlags: [NSArray arrayWithObjects: @"draft", nil]];
if ([[result objectForKey: @"result"] boolValue])
return [NSString stringWithFormat: @"%d", [self IMAP4IDFromAppendResult: result]];
}
return nil;
}
@end
-1
View File
@@ -37,7 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@interface SOGoSyncCacheObject : NSObject
{
@public
id _uid;
id _sequence;
}
+13 -22
View File
@@ -32,17 +32,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/NSNull.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
static Class NSNullK;
@implementation SOGoSyncCacheObject
+ (void) initialize
{
NSNullK = [NSNull class];
}
- (id) init
{
if ((self = [super init]))
@@ -54,14 +46,14 @@ static Class NSNullK;
return self;
}
+ (id) syncCacheObjectWithUID: (id) theUID sequence: (id) theSequence
+ (id) syncCacheObjectWithUID: (id) theUID sequence: (id) theSequence;
{
id o;
o = [[self alloc] init];
[o setUID: [NSNumber numberWithInt: [theUID intValue]]];
[o setSequence: ([theSequence isKindOfClass: NSNullK] ? theSequence : [NSNumber numberWithInt: [theSequence intValue]])];
[o setUID: theUID];
[o setSequence: theSequence];
return [o autorelease];
}
@@ -75,7 +67,7 @@ static Class NSNullK;
- (id) uid
{
return [_uid description];
return _uid;
}
- (void) setUID: (id) theUID
@@ -85,7 +77,7 @@ static Class NSNullK;
- (id) sequence
{
return ([_sequence isKindOfClass: NSNullK] ? _sequence : [_sequence description]);
return _sequence;
}
- (void) setSequence: (id) theSequence
@@ -96,7 +88,7 @@ static Class NSNullK;
- (NSComparisonResult) compareUID: (SOGoSyncCacheObject *) theSyncCacheObject
{
return [self->_uid compare: theSyncCacheObject->_uid];
return [[self uid] compare: [theSyncCacheObject uid]];
}
//
@@ -105,21 +97,21 @@ static Class NSNullK;
//
- (NSComparisonResult) compareSequence: (SOGoSyncCacheObject *) theSyncCacheObject
{
if ([self->_sequence isEqual: [NSNull null]] &&
[theSyncCacheObject->_sequence isEqual: [NSNull null]])
if ([[self sequence] isEqual: [NSNull null]] &&
[[theSyncCacheObject sequence] isEqual: [NSNull null]])
return [self compareUID: theSyncCacheObject];
if (![self->_sequence isEqual: [NSNull null]] && [theSyncCacheObject->_sequence isEqual: [NSNull null]])
if (![[self sequence] isEqual: [NSNull null]] && [[theSyncCacheObject sequence] isEqual: [NSNull null]])
return NSOrderedDescending;
if ([self->_sequence isEqual: [NSNull null]] && ![theSyncCacheObject->_sequence isEqual: [NSNull null]])
if ([[self sequence] isEqual: [NSNull null]] && ![[theSyncCacheObject sequence] isEqual: [NSNull null]])
return NSOrderedAscending;
// Must check this here, to avoid comparing NSNull objects
if ([self->_sequence compare: theSyncCacheObject->_sequence] == NSOrderedSame)
if ([[self sequence] compare: [theSyncCacheObject sequence]] == NSOrderedSame)
return [self compareUID: theSyncCacheObject];
return [self->_sequence compare: theSyncCacheObject->_sequence];
return [[self sequence] compare: [theSyncCacheObject sequence]];
}
- (NSString *) description
@@ -128,4 +120,3 @@ static Class NSNullK;
}
@end
+28 -48
View File
@@ -39,9 +39,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <NGCards/iCalAlarm.h>
#import <NGCards/iCalEvent.h>
#import <NGCards/iCalTrigger.h>
#import <NGCards/NSCalendarDate+NGCards.h>
#include "NSDate+ActiveSync.h"
@implementation iCalAlarm (ActiveSync)
@@ -59,16 +56,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
nextAlarmDate = [self nextAlarmDate];
delta = (int)(([[(iCalEvent *)parent startDate] timeIntervalSince1970] - [nextAlarmDate timeIntervalSince1970])/60);
if ([parent isKindOfClass: [iCalEvent class]])
{
// don't send negative reminder - not supported
if (delta > 0)
[s appendFormat: @"<Reminder xmlns=\"Calendar:\">%d</Reminder>", (int)delta];
}
else
{
[s appendFormat: @"<ReminderTime xmlns=\"Task:\">%@</ReminderTime>", [nextAlarmDate activeSyncRepresentationInContext: context]];
}
// don't send negative reminder - not supported
if (delta > 0)
[s appendFormat: @"<Reminder xmlns=\"Calendar:\">%d</Reminder>", delta];
}
return s;
@@ -80,47 +70,37 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
iCalTrigger *trigger;
id o;
if ((o = [theValues objectForKey: @"Reminder"]))
o = [theValues objectForKey: @"Reminder"];
// Outlook: if reminder is set to 0 minutes before start save it as 1 minute since -> 0 minutes in not accepted by SOGo
if ([o isEqualToString: @"0"])
o = @"1";
trigger = [iCalTrigger elementWithTag: @"TRIGGER"];
[trigger setValueType: @"DURATION"];
[self setTrigger: trigger];
[self setAction: @"DISPLAY"];
// SOGo web ui only supports 1w but not 2w (custom reminder only supports min/hours/days)
// 1week = -P1W
// 2weeks > -PxD
// xdays > -PxD
// xhours -> -PTxH
// xmin -> -PTxM
if ([o intValue] == 10080)
[trigger setSingleValue: [NSString stringWithFormat: @"-P1W" ] forKey: @""];
else
{
// Outlook: if reminder is set to 0 minutes before starttime, save it as 1 minute since -> 0 minutes in not accepted by SOGo
if ([o isEqualToString: @"0"])
o = @"1";
trigger = [iCalTrigger elementWithTag: @"TRIGGER"];
[trigger setValueType: @"DURATION"];
[self setTrigger: trigger];
[self setAction: @"DISPLAY"];
// SOGo web ui only supports 1w but not 2w (custom reminder only supports min/hours/days)
// 1week = -P1W
// 2weeks > -PxD
// xdays > -PxD
// xhours -> -PTxH
// xmin -> -PTxM
if ([o intValue] == 10080)
[trigger setSingleValue: [NSString stringWithFormat: @"-P1W" ] forKey: @""];
if (([o intValue] % 1440) == 0)
[trigger setSingleValue: [NSString stringWithFormat: @"-P%dD", ([o intValue] / 1440)] forKey: @""];
else
{
if (([o intValue] % 1440) == 0)
[trigger setSingleValue: [NSString stringWithFormat: @"-P%dD", ([o intValue] / 1440)] forKey: @""];
if (([o intValue] % 60) == 0)
[trigger setSingleValue: [NSString stringWithFormat: @"-PT%dH", ([o intValue] / 60)] forKey: @""];
else
{
if (([o intValue] % 60) == 0)
[trigger setSingleValue: [NSString stringWithFormat: @"-PT%dH", ([o intValue] / 60)] forKey: @""];
else
[trigger setSingleValue: [NSString stringWithFormat: @"-PT%@M", o] forKey: @""];
}
[trigger setSingleValue: [NSString stringWithFormat: @"-PT%@M", o] forKey: @""];
}
}
else if ((o = [theValues objectForKey: @"ReminderTime"]))
{
o = [o calendarDate];
trigger = [iCalTrigger elementWithTag: @"TRIGGER"];
[trigger setValueType: @"DATE-TIME"];
[trigger setSingleValue: [NSString stringWithFormat: @"%@Z", [o iCalFormattedDateTimeString]] forKey: @""];
[self setTrigger: trigger];
[self setAction: @"DISPLAY"];
}
}
@end
+1 -3
View File
@@ -41,9 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context;
- (void) takeActiveSyncValues: (NSDictionary *) theValues
inContext: (WOContext *) context;
- (void) changeParticipationStatus: (NSDictionary *) theValues
inContext: (WOContext *) context
component: (id) component;
@end
#endif
+57 -401
View File
@@ -38,8 +38,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/NSTimeZone.h>
#import <NGExtensions/NSString+misc.h>
#import <NGExtensions/NSCalendarDate+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGObjWeb/WORequest.h>
@@ -47,17 +45,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <NGCards/iCalCalendar.h>
#import <NGCards/iCalDateTime.h>
#import <NGCards/iCalPerson.h>
#import <NGCards/NSCalendarDate+NGCards.h>
#import <NGCards/NSString+NGCards.h>
#import <NGCards/iCalCalendar.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import <SOGo/WORequest+SOGo.h>
#import <Appointments/iCalEntityObject+SOGo.h>
#import <Appointments/iCalRepeatableEntityObject+SOGo.h>
#import <Appointments/SOGoAppointmentObject.h>
#include "iCalAlarm+ActiveSync.h"
#include "iCalRecurrenceRule+ActiveSync.h"
@@ -70,7 +62,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (int) _attendeeStatus: (iCalPerson *) attendee
{
int attendee_status;
attendee_status = 5;
if ([[attendee partStat] caseInsensitiveCompare: @"ACCEPTED"] == NSOrderedSame)
attendee_status = 3;
@@ -82,29 +74,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
return attendee_status;
}
//
// Possible values are:
// 0 Free
// 1 Tentative
// 2 Busy
// 3 Out of Office
// 4 Working elsewhere
//
- (int) _busyStatus: (iCalPerson *) attendee
{
int attendee_status;
attendee_status = 2;
if ([[attendee partStat] caseInsensitiveCompare: @"DECLINED"] == NSOrderedSame)
attendee_status = 0;
else if ([[attendee partStat] caseInsensitiveCompare: @"TENTATIVE"] == NSOrderedSame)
attendee_status = 1;
return attendee_status;
}
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
NSMutableString *s;
@@ -129,13 +98,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
else if ([self created])
[s appendFormat: @"<DTStamp xmlns=\"Calendar:\">%@</DTStamp>", [[self created] activeSyncRepresentationWithoutSeparatorsInContext: context]];
// Timezone
tz = [(iCalDateTime *)[self firstChildWithTag: @"dtstart"] timeZone];
// StartTime -- http://msdn.microsoft.com/en-us/library/ee157132(v=exchg.80).aspx
if ([self startDate])
{
if ([self isAllDay] && !tz)
if ([self isAllDay])
[s appendFormat: @"<StartTime xmlns=\"Calendar:\">%@</StartTime>",
[[[self startDate] dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
@@ -148,7 +114,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// EndTime -- http://msdn.microsoft.com/en-us/library/ee157945(v=exchg.80).aspx
if ([self endDate])
{
if ([self isAllDay] && !tz)
if ([self isAllDay])
[s appendFormat: @"<EndTime xmlns=\"Calendar:\">%@</EndTime>",
[[[self endDate] dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
@@ -158,24 +124,26 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"<EndTime xmlns=\"Calendar:\">%@</EndTime>", [[self endDate] activeSyncRepresentationWithoutSeparatorsInContext: context]];
}
// Timezone
tz = [(iCalDateTime *)[self firstChildWithTag: @"dtstart"] timeZone];
if (!tz)
tz = [iCalTimeZone timeZoneForName: [userTimeZone name]];
if (![self recurrenceId])
[s appendFormat: @"<TimeZone xmlns=\"Calendar:\">%@</TimeZone>", [tz activeSyncRepresentationInContext: context]];
[s appendFormat: @"<TimeZone xmlns=\"Calendar:\">%@</TimeZone>", [tz activeSyncRepresentationInContext: context]];
// Organizer and other invitations related properties
if ((organizer = [self organizer]))
{
meetingStatus = 1; // meeting and the user is the meeting organizer.
o = [organizer rfc822Email];
if (![self recurrenceId] && [o length])
if ([o length])
{
[s appendFormat: @"<Organizer_Email xmlns=\"Calendar:\">%@</Organizer_Email>", o];
o = [organizer cn];
if ([o length])
[s appendFormat: @"<Organizer_Name xmlns=\"Calendar:\">%@</Organizer_Name>", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<Organizer_Name xmlns=\"Calendar:\">%@</Organizer_Name>", o];
}
}
@@ -213,7 +181,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
else
{
meetingStatus = 0; // The event is an appointment, which has no attendees.
meetingStatus = 0; // appointment
}
// This depends on the 'NEEDS-ACTION' parameter.
@@ -234,13 +202,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"<DisallowNewTimeProposal xmlns=\"Calendar:\">%d</DisallowNewTimeProposal>", 1];
// BusyStatus -- http://msdn.microsoft.com/en-us/library/ee202290(v=exchg.80).aspx
[s appendFormat: @"<BusyStatus xmlns=\"Calendar:\">%d</BusyStatus>", [self _busyStatus: attendee]];
}
else
{
// If it's a normal event (i.e. with no organizer/attendee) or we are the organizer of an event
// invitation, we set the busy status depending on TRANSP.
[s appendFormat: @"<BusyStatus xmlns=\"Calendar:\">%d</BusyStatus>", (([self isOpaque]) ? 2 : 0)];
[s appendFormat: @"<BusyStatus xmlns=\"Calendar:\">%d</BusyStatus>", 2];
}
[s appendFormat: @"<MeetingStatus xmlns=\"Calendar:\">%d</MeetingStatus>", meetingStatus];
@@ -251,12 +213,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Location
if ([[self location] length])
{
if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 16.0)
[s appendFormat: @"<Location xmlns=\"AirSyncBase:\"><DisplayName>%@</DisplayName></Location>", [[self location] activeSyncRepresentationInContext: context]];
else
[s appendFormat: @"<Location xmlns=\"Calendar:\">%@</Location>", [[self location] activeSyncRepresentationInContext: context]];
}
[s appendFormat: @"<Location xmlns=\"Calendar:\">%@</Location>", [[self location] activeSyncRepresentationInContext: context]];
// Importance - NOT SUPPORTED - DO NOT ENABLE
//o = [self priority];
@@ -269,37 +226,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//[s appendFormat: @"<Importance xmlns=\"Calendar:\">%d</Importance>", v];
// UID -- http://msdn.microsoft.com/en-us/library/ee159919(v=exchg.80).aspx
if (![self recurrenceId] && [[self uid] length])
[s appendFormat: @"<UID xmlns=\"Calendar:\">%@</UID>", [[self uid] activeSyncRepresentationInContext: context]];
// Recurrence rules
if ([self isRecurrent])
[s appendString: [[[self recurrenceRules] lastObject] activeSyncRepresentationInContext: context]];
// Comment
o = [self comment];
//if (![self recurrenceId] && [o length])
if ([o length])
{
// It is very important here to NOT set <Truncated>0</Truncated> in the response,
// otherwise it'll prevent WP8 phones from sync'ing. See #3028 for details.
o = [o activeSyncRepresentationInContext: context];
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<Body xmlns=\"Calendar:\">%@</Body>", o];
[s appendString: @"<BodyTruncated xmlns=\"Calendar:\">0</BodyTruncated>"];
}
else
{
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
[s appendFormat: @"<Type>%d</Type>", 1];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", (int)[o length]];
[s appendFormat: @"<Data>%@</Data>", o];
[s appendString: @"</Body>"];
}
}
if ([[self uid] length])
[s appendFormat: @"<UID xmlns=\"Calendar:\">%@</UID>", [self uid]];
// Sensitivity
if ([[self accessClass] isEqualToString: @"PRIVATE"])
v = 2;
@@ -322,6 +251,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"</Categories>"];
}
// Reminder -- http://msdn.microsoft.com/en-us/library/ee219691(v=exchg.80).aspx
// TODO: improve this to handle more alarm types
if ([self hasAlarms])
@@ -332,79 +262,36 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendString: [alarm activeSyncRepresentationInContext: context]];
}
// Exceptions
// Recurrence rules
if ([self isRecurrent])
{
NSMutableArray *components, *exdates;
iCalEvent *current_component;
NSString *recurrence_id;
unsigned int count, max, i;
components = [NSMutableArray arrayWithArray: [[self parent] events]];
max = [components count];
if (max > 1 || [self hasExceptionDates])
{
exdates = [NSMutableArray arrayWithArray: [self exceptionDates]];
[s appendString: @"<Exceptions xmlns=\"Calendar:\">"];
for (count = 1; count < max; count++)
{
current_component = [components objectAtIndex: count] ;
if ([self isAllDay])
{
recurrence_id = [NSString stringWithFormat: @"%@",
[[[current_component recurrenceId] dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: -[userTimeZone secondsFromGMTForDate:
[current_component recurrenceId]]]
activeSyncRepresentationWithoutSeparatorsInContext: context]];
}
else
{
recurrence_id = [NSString stringWithFormat: @"%@", [[current_component recurrenceId]
activeSyncRepresentationWithoutSeparatorsInContext: context]];
}
[s appendString: @"<Exception>"];
[s appendFormat: @"<Exception_StartTime xmlns=\"Calendar:\">%@</Exception_StartTime>", recurrence_id];
[s appendFormat: @"%@", [current_component activeSyncRepresentationInContext: context]];
[s appendString: @"</Exception>"];
}
for (i = 0; i < [exdates count]; i++)
{
[s appendString: @"<Exception>"];
[s appendString: @"<Exception_Deleted>1</Exception_Deleted>"];
if ([self isAllDay])
{
recurrence_id = [NSString stringWithFormat: @"%@",
[[[[exdates objectAtIndex: i] asCalendarDate] dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: -[userTimeZone secondsFromGMTForDate:
[[exdates objectAtIndex: i] asCalendarDate]]]
activeSyncRepresentationWithoutSeparatorsInContext: context]];
}
else
{
recurrence_id = [NSString stringWithFormat: @"%@", [[[exdates objectAtIndex: i] asCalendarDate]
activeSyncRepresentationWithoutSeparatorsInContext: context]];
}
[s appendFormat: @"<Exception_StartTime xmlns=\"Calendar:\">%@</Exception_StartTime>", recurrence_id];
[s appendString: @"</Exception>"];
}
[s appendString: @"</Exceptions>"];
}
[s appendString: [[[self recurrenceRules] lastObject] activeSyncRepresentationInContext: context]];
}
if (![self recurrenceId])
[s appendFormat: @"<NativeBodyType xmlns=\"AirSyncBase:\">%d</NativeBodyType>", 1];
// Comment
o = [self comment];
if ([o length])
{
// It is very important here to NOT set <Truncated>0</Truncated> in the response,
// otherwise it'll prevent WP8 phones from sync'ing. See #3028 for details.
o = [o activeSyncRepresentationInContext: context];
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<Body xmlns=\"Calendar:\">%@</Body>", o];
[s appendString: @"<BodyTruncated xmlns=\"Calendar:\">0</BodyTruncated>"];
}
else
{
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
[s appendFormat: @"<Type>%d</Type>", 1];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", [o length]];
[s appendFormat: @"<Data>%@</Data>", o];
[s appendString: @"</Body>"];
}
}
[s appendFormat: @"<NativeBodyType xmlns=\"AirSyncBase:\">%d</NativeBodyType>", 1];
return s;
}
@@ -450,20 +337,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (void) takeActiveSyncValues: (NSDictionary *) theValues
inContext: (WOContext *) context
{
iCalDateTime *start, *end; //, *oldstart;
NSCalendarDate *oldstart;
iCalDateTime *start, *end;
NSTimeZone *userTimeZone;
iCalTimeZone *tz;
id o;
int deltasecs;
BOOL isAllDay;
NSMutableArray *occurences;
occurences = [NSMutableArray arrayWithArray: [[self parent] events]];
if ((o = [theValues objectForKey: ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 16.0) ? @"ClientUid" : @"UID"]))
if ((o = [theValues objectForKey: @"UID"]))
[self setUid: o];
// FIXME: merge with iCalToDo
@@ -475,21 +356,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
isAllDay = YES;
}
else if ([occurences count] && !([theValues objectForKey: @"AllDayEvent"]))
{
// If the occurence has no AllDay tag use it from master.
isAllDay = [[occurences objectAtIndex: 0] isAllDay];
}
//
// 0- free, 1- tentative, 2- busy and 3- out of office
//
if ((o = [theValues objectForKey: @"BusyStatus"]))
{
if ([o boolValue])
[self setTransparency: @"OPAQUE"];
else
[self setTransparency: @"TRANSPARENT"];
[o intValue];
}
//
@@ -531,7 +404,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
// FIXME: merge with iCalToDo
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
{
if ((o = [theValues objectForKey: @"Body"]))
[self setComment: o];
@@ -542,23 +415,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[self setComment: o];
}
if ([[context objectForKey: @"ASProtocolVersion"] floatValue] < 16.0 && (o = [theValues objectForKey: @"Location"]))
if ((o = [theValues objectForKey: @"Location"]))
[self setLocation: o];
else if ([[context objectForKey: @"ASProtocolVersion"] floatValue] >= 16.0 && (o = [theValues objectForKey: @"Location"]) && [o isKindOfClass: [NSDictionary class]])
[self setLocation: [o objectForKey: @"DisplayName"]];
deltasecs = 0;
start = nil;
if ((o = [theValues objectForKey: @"StartTime"]))
{
o = [o calendarDate];
start = (iCalDateTime *) [self uniqueChildWithTag: @"dtstart"];
oldstart = [start dateTime];
[start setTimeZone: tz];
if (isAllDay)
{
if (isAllDay)
{
[start setDate: o];
[start setTimeZone: nil];
}
@@ -566,10 +433,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
[start setDateTime: o];
}
// Calculate delta if start date has been changed.
if (oldstart)
deltasecs = [[start dateTime ] timeIntervalSinceDate: oldstart] * -1;
}
if ((o = [theValues objectForKey: @"EndTime"]))
@@ -596,7 +459,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
// Ignore the alarm for now
}
else if ((o = [theValues objectForKey: @"Reminder"]) && [o length])
else if ((o = [theValues objectForKey: @"Reminder"]))
{
// NOTE: Outlook sends a 15 min reminder (18 hour for allday) if no reminder is specified
// although no default reminder is defined (File -> Options -> Clendar -> Calendar Options - > Default Reminders)
@@ -619,7 +482,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
// Recurrence
if ((o = [theValues objectForKey: @"Recurrence"]) && [o isKindOfClass: [NSDictionary class]])
if ((o = [theValues objectForKey: @"Recurrence"]))
{
iCalRecurrenceRule *rule;
@@ -628,177 +491,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
RELEASE(rule);
[rule takeActiveSyncValues: o inContext: context];
// Exceptions
if ((o = [theValues objectForKey: @"Exceptions"]) && [o isKindOfClass: [NSArray class]])
{
NSCalendarDate *recurrenceId, *adjustedRecurrenceId, *currentId;
NSMutableArray *exdates, *exceptionstouched;
iCalEvent *currentOccurence;
NSDictionary *exception;
unsigned int i, count, max;
[self removeAllExceptionDates];
exdates = [NSMutableArray array];
exceptionstouched = [NSMutableArray array];
for (i = 0; i < [o count]; i++)
{
exception = [o objectAtIndex: i];
if (![[exception objectForKey: @"Exception_Deleted"] intValue])
{
recurrenceId = [[exception objectForKey: @"Exception_StartTime"] asCalendarDate];
if (isAllDay)
recurrenceId = [recurrenceId dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0
seconds: [userTimeZone secondsFromGMTForDate:recurrenceId]];
// When moving the calendar entry (i.e. changing the startDate) iOS and Android sometimes send a value for
// Exception_StartTime which is not what we expect.
// With this we make sure the recurrenceId is always correct.
//
// iOS problem - If the master is a no-allday-event but the exception is, an invalid Exception_StartTime is in the request.
// e.g. it sends 20150409T040000Z instead of 20150409T060000Z;
// This might be a special case since iPhone doesn't allow an allday-exception on a non-allday-event.
if (!([[start dateTime] compare: [[start dateTime] hour:[recurrenceId hourOfDay] minute:[recurrenceId minuteOfHour]]] == NSOrderedSame))
recurrenceId = [recurrenceId hour:[[start dateTime] hourOfDay] minute:[[start dateTime] minuteOfHour]];
// We need to store the recurrenceIds and exception dates adjusted by deltasecs.
// This ensures that the adjustment in SOGoCalendarComponent->updateComponent->_updateRecurrenceIDsWithEvent gives the correct dates.
adjustedRecurrenceId = [recurrenceId dateByAddingYears: 0 months: 0 days: 0
hours: 0 minutes: 0 seconds: deltasecs];
// search for an existing occurence and update it
max = [occurences count];
currentOccurence = nil;
count = 1;
while (count < max)
{
currentOccurence = [occurences objectAtIndex: count] ;
currentId = [currentOccurence recurrenceId];
if ([currentId compare: adjustedRecurrenceId] == NSOrderedSame)
{
[exceptionstouched addObject: adjustedRecurrenceId];
[currentOccurence takeActiveSyncValues: exception inContext: context];
break;
}
count++;
currentOccurence = nil;
}
// Create a new occurence if we found none to update.
if (!currentOccurence)
{
iCalDateTime *recid;
currentOccurence = [self mutableCopy];
[currentOccurence removeAllRecurrenceRules];
[currentOccurence removeAllExceptionRules];
[currentOccurence removeAllExceptionDates];
[[self parent] addToEvents: currentOccurence];
[currentOccurence takeActiveSyncValues: exception inContext: context];
recid = (iCalDateTime *)[currentOccurence uniqueChildWithTag: @"recurrence-id"];
if (isAllDay)
[recid setDate: adjustedRecurrenceId];
else
[recid setDateTime: adjustedRecurrenceId];
[exceptionstouched addObject: [recid dateTime]];
}
}
else if ([[exception objectForKey: @"Exception_Deleted"] intValue])
{
recurrenceId = [[exception objectForKey: @"Exception_StartTime"] asCalendarDate];
if (isAllDay)
recurrenceId = [recurrenceId dateByAddingYears: 0 months: 0
days: 0 hours: 0 minutes: 0
seconds: [userTimeZone secondsFromGMTForDate:recurrenceId]];
// We add only valid exception dates.
if ([self doesOccurOnDate: recurrenceId] &&
([[start dateTime] compare: [[start dateTime] hour:[recurrenceId hourOfDay]
minute:[recurrenceId minuteOfHour]]] == NSOrderedSame))
{
// We need to store the recurrenceIds and exception dates adjusted by deltasecs.
// This ensures that the adjustment in SOGoCalendarComponent->updateComponent->_updateRecurrenceIDsWithEvent gives the correct dates.
[exdates addObject: [recurrenceId dateByAddingYears: 0 months: 0 days: 0 hours: 0 minutes: 0 seconds: deltasecs]];
}
}
}
// Update exception dates in master event.
max = [exdates count];
if (max > 0)
{
for (count = 0; count < max; count++)
{
if (([exceptionstouched indexOfObject: [exdates objectAtIndex: count]] == NSNotFound))
[self addToExceptionDates: [exdates objectAtIndex: count]];
}
}
// Remove all exceptions included in the request.
max = [occurences count];
count = 1; // skip the master event
while (count < max)
{
currentOccurence = [occurences objectAtIndex: count] ;
currentId = [currentOccurence recurrenceId];
// Delete all occurences which are not touched (modified/added).
if (([exceptionstouched indexOfObject: currentId] == NSNotFound))
[[[self parent] children] removeObject: currentOccurence];
count++;
}
}
else if ([self isRecurrent])
{
// We have no exceptions in request but there is a recurrence rule.
// Remove all excpetions and exception dates.
iCalEvent *currentOccurence;
unsigned int count, max;
[self removeAllExceptionDates];
max = [occurences count];
count = 1; // skip the master event
while (count < max)
{
currentOccurence = [occurences objectAtIndex: count];
[[[self parent] children] removeObject: currentOccurence];
count++;
}
}
}
else if ([self isRecurrent])
{
// We have no recurrence rule in request.
// Remove all exceptions, exception dates and recurrence rules.
iCalEvent *currentOccurence;
unsigned int count, max;
[self removeAllRecurrenceRules];
[self removeAllExceptionRules];
[self removeAllExceptionDates];
max = [occurences count];
count = 1; // skip the master event
while (count < max)
{
currentOccurence = [occurences objectAtIndex: count];
[[[self parent] children] removeObject: currentOccurence];
count++;
}
}
// Organizer - we don't touch the value unless we're the organizer
@@ -806,7 +498,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
([self userIsOrganizer: [context activeUser]] || [[context activeUser] hasEmail: o]))
{
iCalPerson *person;
person = [iCalPerson elementWithTag: @"organizer"];
[person setEmail: o];
[person setCn: [theValues objectForKey: @"Organizer_Name"]];
@@ -847,13 +539,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
}
// Attendees - we don't touch the values if we're an attendee. This is gonna
// be done automatically by the ActiveSync client when invoking MeetingResponse.
if (![self userIsAttendee: [context activeUser]])
{
// Windows phones sens sometimes an empty Attendees tag.
// We check it's an array before processing it.
if ((o = [theValues objectForKey: @"Attendees"]) && [o isKindOfClass: [NSArray class]])
if ((o = [theValues objectForKey: @"Attendees"])&& [o isKindOfClass: [NSArray class]])
{
NSMutableArray *attendees;
NSDictionary *attendee;
@@ -871,7 +564,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
person = [iCalPerson elementWithTag: @"attendee"];
[person setCn: [attendee objectForKey: @"Attendee_Name"]];
[person setEmail: [attendee objectForKey: @"Attendee_Email"]];
status = [[attendee objectForKey: @"Attendee_Status"] intValue];
switch (status)
@@ -888,10 +581,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
case 0:
case 5:
default:
{
[person setPartStat: @"NEEDS-ACTION"];
[person setRsvp: @"TRUE"];
}
[person setPartStat: @"NEEDS-ACTION"];
break;
}
@@ -903,40 +593,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[self setAttendees: attendees];
}
}
[self setLastModified: [NSCalendarDate calendarDate]];
}
- (void) changeParticipationStatus: (NSDictionary *) theValues
inContext: (WOContext *) context
component: (id) component
{
NSString *status;
id o;
// See: https://msdn.microsoft.com/en-us/library/ee202290(v=exchg.80).aspx
//
// 0 == Free
// 1 == Tentative
// 2 == Busy
// 3 == Out of Office
// 4 == Working elsehwere
//
if ((o = [theValues objectForKey: @"BusyStatus"]))
{
// We translate >= 2 into ACCEPTED
if ([o intValue] == 0)
status = @"NEEDS-ACTION";
else if ([o intValue] >= 2)
status = @"ACCEPTED";
else
status = @"TENTATIVE";
// There's no delegate in EAS
[(SOGoAppointmentObject *) component changeParticipationStatus: status
withDelegate: nil
alarm: nil];
}
}
@end
+24 -51
View File
@@ -35,42 +35,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Foundation/NSString.h>
#import <NGCards/iCalEvent.h>
#import <NGCards/iCalToDo.h>
#import <NGCards/iCalByDayMask.h>
#import <NGCards/iCalDateTime.h>
#import <NGCards/iCalTimeZone.h>
#import "NSCalendarDate+ActiveSync.h"
#import "NSDate+ActiveSync.h"
@implementation iCalRecurrenceRule (ActiveSync)
- (NSCalendarDate *) _adjustedStartDate
{
iCalTimeZone *timeZone;
timeZone = [(iCalDateTime *)[[self parent] firstChildWithTag: @"dtstart"] timeZone];
if (timeZone)
return [timeZone computedDateForDate: [[self parent] startDate]];
else
return [[self parent] startDate];
}
- (NSString *) activeSyncRepresentationInContext: (WOContext *) context
{
NSMutableString *s;
NSString *t;
int type;
s = [NSMutableString string];
if ([[self parent] isKindOfClass: [iCalToDo class]])
t = @"Tasks";
else
t = @"Calendar";
[s appendFormat: @"<Recurrence xmlns=\"%@:\">", t];
[s appendString: @"<Recurrence xmlns=\"Calendar:\">"];
// 0 -> daily, 1 -> weekly, 2 -> montly, 5 -> yearly
type = 0;
@@ -82,11 +61,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// 1 -> sunday, 2 -> monday, 4 -> tuesday, 8 -> wednesday, 16 -> thursday, 32 -> friday, 64 -> saturday, 127 -> last day of month (montly or yearl recurrences only)
if ([[self byDayMask] isWeekDays])
{
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"%@:\">%d</Recurrence_DayOfWeek>", t, (2|4|8|16|32)];
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"Calendar:\">%d</Recurrence_DayOfWeek>", (2|4|8|16|32)];
}
else
{
[s appendFormat: @"<Recurrence_Interval xmlns=\"%@:\">%d</Recurrence_Interval>", t, [self repeatInterval]];
[s appendFormat: @"<Recurrence_Interval xmlns=\"Calendar:\">%d</Recurrence_Interval>", [self repeatInterval]];
}
}
else if ([self frequency] == iCalRecurrenceFrequenceWeekly)
@@ -111,11 +90,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
// No byDayMask, we take the event's start date to compute the DayOfWeek
// 0 == Sunday, 6 == Saturday
v = (1 << [[self _adjustedStartDate] dayOfWeek]);
v = (1 << [[[self parent] startDate] dayOfWeek]);
}
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"%@:\">%d</Recurrence_DayOfWeek>", t, v];
[s appendFormat: @"<Recurrence_Interval xmlns=\"%@:\">%d</Recurrence_Interval>", t, [self repeatInterval]];
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"Calendar:\">%d</Recurrence_DayOfWeek>", v];
[s appendFormat: @"<Recurrence_Interval xmlns=\"Calendar:\">%d</Recurrence_Interval>", [self repeatInterval]];
}
else if ([self frequency] == iCalRecurrenceFrequenceMonthly)
{
@@ -132,9 +111,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (firstOccurrence < 0)
firstOccurrence = 5;
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"%@:\">%d</Recurrence_DayOfWeek>", t, (1 << [dm firstDay])];
[s appendFormat: @"<Recurrence_WeekOfMonth xmlns=\"%@:\">%d</Recurrence_WeekOfMonth>", t, firstOccurrence];
[s appendFormat: @"<Recurrence_Interval xmlns=\"%@:\">%d</Recurrence_Interval>", t, [self repeatInterval]];
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"Calendar:\">%d</Recurrence_DayOfWeek>", (1 << [dm firstDay])];
[s appendFormat: @"<Recurrence_WeekOfMonth xmlns=\"Calendar:\">%d</Recurrence_WeekOfMonth>", firstOccurrence];
}
else if ([[self byMonthDay] count])
{
@@ -148,9 +126,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
iCalByDayMask *dm;
dm = [self byDayMask];
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"%@:\">%d</Recurrence_DayOfWeek>", t, (1 << [dm firstDay])];
[s appendFormat: @"<Recurrence_WeekOfMonth xmlns=\"%@:\">%d</Recurrence_WeekOfMonth>", t, 5];
[s appendFormat: @"<Recurrence_Interval xmlns=\"%@:\">%d</Recurrence_Interval>", t, [self repeatInterval]];
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"Calendar:\">%d</Recurrence_DayOfWeek>", (1 << [dm firstDay])];
[s appendFormat: @"<Recurrence_WeekOfMonth xmlns=\"Calendar:\">%d</Recurrence_WeekOfMonth>", 5];
}
else
{
@@ -162,7 +139,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
// Simple reccurrence rule of type "Monthly"
type = 2;
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"%@:\">%d</Recurrence_DayOfMonth>", t, [[self _adjustedStartDate] dayOfMonth]];
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"Calendar:\">%d</Recurrence_DayOfMonth>",
[[[self parent] startDate] dayOfMonth]];
}
}
else if ([self frequency] == iCalRecurrenceFrequenceYearly)
@@ -181,39 +159,33 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (firstOccurrence < 0)
firstOccurrence = 5;
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"%@:\">%d</Recurrence_DayOfWeek>", t, (1 << [dm firstDay])];
[s appendFormat: @"<Recurrence_WeekOfMonth xmlns=\"%@:\">%d</Recurrence_WeekOfMonth>", t, firstOccurrence];
[s appendFormat: @"<Recurrence_MonthOfYear xmlns=\"%@:\">%@</Recurrence_MonthOfYear>", t,
[s appendFormat: @"<Recurrence_DayOfWeek xmlns=\"Calendar:\">%d</Recurrence_DayOfWeek>", (1 << [dm firstDay])];
[s appendFormat: @"<Recurrence_WeekOfMonth xmlns=\"Calendar:\">%d</Recurrence_WeekOfMonth>", firstOccurrence];
[s appendFormat: @"<Recurrence_MonthOfYear xmlns=\"Calendar:\">%@</Recurrence_MonthOfYear>",
[self flattenedValuesForKey: @"bymonth"]];
}
else
{
type = 5; // Yearly
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"%@:\">%@</Recurrence_DayOfMonth>", t,
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"Calendar:\">%@</Recurrence_DayOfMonth>",
[self flattenedValuesForKey: @"bymonthday"]];
[s appendFormat: @"<Recurrence_MonthOfYear xmlns=\"%@:\">%@</Recurrence_MonthOfYear>", t,
[s appendFormat: @"<Recurrence_MonthOfYear xmlns=\"Calendar:\">%@</Recurrence_MonthOfYear>",
[self flattenedValuesForKey: @"bymonth"]];
}
}
else
{
type = 5;
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"%@:\">%d</Recurrence_DayOfMonth>", t, [[self _adjustedStartDate] dayOfMonth]];
[s appendFormat: @"<Recurrence_MonthOfYear xmlns=\"%@:\">%d</Recurrence_MonthOfYear>", t, [[self _adjustedStartDate] monthOfYear]];
}
type = 5;
}
[s appendFormat: @"<Recurrence_Type xmlns=\"%@:\">%d</Recurrence_Type>", t, type];
if ([[self parent] isKindOfClass: [iCalToDo class]])
[s appendFormat: @"<Recurrence_Start xmlns=\"%@:\">%@</Recurrence_Start>", t, [[[self parent] startDate] activeSyncRepresentationInContext: context]];
[s appendFormat: @"<Recurrence_Type xmlns=\"Calendar:\">%d</Recurrence_Type>", type];
// Occurrences / Until
//[s appendFormat: @"<Recurrence_Occurrences xmlns=\"Calendar:\">%d</Recurrence_Occurrences>", 5];
if ([self repeatCount])
{
[s appendFormat: @"<Recurrence_Occurrences xmlns=\"%@:\">%@</Recurrence_Occurrences>", t,
[s appendFormat: @"<Recurrence_Occurrences xmlns=\"Calendar:\">%@</Recurrence_Occurrences>",
[self flattenedValuesForKey: @"count"]];
}
else if ([self untilDate])
@@ -224,10 +196,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//ud = [[context activeUser] userDefaults];
//[date setTimeZone: [ud timeZone]];
[s appendFormat: @"<Recurrence_Until xmlns=\"%@:\">%@</Recurrence_Until>", t,
[s appendFormat: @"<Recurrence_Until xmlns=\"Calendar:\">%@</Recurrence_Until>",
[date activeSyncRepresentationWithoutSeparatorsInContext: context]];
}
[s appendString: @"</Recurrence>"];
return s;
+8 -12
View File
@@ -128,7 +128,7 @@ struct SYSTEMTIME {
//uint16_t wStandardYear;
struct SYSTEMTIME stStandardDate;
//uint16_t wDaylightYear;
struct SYSTEMTIME stDaylightDate = {0,0,0,0,0,0,0,0};
struct SYSTEMTIME stDaylightDate;
char standardName[64], daylightName[64];
@@ -144,17 +144,13 @@ struct SYSTEMTIME {
period = [self _mostRecentPeriodWithName: @"DAYLIGHT"];
if (!period)
{
stStandardDate.wMonth = 0;
lDaylightBias = 0;
}
else
{
lDaylightBias = (uint32_t) -([period secondsOffsetFromGMT] / 60) - lBias;
[period _fillTZDate: &stDaylightDate];
//wStandardYear = stStandardDate.wYear;
//wDaylightYear = stDaylightDate.wYear;
}
stStandardDate.wMonth = 0;
lDaylightBias = (uint32_t) -([period secondsOffsetFromGMT] / 60) - lBias;
[period _fillTZDate: &stDaylightDate];
//wStandardYear = stStandardDate.wYear;
//wDaylightYear = stDaylightDate.wYear;
// We build the timezone
[bytes appendBytes: &lBias length: 4];
+7 -56
View File
@@ -47,12 +47,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <NGCards/iCalDateTime.h>
#import <NGCards/iCalTimeZone.h>
#import <Appointments/iCalEntityObject+SOGo.h>
#include "NSDate+ActiveSync.h"
#include "NSString+ActiveSync.h"
#include "iCalRecurrenceRule+ActiveSync.h"
#include "iCalAlarm+ActiveSync.h"
@implementation iCalToDo (ActiveSync)
@@ -87,10 +84,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[s appendFormat: @"<DueDate xmlns=\"Tasks:\">%@</DueDate>", [o activeSyncRepresentationInContext: context]];
[s appendFormat: @"<UTCDueDate xmlns=\"Tasks:\">%@</UTCDueDate>", [o activeSyncRepresentationInContext: context]];
}
// Recurrence rules
if ([self isRecurrent])
[s appendString: [[[self recurrenceRules] lastObject] activeSyncRepresentationInContext: context]];
// Importance
o = [self priority];
@@ -102,19 +95,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
v = 1;
[s appendFormat: @"<Importance xmlns=\"Tasks:\">%d</Importance>", v];
// Reminder
if ([self hasAlarms])
{
iCalAlarm *alarm;
alarm = [self firstDisplayOrAudioAlarm];
[s appendFormat: @"<ReminderSet xmlns=\"Tasks:\">%d</ReminderSet>", 1];
[s appendString: [alarm activeSyncRepresentationInContext: context]];
}
else
{
[s appendFormat: @"<ReminderSet xmlns=\"Tasks:\">%d</ReminderSet>", 0];
}
// Reminder - FIXME
[s appendFormat: @"<ReminderSet xmlns=\"Tasks:\">%d</ReminderSet>", 0];
// Sensitivity
if ([[self accessClass] isEqualToString: @"PRIVATE"])
@@ -149,7 +131,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// otherwise it'll prevent WP8 phones from sync'ing. See #3028 for details.
o = [o activeSyncRepresentationInContext: context];
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
{
[s appendFormat: @"<Body xmlns=\"Tasks:\">%@</Body>", o];
[s appendString: @"<BodyTruncated xmlns=\"Tasks:\">0</BodyTruncated>"];
@@ -158,12 +140,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
[s appendFormat: @"<Type>%d</Type>", 1];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", (int)[o length]];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", [o length]];
[s appendFormat: @"<Data>%@</Data>", o];
[s appendString: @"</Body>"];
}
}
return s;
}
@@ -183,7 +165,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[self setSummary: o];
// FIXME: merge with iCalEvent
if ([[context objectForKey: @"ASProtocolVersion"] isEqualToString: @"2.5"])
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"2.5"])
{
if ((o = [theValues objectForKey: @"Body"]))
[self setComment: o];
@@ -267,39 +249,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ((o = [theValues objectForKey: @"ReminderTime"]))
{
iCalAlarm *alarm;
alarm = [[iCalAlarm alloc] init];
[alarm takeActiveSyncValues: theValues inContext: context];
[self removeAllAlarms];
[self addToAlarms: alarm];
RELEASE(alarm);
}
// Recurrence
if ((o = [theValues objectForKey: @"Recurrence"]) && !([[o objectForKey: @"Recurrence_DeadOccur"] intValue]))
{
iCalRecurrenceRule *rule;
rule = [[iCalRecurrenceRule alloc] init];
[self setRecurrenceRules: [NSArray arrayWithObject: rule]];
RELEASE(rule);
[rule takeActiveSyncValues: o inContext: context];
if (!([theValues objectForKey: @"StartDate"]))
{
iCalDateTime *start;
start = (iCalDateTime *) [self uniqueChildWithTag: @"dtstart"];
[start setTimeZone: tz];
[start setDate: [[o objectForKey: @"Recurrence_Start"] calendarDate]];
}
}
}
@end
+4 -8
View File
@@ -57,6 +57,8 @@ ProxyPreserveHost On
# Allow from your-cas-host-addr
# </Proxy>
ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
# Enable to use Microsoft ActiveSync support
# Note that you MUST have many sogod workers to use ActiveSync.
# See the SOGo Installation and Configuration guide for more details.
@@ -65,15 +67,11 @@ 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
<Proxy http://127.0.0.1:20000/SOGo>
## adjust the following to your configuration
## and do not forget to enable the headers module
<IfModule headers_module>
RequestHeader set "x-webobjects-server-port" "443"
RequestHeader set "x-webobjects-server-name" "%{HTTP_HOST}e" env=HTTP_HOST
RequestHeader set "x-webobjects-server-url" "https://%{HTTP_HOST}e" env=HTTP_HOST
RequestHeader set "x-webobjects-server-name" "yourhostname"
RequestHeader set "x-webobjects-server-url" "https://yourhostname"
## When using proxy-side autentication, you need to uncomment and
## adjust the following line:
@@ -81,7 +79,6 @@ ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e" env=REMOTE_USER
RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
</IfModule>
AddDefaultCharset UTF-8
@@ -93,6 +90,5 @@ ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
<IfModule rewrite_module>
RewriteEngine On
RewriteRule ^/.well-known/caldav/?$ /SOGo/dav [R=301]
RewriteRule ^/.well-known/carddav/?$ /SOGo/dav [R=301]
</IfModule>
-2324
View File
File diff suppressed because it is too large. Load diff
-11787
View File
File diff suppressed because it is too large. Load diff
+2 -3
View File
@@ -2,8 +2,7 @@ all: $(patsubst %.asciidoc,%.pdf,$(wildcard *.asciidoc))
%.pdf : %.asciidoc
asciidoc -a docinfo1 -b docbook -d book -o $<.docbook $<
xsltproc -o $<.fo docbook/xsl/sogo-fo.xsl $<.docbook
fop -c fonts/fop-config.xml $<.fo -pdf $@
fop -c fonts/fop-config.xml -xsl docbook/xsl/sogo-fo.xsl -xml $<.docbook -pdf $@
clean:
rm -f *.asciidoc.fo *.asciidoc.docbook *.pdf
rm *.asciidoc.docbook *.pdf
+157
View File
@@ -0,0 +1,157 @@
https://wiki.inverse.ca/focus/SOGo/CodingStyle
https://wiki.inverse.ca/focus/SOGo/D%C3%A9veloppement
https://wiki.inverse.ca/focus/PacketFence/Devel/BestPractices
UI and UX
---------
* http://www.google.com/design/spec/material-design/
* http://goodui.org/
* Try Repeating Your Primary Action instead of showing it just once.
* Try Distinct Clickable/Selected Styles instead of blurring them.
* Try Undos instead of prompting for confirmation.
* Try More Contrast instead of similarity.
* Try Exposing Options instead of hiding them.
* Try Showing State instead of being state agnostic.
* Try Direct Manipulation instead of contextless menus.
* Try Exposing Fields instead of creating extra pages.
* Try Transitions instead of showing changes instantly.
* Try Fewer Borders instead of wasting attention.
* Try Designing For Zero Data instead of just data heavy cases.
* Try Consistency instead of making people relearn.
* Try Conventions instead of reinventing the wheel.
* Try Visual Hierarchy instead of dullness.
* Try Grouping Related Items instead of disordering.
* Try Inline Validation instead of delaying errors.
* Try Forgiving Inputs instead of being strict with data.
* Try Bigger Click Areas instead of tiny ones.
* Try Faster Load Times instead of making people wait.
* Try Keyboard Shortcuts instead of buttons only.
* Try Upfront Progress instead of starting with a blank.
* Try Softer Prompts instead of modal windows.
* Try Multifunctional Controls instead of more parts.
* Try Icon Labels instead of opening for interpretation.
* http://designmodo.com/create-style-guides/
* http://uxmyths.com/
Frameworks & Tools
------------------
GNUstep
~~~~~~~
SOPE
~~~~
AngularJS
~~~~~~~~~
* https://angularjs.org/
* http://angular-ui.github.io/ui-router/
* https://www.airpair.com/angularjs/posts/angularjs-tutorial
Angular Material
~~~~~~~~~~~~~~~~
* https://material.angularjs.org/
Lo-Dash
~~~~~~~
* http://lodash.com/
* http://underscorejs.org/
Code Style
----------
Objective-C
~~~~~~~~~~~
* To document the Web APIs, we follow the http://apidocjs.com/[APIDOC] standards.
apidoc -f ".*\\.m" -i UI -o Documentation/JSON-API
HTML
~~~~
* Localize your strings:
<var:string label:value="I'm localized!"/>
* Localize your attributes:
<input type="text" label:placeholder="I'm localized!"/>
* Reuse existing localized strings as much as possible. Otherwise don't forget to update the English Localizable.strings file of the appropriate module.
JavaScript
~~~~~~~~~~
* http://eslint.org/
* https://github.com/toddmotto/angularjs-styleguide
* https://github.com/angular/material/blob/master/docs/guides/CODING.md
* We conform to https://github.com/airbnb/javascript[Airbnb coding standards]. Use https://github.com/jscs-dev/node-jscs[jscs] with the 'airbnb' preset to validate your code style:
jscs -p airbnb *.js
* For documentation, we follow the http://usejsdoc.org/[JSDoc3] standards:
jsdoc UI/WebServerResources/js/{Appointments,Common,Contacts,Mailer}/*.js -d Documentation/JavaScript-API
Models (facades)
^^^^^^^^^^^^^^^^
////
http://trochette.github.io/Angular-Design-Patterns-Best-Practices/
////
* Move business logic into models and share them.
* Keep it simple, separate server interaction and error handling from the model. That way model only handle data processing and code is easier to maintain.
SASS/CSS
~~~~~~~~
* http://componentcss.com/
* https://github.com/styleguide/css
* https://smacss.com/
* For documentation, we follow http://sassdoc.com/[SassDoc] annotations.
* We need the SASS files of Angular Material to build our CSS. The git repository of Angular Material is included as a submodule of SOGo:
git submodule init
git submodule update
* FlexBox compatibility http://caniuse.com/#feat=flexbox
Fonts
^^^^^
* We build a custom icons font using the online app https://icomoon.io/app/#/select[icomoon].
* http://www.carrois.com/fira-4-0/
* Material Design Iconic Font http://zavoloklom.github.io/material-design-iconic-font/icons.html
Version Control
---------------
* https://devcharm.com/articles/46/improve-your-git-workflow/
* Each commit should cover only one thing;
* Begin the commit message with a single short (less than 50 characters) line summarizing the change, followed by a blank line and then a more thorough description;
* When fixing a bug, commit to the devel branch as well as the maintenance branch of the latest release version (named maintenance/x.y). When a ticket is associated to the bug, add to the description a line saying *Fixes #1234*.
* `git pull` may introduce http://stackoverflow.com/questions/15316601/in-what-cases-could-git-pull-be-harmful[inconsistencies and problems]. Replace it with the following alias:
git config --global alias.up '!git remote update -p; git merge --ff-only @{u}'
Testing
-------
* https://github.com/angular/protractor
* http://karma-runner.github.io/
JSON API
~~~~~~~~
One practical way to test the JSON API is to use `curl`. To do so, you need to enable `SOGoTrustProxyAuthentication` and configure HTTP authentifcation in Apache. You can pipe the result to [jq](http://stedolan.github.io/jq/) to nicely format and filter the output:
curl -u username:password http://localhost/SOGo/so/username/Calendar/calendarslist | jq '.'
curl -u username:password -H 'Content-Type: application/json' -d '{}' http://localhost/SOGo/so/francis/Calendar/personal/71B6-54904400-1-7C308500.ics/save
+65 -183
View File
@@ -1,7 +1,5 @@
Installation and Configuration Guide
====================================
:toc: left
:icons: font
////
@@ -18,13 +16,13 @@ About this Guide
This guide will walk you through the installation and configuration of
the SOGo solution. It also covers the installation and configuration of
SOGo ActiveSync support - the solution used to synchronize mobile
SOGo ActiveSync support – the solution used to synchronize mobile
devices with SOGo.
The instructions are based on version {release_version} of SOGo.
The latest version of this guide is available
at http://sogo.nu/downloads/documentation.html.
at http://www.sogo.nu/downloads/documentation.html.
Introduction
------------
@@ -47,15 +45,16 @@ and the data of Mozilla Thunderbird and Lightning
the SOGo Connector and the SOGo Integrator
* Native compatibility for Microsoft Outlook 2003, 2007, 2010, and 2013
* Two-way synchronization support with any Microsoft ActiveSync-capable
device, or Outlook 2013/2016
device, or Outlook 2013
SOGo is developed by a community of developers located mainly in North
America and Europe. More information can be found at http://sogo.nu/
America and Europe. More information can be found
at http://www.sogo.nu/
Architecture and Compatibility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
image::images/architecture.png[System Architecture, 400, 964]
image::images/architecture.png[System Architecture]
Standard protocols such as CalDAV, CardDAV, GroupDAV, HTTP, IMAP and
SMTP are used to communicate with the SOGo platform or its
@@ -171,7 +170,7 @@ supported by SOGo:
* Red Hat Enterprise Linux (RHEL) Server 5, 6 and 7
* Community ENTerprise Operating System (CentOS) 5, 6 and 7
* Debian GNU/Linux 6.0 (Squeeze) to 8.0 (Jessie)
* Ubuntu 12.04 (Precise) to 14.04 (Trusty)
* Ubuntu 10.04 (Lucid) to 14.04 (Trusty)
Make sure the required components are started automatically at boot time
and that they are running before proceeding with the SOGo configuration.
@@ -180,7 +179,7 @@ standard distribution. For example, if you are using Red Hat Enterprise
Linux 5, you have to be subscribed to the Red Hat Network before
continuing with the SOGo software installation.
NOTE: This document covers the installation of SOGo under RHEL 6.
This document covers the installation of SOGo under RHEL 6.
For installation instructions on Debian and Ubuntu, please refer
directly to the SOGo website at http://www.sogo.nu/.
@@ -201,11 +200,6 @@ should apply to all supported operating systems.
Software Downloads
~~~~~~~~~~~~~~~~~~
[NOTE]
In order to access the production builds, you need a proper support contract
from https://sogo.nu/support/index_new.html#support-plans[Inverse]. Continue
with the configuration once you received your username and password.
SOGo can be installed using the `yum` utility. To do so, first create
the `/etc/yum.repos.d/inverse.repo` configuration file with the following
content:
@@ -213,22 +207,19 @@ content:
----
[SOGo]
name=Inverse SOGo Repository
baseurl=https://<username>:<password>@packages.inverse.ca/SOGo/release/2/rhel/6/$basearch
baseurl=http://inverse.ca/downloads/SOGo/RHEL6/$basearch
gpgcheck=0
----
[NOTE]
Any non-URL safe characters in username/password must be URL-encoded. For
example, if your password is `so%go`, you must set the value in your
configuration file to `so%25go` - where `%` is encoded to `%25`.
Some of the softwares on which SOGo depends are available from the
repository of RepoForge (previously known as RPMforge). To add RepoForge
to your packages sources, download and install the appropriate RPM
package
from http://packages.sw.be/rpmforge-release/.
Also make sure you enabled the "rpmforge-extras" repository.
Inverse signs its RPM packages with its GPG key. Integrity verification happens
all by itself on package installation, all you need to do is first import the
key into your rpm keychain:
----
rpm --import "https://pgp.mit.edu/pks/lookup?op=get&search=0xCB2D3A2AA0030E2C"
----
For more information on using RepoForge,
visit http://repoforge.org/use/.
Software Installation
~~~~~~~~~~~~~~~~~~~~~
@@ -303,7 +294,7 @@ associated to a domain is limited to access only the users data from the
same domain. Consequently, the configuration parameters of SOGo are
defined on three levels:
image::images/preferences-hierarchy.png[Preferences Hierarchy, 400, 400]
image::images/preferences-hierarchy.png[Preferences Hierarchy]
Each level inherits the preferences of the parent level. Therefore,
domain preferences define the defaults values of the user preferences,
@@ -377,13 +368,6 @@ Defaults to 10 (minutes).
Do not set this too low as child processes replying to clients on a slow
internet connection could be killed prematurely.
|S |WOMaxUploadSize
|Parameter used to set the maximum allowed size for content being
sent to SOGo using a PUT or a POST call. This can also limit the file
attachment size being uploaded to SOGo when composing a mail. The
value is in kilobyte. By default, the value is 0, or disabled so no
limit will be set.
|S |SxVMemLimit
|Parameter used to set the maximum amount of memory (in
megabytes) that a child can use. Reaching that value will force children
@@ -491,7 +475,7 @@ SOGoSAML2LogoutEnabled must be set to YES. If unset, the user will be
redirected to a blank page.
|D |SOGoTimeZone
|Mandatory parameter used to set a default time zone for users. The default
|Parameter used to set a default time zone for users. The default
timezone is set to UTC. The Olson database is a standard database that
takes all the time zones around the world into account and represents
them along with their history. On GNU/Linux systems, time zone
@@ -513,8 +497,8 @@ In our example, we set the default domain to `acme.com`.
meeting participants. Possible values are:
[options="compact"]
* `YES` - to send notifications
* `NO` - to not send notifications
* `YES` – to send notifications
* `NO` – to not send notifications
Defaults to `NO` when unset.
@@ -587,8 +571,6 @@ for SOGo. Possible values are:
* `Basque`
* `BrazilianPortuguese`
* `Catalan`
* `ChineseTaiwan`
* `Croatian`
* `Czech`
* `Danish`
* `Dutch`
@@ -599,19 +581,14 @@ for SOGo. Possible values are:
* `Hungarian`
* `Icelandic`
* `Italian`
* `Lithuanian`
* `Macedonian`
* `NorwegianBokmal`
* `NorwegianNynorsk`
* `Polish`
* `Portuguese`
* `Russian`
* `Slovak`
* `Slovenian`
* `SpanishArgentina`
* `SpanishSpain`
* `SpanishArgentina`
* `Swedish`
* `TurkishTurkey`
* `Ukrainian`
* `Welsh`
@@ -620,8 +597,8 @@ for SOGo. Possible values are:
someone changes his/her own calendar. Possible values are:
[options="compact"]
- `YES` - to send notifications
- `NO` - to not send notifications
- `YES` – to send notifications
- `NO` – to not send notifications
Defaults to `NO` when unset. User can overwrite this from the calendar
properties window.
@@ -632,8 +609,8 @@ modification is being done to his/her own calendar by someone else.
Possible values are:
[options="compact"]
* `YES` - to send notifications
* `NO` - to not send notifications
* `YES` – to send notifications
* `NO` – to not send notifications
Defaults to `NO` when unset. User can overwrite this from the calendar
properties window.
@@ -656,8 +633,8 @@ requiring not authentication) their calendars and address books.
Possible values are:
[options="compact"]
* `YES` - to allow them
* `NO` - to prevent them from doing so
* `YES` – to allow them
* `NO` – to prevent them from doing so
Defaults to `NO` when unset.
@@ -668,8 +645,8 @@ SOGo.
Possible values are:
[options="compact"]
* `YES` - to allow them
* `NO` - to prevent them from doing so
* `YES` – to allow them
* `NO` – to prevent them from doing so
Defaults to `NO` when unset.
@@ -699,7 +676,7 @@ Defaults to `NO` when unset.
string (attendee completion, address book search, etc.) prior triggering
the server-side search operation.
Defaults to `2` when unset - which means a search operation will be
Defaults to `2` when unset – which means a search operation will be
triggered on the 3rd typed character.
|S |SOGoMaximumFailedLoginCount
@@ -737,21 +714,6 @@ Default value is `0`, or disabled.
|Number of seconds, default to `300` (or 5 minutes). Note that
_SOGoCacheCleanupInterval_ must be set to a value equal or higher than
_SOGoFailedLoginBlockInterval_.
|S |SOGoMaximumRequestCount
|Parameter used to control the number of requests a user can send to the SOGo
server in _SOGoMaximumRequestInterval_ seconds or more. If conditions are met
or exceeded, the user will not be able to perform requests on the SOGo server
for _SOGoRequestBlockInterval_ seconds and will receive 429 HTTP responses for
any requests being made. Default value is 0, or disabled
|S |SOGoMaximumRequestInterval
|Number of seconds, defaults to `30`.
|S |SOGoRequestBlockInterval
|Number of seconds, defaults to 300 (or 5 minutes). Note that _SOGoCacheCleanupInterval_
must be set to a value equal or higher than _SOGoRequestBlockInterval_.
|=======================================================================
Authentication using LDAP
@@ -904,7 +866,7 @@ source can contain the following values:
|The type of this user source, set to ldap` for an LDAP source.
|id
|The identification name of the LDAP repository. This must be unique -
|The identification name of the LDAP repository. This must be unique –
even when using multiple domains.
|CNFieldName
@@ -923,8 +885,7 @@ table.
|MailFieldNames
|An array of fields that returns the user's email addresses (defaults to
`mail` when unset). Note that SOGo will always automatically strip the
protocol value from the attribute if the attribute name is `proxyAddresses`.
`mail` when unset).
|SearchFieldNames
|An array of fields to to match against the search string when filtering
@@ -971,8 +932,8 @@ be marked as busy the first time it is booked.
EOQualifier. The following operators are supported:
[options="compact"]
* `<>` - inequality operator
* `=` - equality operator
* `<>` – inequality operator
* `=` – equality operator
Multiple qualifiers can be joined by using `OR` and `AND`, they can also
be grouped together by using parenthesis. Attribute values should be
@@ -1034,9 +995,9 @@ be specified as a LDAP Extension in the LDAP URL (e.g.
without Password Policies enabled.
Possible values are: `none`, `plain`, `crypt`, `md5`, `md5-crypt`,
`sha256-crypt` and `sha512-crypt`, `smd5`, `cram-md5` and `sha`, `sha256`,
`sha512` and its ssha (e.g. `ssha` or `ssha256`) variants
(plus setting of the encoding with `.b64` or `.hex`).
`smd5`, `cram-md5` and `sha`, `sha256`, `sha512` and its ssha (e.g.
`ssha` or `ssha256`) variants (plus setting of the encoding with `.b64`
or `.hex`).
For a more detailed description see
http://wiki.dovecot.org/Authentication/PasswordSchemes.
@@ -1045,9 +1006,6 @@ Note that `cram-md5` is not actually using cram-md5 (due to the lack of
challenge-response mechanism), its just saving the intermediate MD5
context as Dovecot stores in its database.
Also note that `sha256-crypt` and `sha512-crypt` requires that your
operating system supports glibc 2.7 or more recent.
|canAuthenticate
|If set to `YES`, this LDAP source is used for authentication
@@ -1167,7 +1125,7 @@ fax number, one could map it to the _facsimiletelephonenumber_ attribute
like this:
----
mapping = {
mapping = \{
  facsimiletelephonenumber = ("fax", "facsimiletelephonenumber");
};
----
@@ -1364,35 +1322,12 @@ supported, such as MySQL and Oracle.
First, make sure that your PostgreSQL server has TCP/IP connections
support enabled.
[TIP]
===============================
SOGo stores the database hostname together with table references inside
several database tables. To prevent possible future issues when moving
the database to another host, it is best practice to add a local alias name to
your `/etc/hosts` file, and using this in `/etc/sogo/sogo.conf` instead of the
actual name of your server or localhost. When the database host name changes,
you can now simply change the hosts file instead of updating several table
columns replacing the old hostname. An example entry for `/etc/hosts` when
running the database on the same host, registering `127.0.0.1` not only for
`localhost`, but also the `db-alias` alias:
127.0.0.1 localhost db-alias
In the SOGo configuration, use the alias name instead of the real IP address or
host name, for example
----
SOGoProfileURL =
"postgresql://sogo:sogo@db-alias:5432/sogo/sogo_user_profile";
----
===============================
Create the database user and schema using the following commands:
----
su - postgres
createuser --no-superuser --no-createdb --no-createrole \
--encrypted --pwprompt sogo
su – postgres
createuser --no-superuser --no-createdb –-no-createrole \
–-encrypted --pwprompt sogo
(specify “sogo” as password)
createdb -O sogo sogo
----
@@ -1450,13 +1385,6 @@ URL could be set to something like:
See the "EMail reminders" section in this document for more information.
|=======================================================================
[NOTE]
Any non-URL safe characters in username/password must be URL-encoded.
For example, if your SOGo database password is `so%go`, you must set
the value in your preferences to `so%25go` - where `%` is encoded
to `%25`.
If you're using MySQL, make sure in your `my.cnf` file you have:
----
@@ -1493,7 +1421,7 @@ source can contain the following values:
|The type of this user source, set to `sql` for a SQL source.
|id
|The identification name of the SQL repository. This must be unique -
|The identification name of the SQL repository. This must be unique –
even when using multiple domains.
|viewURL
@@ -1501,9 +1429,9 @@ even when using multiple domains.
present. Required columns are:
[options="compact"]
* `c_uid`: will be used for authentication - it's a username or
* `c_uid`: will be used for authentication – it's a username or
username@domain.tld
* `c_name`: will be used to uniquely identify entries - which can be
* `c_name`: will be used to uniquely identify entries – which can be
identical to `c_uid`
* `c_password`: password of the user, plain text, crypt, md5 or sha
encoded
@@ -1609,14 +1537,14 @@ SOGoUserSources =
Certain database columns must be present in the view/table, such as:
* `c_uid` - will be used for authentication - it's the username
* `c_uid` – will be used for authentication – it's the username
or username@domain.tld
* `c_name` - which can be identical to `c_uid` - will be used to
* `c_name` – which can be identical to `c_uid` – will be used to
uniquely identify entries
* `c_password` - password of the user, plain-text, md5 or sha encoded
* `c_password` – password of the user, plain-text, md5 or sha encoded
for now
* `c_cn` - the user's common name - such as "John Doe"
* `mail` - the user's mail address
* `c_cn` – the user's common name – such as "John Doe"
* `mail` – the user's mail address
Note that groups are currently not supported for SQL-based
authentication sources.
@@ -1636,22 +1564,16 @@ The following table describes the related parameters.
are:
[options="compact"]
* `sendmail` - to use the sendmail binary
* `smtp` - to use the SMTP protocol
* `sendmail` – to use the sendmail binary
* `smtp` – to use the SMTP protocol
|D |SOGoSMTPServer
|The DNS name or IP address of the SMTP server used when
_SOGoMailingMechanism_ is set to `smtp`.
Supported formats are: `smtp://domain:port`, `smtps://domain`,
`domain:port`, `smtp://domain:port/?tls=YES`. Using the option
`tls=YES` will enforce using STARTTLS smtp connections. Thus,
`smtp://localhost:587/?tls=YES` would use the default MUA port
on localhost with STARTTLS enforced.
|D |SOGoSMTPAuthenticationType
|Activate SMTP authentication and specifies which type is in use.
Current, only `PLAIN` is supported and other values will cause
the authentication to fail.
Current, only `PLAIN` is supported and other values will be ignored.
|S |WOSendMail
|The path of the sendmail binary.
@@ -1706,16 +1628,6 @@ Defaults to `Trash` when unset.
Use a `/` as a hierarchy separator if referring to an IMAP subfolder.
For example: `INBOX/Trash`.
|U |SOGoJunkFolderName
|Parameter used to set the IMAP folder name used to store junk
messages.
Defaults to `Junk` when unset.
Use a `/` as a hierarchy separator if referring to an IMAP subfolder.
For example: `INBOX/Junk`. Also see the SOGoMailJunkSettings for
more options regarding junk/not-junk actions.
|D |SOGoIMAPCASServiceName
|Parameter used to set the CAS service name (URL) of the imap service.
This is useful if SOGo is connecting to the IMAP service through a
@@ -1918,11 +1830,6 @@ host.
Defaults to `NO` when unset.
|U |SOGoSieveFilters
|Parameter used to define initial Sieve scripts for users. The user
can still modify the scripts and the initial values will be written
to the Sieve server upon first login.
|D |SOGoMailPollingIntervals
|Parameter used to define the mail polling intervals (in minutes)
available to the user. The parameter is an array that can contain the
@@ -2175,21 +2082,7 @@ Defaults to `%{FolderName} (%{UserName} <%{Email}>)` when unset.
the template named `UIxAdditionalPreferences.wox`. This template should
be put under `~sogo/GNUstep/Library/SOGo/Templates/PreferencesUI/`.
|D |SOGoMailJunkSettings
|Parameter used to enable email junk settings. The value is a dictionary
and the follow keys are supported: `vendor` (which must be set to "generic"
for now), `junkEmailAddress` which sets the email address to whom SOGo will
send junk mails to, `notJunkEmailAddress` which sets the email address to
whome SOGo will send non-junk mails to and `limit`, which is an integer value
and sets the maximum number of mails that will be attached to a
junk/not junk report sent by SOGo. Example: `SOGoMailJunkSettings = {
vendor = "generic"; junkEmailAddress = "spam@foo.com";
notJunkEmailAddress = "ham@foo.com"; limit = 10;
};`
|D |SOGoMailKeepDraftsAfterSend
|Parameter used to keep mails in the drafts folder once they have been
sent by SOGo. Defaults to `NO` when unset.
Defaults to `NO` when unset.
|=======================================================================
SOGo Configuration Summary
@@ -2218,9 +2111,8 @@ like this:
SOGoDraftsFolderName = Drafts;
SOGoSentFolderName = Sent;
SOGoTrashFolderName = Trash;
SOGoJunkFolderName = Junk;
SOGoMailingMechanism = smtp;
SOGoSMTPServer = "smtp://127.0.0.1";
SOGoSMTPServer = 127.0.0.1;
SOGoUserSources = (
{
type = ldap;
@@ -2567,19 +2459,13 @@ have unexpected behaviour with various ActiveSync clients.
EAS command.
Defaults to `NO`, which means no logging is performed.
|S |SOGoMaximumPictureSize
|Parameter used to overwrite the maximum number of bytes returned in the picture
for EAS Search operations in the GAL.
If not set, it defaults to `102400` bytes, or 100 KB.
|=======================================================================
Please be aware of the following limitations:
* Outlook 2013/2016 does not search the GAL. One possible alternative
* Outlook 2013 does not search the GAL. One possible alternative
solution is to configure Outlook to use a LDAP server (over SSL) with
authentication. Outlook 2013/2016 also does not seem to support multiple
authentication. Outlook 2013 also does not seem to support multiple
address books over ActiveSync.
* To successfully synchronize Outlook email categories, a corresponding
mail label (Preferences->Mail Options) has to be created manually in SOGo
@@ -2595,9 +2481,9 @@ to handle many clients. Make sure you tune your SOGo server when having
lots of ActiveSync clients.
* Repetitive events with occurrences exceptions are currently not
supported.
* Outlook 2013/2016 Autodiscovery is currently not supported.
* Outlook 2013/2016 freebusy lookups are supported using the Internet
Free/Busy feature of Outlook 2013/2016. Please
* Outlook 2013 Autodiscovery is currently not supported.
* Outlook 2013 freebusy lookups are supported using the Internet
Free/Busy feature of Outlook 2013. Please
see http://support.microsoft.com/kb/291621 for configuration
instructions. On the SOGo side, _SOGoEnablePublicAccess_ must be set to
`YES` and the URL to use must be of the following format:
@@ -2606,9 +2492,6 @@ instructions. On the SOGo side, _SOGoEnablePublicAccess_ must be set to
need to adjust the word size of your IMAP server. In Dovecot, the parameter
to increase is "imap_max_line_length" while under Cyrus IMAP Server, the
parameter is "maxword". We suggest a buffer of 2MB.
* If you are using MySQL, make sure you set "max_allowed_packet" to a large value
since the EAS cache size can be large for mailboxes with thousands of messages.
A 64M or even 128M value is recommended.
In order to use the SOGo ActiveSync support code in production
environments, you need to get a proper usage license from Microsoft.
@@ -2757,18 +2640,17 @@ To access your personal calendar:
`http://localhost/SOGo/dav/jdoe/Calendar/personal/`
* Click on Continue.
Apple Calendar and iOS
~~~~~~~~~~~~~~~~~~~~~~
Apple iCal
~~~~~~~~~~
Apple Calendar and Mac OS X and the calendar application on iOS can also be used
as a client application for SOGo.
Apple iCal can also be used as a client application for SOGo.
To configure the application so it works with SOGo, create a new account and specify,
To configure it so it works with SOGo, create a new account and specify,
as the Account URL, an URL such as:
http://localhost/SOGo/dav/jdoe/
Note that the trailing slash is important for the old Apple iCal 3 application.
Note that the trailing slash is important for Apple iCal 3.
Apple AddressBook
~~~~~~~~~~~~~~~~~
@@ -233,7 +233,6 @@ Installation
This section will guide you through the installation of the native
Microsoft Outlook compatibility layer SOGo offers.
////
Red Hat Enterprise Linux v6 x86_64
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -317,7 +316,7 @@ from this guide.
On Ubuntu 12.04, the Samba init scripts need to be modified to
disable the upstart check. For more details, refer to:
https://wiki.samba.org/index.php/Samba4/InitScript
////
Debian 8 (Jessie) and Ubuntu 14.04 (Trusty Tahr)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -388,7 +387,7 @@ Run the following commands as root: 
----
samba-tool domain provision --realm=example.com \
--domain=EXAMPLE \
--domain=OPENCHANGE \
--adminpass='%1OpenChange' \
--server-role='domain controller'
@@ -396,7 +395,7 @@ samba-tool user setexpiry administrator --noexpiry
----
You might consider changing the realm and domain used, to suit your
environment.
enviroment.
You might also have to
remove `/etc/samba/smb.conf` prior running this command.
@@ -442,7 +441,7 @@ Your Samba 4 configuration file should look like this:
OpenChange Configuration
~~~~~~~~~~~~~~~~~~~~~~~~
Since v2.2, OpenChange stores its metadata in MySQL so you need to have it installed.
OpenChange 2.2 stores its metadata in MySQL so you need to have it installed.
First, create the OpenChange MySQL user:
@@ -513,11 +512,9 @@ mapistore:indexing_backend = mysql://openchange-user:openchange$123@localhost/op
mapiproxy:openchangedb = mysql://openchange-user:openchange$123@localhost/openchange
----
////
On RHEL, make sure SELinux is disabled:
setenforce 0
////
Next, you can start Samba using the usual command:
@@ -548,11 +545,9 @@ This service runs as a WSGI application under apache (mod_wsgi).
While HTTPS is not required to access this service, it is strongly
recommended.
////
On RHEL-based distributions, the apache configuration required by these
services can be found in `/etc/httpd/conf.d/ocsmanager.conf` and
`/etc/httpd/conf.d/rpcproxy.conf`.
////
For Debian-based distributions, these files can be found
in `/etc/apache2/conf.d/` or `/etc/apache2/conf-available`.
@@ -568,10 +563,8 @@ The OCS Manager and RPC Proxy configuration module can be enabled using:
a2enconf ocsmanager
a2enconf rpcproxy
////
On RHEL-based distributions, make sure the `LoadModule` directive is
uncommented in `/etc/httpd/conf.d/wsgi.conf`.
////
The _reqtimeout_ apache module is known to cause problems when using the
default configuration shipped with Debian-based systems. On such
@@ -587,12 +580,10 @@ To avoid this problem, use a much higher timeout or disable the module:
a2dismod reqtimeout
You should now restart the Apache service and make sure it will start on
boot.
////
On RHEL-based distributions, do:
boot. On RHEL-based distributions, do:
chkconfig httpd on && /etc/init.d/httpd restart
////
On Debian-based distributions, do:
update-rc.d apache2 defaults && /etc/init.d/apache2 restart
@@ -818,10 +809,11 @@ can be ignored for now. This feature is currently not supported.
remove any data associated with the user from the SOGo server and
recreate a Microsoft Outlook profile.
To remove any data associated to a user, use
the `openchange_user_cleanup` script distributed with OpenChange. The script
can be found in `/usr/share/openchange/`.
the `openchange_user_cleanup` script distributed with SOGo. The script
can be found in `/usr/share/doc/sogo/` (`/usr/share/sogo-VERSION/` on
RHEL).
To reset a user, run the script as root:
`openchange_user_cleanup username`. See the usage output for additional options.
`python openchange_user_cleanup username`. See the usage output for additional options.
* The "Out of Office Assistant" will not currently work. This feature
has not been implemented.
* Creating folders below INBOX (when not normally permitted by the IMAP
+2 -2
View File
@@ -121,9 +121,9 @@
</xsl:choose>
</xsl:template>
<xsl:template name="next.itemsymbol">
<xsl:param name="itemsymbol" select="'square'"/>
<xsl:param name="itemsymbol" select="'default'"/>
<xsl:choose>
<xsl:when test="$itemsymbol='square'">square</xsl:when>
<xsl:otherwise>square</xsl:otherwise>
</xsl:choose>
</xsl:template>
+3 -3
View File
@@ -1,7 +1,7 @@
<!-- TODO have the build system take care of this -->
<releaseinfo>Version 2.4.1 - June 2021</releaseinfo>
<subtitle>for version 2.4.1</subtitle>
<date>2021-06-01</date>
<releaseinfo>Version 2.3.1 - July 2015</releaseinfo>
<subtitle>for version 2.3.1</subtitle>
<date>2015-07-23</date>
<legalnotice>
<para>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".</para>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

@@ -6,13 +6,13 @@
Authors:
- Inverse inc. <info@inverse.ca>
Copyright (C) 2008-2017 Inverse inc.
Copyright (C) 2008-2015 Inverse inc.
License: GFDL 1.2 or later. http://www.gnu.org/licenses/fdl.html
////
// TODO have the build system take care of this
:release_version: 2.4.1
:release_version: 2.3.1
// vim: set syntax=asciidoc tabstop=2 shiftwidth=2 expandtab:
+20 -15
View File
@@ -42,7 +42,6 @@
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserFolder.h>
#import <SOGo/SOGoUserManager.h>
#import "SOGo+DAV.h"
@@ -268,7 +267,7 @@
NSObject <DOMNodeList> *list;
NSObject <DOMNode> *valueNode;
NSArray *elements;
NSString *property=nil, *match=nil;
NSString *property, *match;
list = [searchElement getElementsByTagName: @"prop"];
if ([list length])
@@ -366,26 +365,31 @@
withEmailAddressSetMatching: (NSString *) value
inContext: (WOContext *) localContext
{
SOGoUserManager *um;
id <SOGoSource> authenticationSource;
SOGoUser *activeUser;
NSArray *records;
NSUInteger count, max;
NSString *uid;
SOGoUserFolder *collection;
um = [SOGoUserManager sharedUserManager];
records = [um fetchUsersMatching: value
inDomain: [[localContext activeUser] domain]];
max = [records count];
for (count = 0; count < max; count++)
activeUser = [localContext activeUser];
if ([activeUser respondsToSelector: @selector (authenticationSource)])
{
uid = [[records objectAtIndex: count] objectForKey: @"c_uid"];
if ([uid length] > 0)
{
collection = [[SOGoUser userWithLogin: uid]
authenticationSource = [[localContext activeUser] authenticationSource];
records = [authenticationSource
fetchContactsMatching: value
inDomain: [activeUser domain]];
max = [records count];
for (count = 0; count < max; count++)
{
uid = [[records objectAtIndex: count] objectForKey: @"c_uid"];
if ([uid length] > 0)
{
collection = [[SOGoUser userWithLogin: uid]
homeFolderInContext: localContext];
[collections addObject: collection];
}
[collections addObject: collection];
}
}
}
}
@@ -581,6 +585,7 @@
@"addressbook", @"calendar-access",
@"calendar-schedule", @"calendar-auto-schedule",
@"calendar-proxy",
@"calendar-query-extended",
@"extended-mkcol",
@"calendarserver-principal-property-search",
+6 -80
View File
@@ -35,7 +35,6 @@
#import <GDLContentStore/GCSAlarmsFolder.h>
#import <GDLContentStore/GCSSessionsFolder.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/SoClassSecurityInfo.h>
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WORequest+So.h>
@@ -124,7 +123,7 @@ static BOOL debugLeaks;
vMemSizeLimit = [defaults vmemLimit];
if (vMemSizeLimit > 0)
[self logWithFormat: @"vmem size check enabled: shutting down app when "
@"vmem > %d MB. Currently at %d MB", vMemSizeLimit, [[NSProcessInfo processInfo] virtualMemorySize]/1048576];
@"vmem > %d MB", vMemSizeLimit];
/* SoClass security declarations */
sInfo = [self soClassSecurityInfo];
@@ -146,9 +145,7 @@ static BOOL debugLeaks;
[$(@"SOGoFolder") soClass];
/* load products */
[[SOGoProductLoader productLoader] loadAllProducts: YES];
if (vMemSizeLimit > 0)
[self logWithFormat: @"All products loaded - current memory usage at %d MB", [[NSProcessInfo processInfo] virtualMemorySize]/1048576];
[[SOGoProductLoader productLoader] loadAllProducts];
}
- (id) init
@@ -372,12 +369,8 @@ static BOOL debugLeaks;
"GET" if no method was provided in the query path.
*/
if ([_key length] > 0 && ![_key isEqualToString:@"favicon.ico"])
{
obj = [self lookupUser: _key inContext: _ctx];
if (!obj && ![_key isEqualToString: @"public"])
obj = [self lookupUser: @"anonymous" inContext: _ctx];
}
}
obj = [self lookupUser: _key inContext: _ctx];
}
}
else
obj = nil;
@@ -403,12 +396,8 @@ static BOOL debugLeaks;
- (WOResponse *) handleException: (NSException *) _exc
inContext: (WOContext *) _ctx
{
WOResponse *resp;
NSLog(@"EXCEPTION: %s\n", [[_exc description] cString]);
resp = [WOResponse responseWithRequest: [_ctx request]];
[resp setStatus: 501];
return resp;
printf("EXCEPTION: %s\n", [[_exc description] cString]);
abort();
}
/* runtime maintenance */
@@ -436,12 +425,8 @@ static BOOL debugLeaks;
{
static NSArray *runLoopModes = nil;
static BOOL debugOn = NO;
SOGoSystemDefaults *sd;
WOResponse *resp;
NSDate *startDate;
NSString *path;
NSTimeInterval timeDelta;
if (debugRequests)
@@ -451,7 +436,6 @@ static BOOL debugLeaks;
startDate = [NSDate date];
}
sd = [SOGoSystemDefaults sharedSystemDefaults];
cache = [SOGoCache sharedCache];
#ifdef GNUSTEP_BASE_LIBRARY
if (debugLeaks)
@@ -466,64 +450,6 @@ static BOOL debugLeaks;
}
#endif
// We check for rate-limiting settings - ignore anything actually
// sent to /SOGo/ (so unauthenticated requests).
path = [_request requestHandlerPath];
if ([path length] && [sd maximumRequestCount] > 0)
{
NSDictionary *requestCount;
NSString *username;
NSRange r;
r = [path rangeOfString: @"/"];
// We handle /sogo1/Calendar/.../ and "sogo1" as paths
if (r.length)
username = [path substringWithRange: NSMakeRange(0, r.location)];
else
username = path;
requestCount = [cache requestCountForLogin: username];
if (requestCount)
{
unsigned int current_time, start_time, delta, block_time, request_count;
current_time = [[NSCalendarDate date] timeIntervalSince1970];
start_time = [[requestCount objectForKey: @"InitialDate"] unsignedIntValue];
delta = current_time - start_time;
block_time = [sd requestBlockInterval];
request_count = [[requestCount objectForKey: @"RequestCount"] intValue];
if ( request_count >= [sd maximumRequestCount] &&
delta < [sd maximumRequestInterval] &&
delta <= block_time )
{
resp = [WOResponse responseWithRequest: _request];
[resp setStatus: 429];
return resp;
}
if (delta > block_time)
{
[cache setRequestCount: 1
forLogin: username
interval: current_time];
}
else
[cache setRequestCount: (request_count+1)
forLogin: username
interval: start_time];
}
else
{
[cache setRequestCount: 1
forLogin: username
interval: 0];
}
}
resp = [super dispatchRequest: _request];
[cache killCache];
+1865
View File
File diff suppressed because it is too large. Load diff
+674
View File
@@ -0,0 +1,674 @@
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
@@ -0,0 +1,34 @@
/* 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
@@ -0,0 +1,214 @@
/* 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
+196
View File
@@ -0,0 +1,196 @@
# 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 \
\
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
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
@@ -0,0 +1,8 @@
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
@@ -0,0 +1,44 @@
/* 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
@@ -0,0 +1,101 @@
/* 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
@@ -0,0 +1,47 @@
/* 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
@@ -0,0 +1,198 @@
/* 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
+174
View File
@@ -0,0 +1,174 @@
/* 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 <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;
NSTimeZone *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
inTimeZone: (NSTimeZone *) newTimeZone
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo;
- (id) initWithICalEvent: (iCalEvent *) newEvent
andUser: (SOGoUser *) newUser
andSenderEmail: (NSString *) newSenderEmail
inTimeZone: (NSTimeZone *) newTimeZone
withConnectionInfo: (struct mapistore_connection_info *) newConnInfo;
/* getters */
- (void) fillMessageData: (struct mapistore_message *) dataPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSenderEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByAddressType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByEmailAddress: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagReceivedByEntryId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagOwnerAppointmentId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidMeetingType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagStartDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentSequence: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentStateFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidResponseStatus: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentStartWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidCommonStart: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagEndDate: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentEndWhole: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidCommonEnd: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentDuration: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentSubType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidBusyStatus: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidIndentedBusyStatus: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagNormalizedSubject: (void **) data // SUMMARY
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidLocation: (void **) data // LOCATION
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidPrivate: (void **) data // private (bool), should depend on CLASS and permissions
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagSensitivity: (void **) data // not implemented, depends on CLASS
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagImportance: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidIsRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidRecurring: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentRecur: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidCleanGlobalObjectId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidServerProcessed: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidServerProcessingActions: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidAppointmentReplyTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
/* reminders */
- (int) getPidLidReminderSet: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderDelta: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderSignalTime: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderOverride: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderPlaySound: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) getPidLidReminderFileParameter: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx;
@end
#endif /* MAPISTORECALENDARWRAPPER_H */
File diff suppressed because it is too large. Load diff
+59
View File
@@ -0,0 +1,59 @@
/* 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;
- (int) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMID: (uint64_t *) mid
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) createEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx;
/* 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
@@ -0,0 +1,194 @@
/* 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;
}
- (int) getPidTagMid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongLongValue (memCtx, [container objectId]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, aid);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagRenderingPosition: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0xffffffff);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) openEmbeddedMessage: (MAPIStoreEmbeddedMessage **) messagePtr
withMID: (uint64_t *) mid
withMAPIStoreMsg: (struct mapistore_message **) mapistoreMsgPtr
inMemCtx: (TALLOC_CTX *) memCtx
{
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);
}
- (int) 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
+31
View File
@@ -0,0 +1,31 @@
/* 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 */
+73
View File
@@ -0,0 +1,73 @@
/* 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
+51
View File
@@ -0,0 +1,51 @@
/* 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;
@end
#endif /* MAPISTOREAUTHENTICATOR_H */
+75
View File
@@ -0,0 +1,75 @@
/* 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;
}
@end
+43
View File
@@ -0,0 +1,43 @@
/* MAPIStoreCalendarAttachment.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 MAPISTORECALENDARATTACHMENT_H
#define MAPISTORECALENDARATTACHMENT_H
#import "MAPIStoreAttachment.h"
@class NSTimeZone;
@class iCalEvent;
@interface MAPIStoreCalendarAttachment : MAPIStoreAttachment
{
iCalEvent *event;
NSTimeZone *timeZone;
}
- (void) setEvent: (iCalEvent *) newEvent;
- (iCalEvent *) event;
@end
#endif /* MAPISTORECALENDARATTACHMENT_H */
+255
View File
@@ -0,0 +1,255 @@
/* 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: @""];
}
- (int) getPidTagAttachmentHidden: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getYes: data inMemCtx: localMemCtx];
}
- (int) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = MAPILongValue (localMemCtx, 0x00000002); /* afException */
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getLongZero: data inMemCtx: localMemCtx];
}
- (int) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
return [self getLongZero: data inMemCtx: localMemCtx];
}
- (int) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = MAPILongValue (localMemCtx, afEmbeddedMessage);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachEncoding: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = [[NSData data] asBinaryInMemCtx: localMemCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) localMemCtx
{
*data = [@"Untitled" asUnicodeInMemCtx: localMemCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) 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;
}
- (int) 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;
}
- (int) 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
+32
View File
@@ -0,0 +1,32 @@
/* 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 */
+64
View File
@@ -0,0 +1,64 @@
/* 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
@@ -0,0 +1,34 @@
/* 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 */
@@ -0,0 +1,215 @@
/* 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
inTimeZone: [userContext timeZone]
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;
}
- (int) getPidTagMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = talloc_strdup (memCtx, "IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}");
return MAPISTORE_SUCCESS;
}
- (int) getPidTagMessageFlags: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, MSGFLAG_UNMODIFIED);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagProcessed: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagResponseRequested: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
/* discarded properties */
- (int) getPidLidAppointmentLastSequence: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidMeetingWorkspaceUrl: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidContacts: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagSensitivity: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidLidPrivate: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidNameKeywords: (void **)
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) 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
inMemCtx: memCtx];
}
@end
+32
View File
@@ -0,0 +1,32 @@
/* 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 "MAPIStoreGCSFolder.h"
@interface MAPIStoreCalendarFolder : MAPIStoreGCSFolder
@end
#endif /* MAPISTORECALENDARFOLDER_H */
+201
View File
@@ -0,0 +1,201 @@
/* 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
{
NSMutableArray *roles;
roles = [NSMutableArray arrayWithCapacity: 6];
if (rights & RightsCreateItems)
[roles addObject: SOGoRole_ObjectCreator];
if (rights & RightsDeleteAll)
[roles addObject: SOGoRole_ObjectEraser];
if (rights & RightsEditAll)
{
[roles addObject: SOGoCalendarRole_PublicModifier];
[roles addObject: SOGoCalendarRole_PrivateModifier];
[roles addObject: SOGoCalendarRole_ConfidentialModifier];
}
else 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];
}
// [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;
if ([roles containsObject: SOGoCalendarRole_PublicModifier]
&& [roles containsObject: SOGoCalendarRole_PrivateModifier]
&& [roles containsObject: SOGoCalendarRole_ConfidentialModifier])
rights |= RightsReadItems | RightsEditAll;
else if ([roles containsObject: SOGoCalendarRole_PublicViewer]
&& [roles containsObject: SOGoCalendarRole_PrivateViewer]
&& [roles containsObject: SOGoCalendarRole_ConfidentialViewer])
// We have to set by hand other rights as only the highest role is returned
// See SOGoAppointmentFolder.m:aclsForUser for details
rights |= RightsReadItems | RightsFreeBusySimple | RightsFreeBusyDetailed;
if ([roles containsObject: SOGoCalendarRole_PublicDAndTViewer])
rights |= RightsFreeBusySimple;
if ([roles containsObject: SOGoCalendarRole_ConfidentialDAndTViewer])
rights |= RightsFreeBusyDetailed;
if (rights != 0)
rights |= RoleNone; /* actually "folder visible" */
// [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]];
}
- (int) getPidTagContainerClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPF.Appointment" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Appointment" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
@end
+40
View File
@@ -0,0 +1,40 @@
/* MAPIStoreCalendarMessage.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 MAPISTORECALENDARMESSAGE_H
#define MAPISTORECALENDARMESSAGE_H
#import "MAPIStoreGCSMessage.h"
@class iCalCalendar;
@class iCalEvent;
@class MAPIStoreAppointmentWrapper;
@interface MAPIStoreCalendarMessage : MAPIStoreGCSMessage
{
iCalCalendar *calendar;
iCalEvent *masterEvent;
}
@end
#endif /* MAPISTORECALENDARMESSAGE_H */
+679
View File
@@ -0,0 +1,679 @@
/* 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
inTimeZone: [userContext timeZone]
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 */
- (int) 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;
}
- (int) getPidLidSideEffects: (void **) data // TODO
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx,
seOpenToDelete | seOpenToCopy | seOpenToMove
| seCoerceToInbox | seOpenForCtxMenu);
return MAPISTORE_SUCCESS;
}
- (int) 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;
}
- (int) 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).
*/
- (int) 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;
}
- (int) 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];
}
- (int) 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);
}
- (BOOL) subscriberCanReadMessage
{
NSArray *roles;
roles = [self activeUserRoles];
return ([roles containsObject: SOGoCalendarRole_ComponentViewer]
|| [roles containsObject: SOGoCalendarRole_ComponentDAndTViewer]
|| [self subscriberCanModifyMessage]);
}
- (BOOL) subscriberCanModifyMessage
{
BOOL rc;
NSArray *roles = [self activeUserRoles];
if (isNew)
rc = [roles containsObject: SOGoRole_ObjectCreator];
else
rc = ([roles containsObject: SOGoCalendarRole_ComponentModifier]
|| [roles containsObject: SOGoCalendarRole_ComponentResponder]);
return rc;
}
- (void) _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
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;
}
- (int) setReadFlag: (uint8_t) flag
{
return MAPISTORE_SUCCESS;
}
@end
@@ -0,0 +1,32 @@
/* 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 */
+193
View File
@@ -0,0 +1,193 @@
/* 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
+41
View File
@@ -0,0 +1,41 @@
/* 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 */
+197
View File
@@ -0,0 +1,197 @@
/* 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];
}
- (int) getPidTagAttachEncoding: (void **) data inMemCtx: (TALLOC_CTX *) memCtx;
{
*data = [[NSData data] asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagAttachmentFlags: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagAttachmentHidden: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getNo: data inMemCtx: memCtx];
}
- (int) getPidTagAttachmentLinkId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
- (int) getPidTagAttachMethod: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPILongValue (memCtx, 0x00000001);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachmentContactPhoto: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getYes: data inMemCtx: memCtx];
}
- (int) getPidTagAttachDataBinary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!photoData)
ASSIGN (photoData,
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
*data = [photoData asBinaryInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachSize: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
if (!photoData)
ASSIGN (photoData,
[[photo flattenedValuesForKey: @""] dataByDecodingBase64]);
*data = MAPILongValue (memCtx, [photoData length]);
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachExtension: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [[self fileExtension] asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachLongFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSString *filename;
filename = [NSString stringWithFormat: @"ContactPhoto%@",
[self fileExtension]];
*data = [filename asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
- (int) getPidTagAttachFilename: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagAttachLongFilename: data
inMemCtx: memCtx];
}
- (int) getPidTagDisplayName: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getPidTagAttachLongFilename: data inMemCtx: memCtx];
}
@end
+32
View File
@@ -0,0 +1,32 @@
/* 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 */
+59
View File
@@ -0,0 +1,59 @@
/* 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
+32
View File
@@ -0,0 +1,32 @@
/* 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 */
+128
View File
@@ -0,0 +1,128 @@
/* 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
{
NSMutableArray *roles;
roles = [NSMutableArray arrayWithCapacity: 6];
if (rights & RightsCreateItems)
[roles addObject: SOGoRole_ObjectCreator];
if (rights & RightsDeleteAll)
[roles addObject: SOGoRole_ObjectEraser];
if (rights & RightsEditAll)
[roles addObject: SOGoRole_ObjectEditor];
if (rights & RightsReadItems)
[roles addObject: SOGoRole_ObjectViewer];
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;
if ([roles containsObject: SOGoRole_ObjectEditor])
rights |= RightsEditAll;
if ([roles containsObject: SOGoRole_ObjectViewer])
rights |= RightsReadItems;
if (rights != 0)
rights |= RoleNone; /* actually "folder visible" */
return rights;
}
- (BOOL) subscriberCanModifyMessages
{
return [[self activeUserRoles] containsObject: SOGoRole_ObjectEditor];
}
- (BOOL) subscriberCanReadMessages
{
return [[self activeUserRoles] containsObject: SOGoRole_ObjectViewer];
}
- (int) getPidTagDefaultPostMessageClass: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Contact" asUnicodeInMemCtx: memCtx];
return MAPISTORE_SUCCESS;
}
@end
+35
View File
@@ -0,0 +1,35 @@
/* MAPIStoreContactsMessage.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 MAPISTORECONTACTSMESSAGE_H
#define MAPISTORECONTACTSMESSAGE_H
#import "MAPIStoreGCSMessage.h"
@interface MAPIStoreContactsMessage : MAPIStoreGCSMessage
{
BOOL fetchedAttachments;
}
@end
#endif /* MAPISTORECONTACTSMESSAGE_H */
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,31 @@
/* 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 */
+231
View File
@@ -0,0 +1,231 @@
/* 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
@@ -0,0 +1,125 @@
/* 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;
+ (int) 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 */
- (int) getPath: (char **) path
ofFMID: (uint64_t) fmid
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) 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 */
+611
View File
@@ -0,0 +1,611 @@
/* 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;
}
+ (int) openContext: (MAPIStoreContext **) contextPtr
withURI: (const char *) newUri
connectionInfo: (struct mapistore_connection_info *) newConnInfo
andTDBIndexing: (struct indexing_context *) indexing
{
MAPIStoreContext *context;
Class contextClass;
NSString *module;
NSURL *baseURL;
int rc = MAPISTORE_ERR_NOT_FOUND;
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;
}
- (int) getPath: (char **) path
ofFMID: (uint64_t) fmid
inMemCtx: (TALLOC_CTX *) memCtx
{
int 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
{
}
- (int) 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];
*folderPtr = baseFolder;
rc = MAPISTORE_SUCCESS;
}
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)
{
[self logWithFormat: @"No id exist yet for '%@', requesting one", childURL];
ret = mapistore_indexing_get_new_folderID (connInfo->mstore_ctx, &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;
}
- (uint64_t) getNewChangeNumber
{
uint64_t newVersionNumber;
if (openchangedb_get_new_changeNumber (connInfo->oc_ctx, connInfo->username, &newVersionNumber)
!= MAPI_E_SUCCESS)
abort ();
return newVersionNumber;
}
- (NSArray *) getNewChangeNumbers: (uint64_t) max
{
TALLOC_CTX *memCtx;
NSMutableArray *newChangeNumbers;
uint64_t count;
struct UI8Array_r *numbers;
NSString *newNumber;
memCtx = talloc_zero(NULL, TALLOC_CTX);
newChangeNumbers = [NSMutableArray arrayWithCapacity: max];
if (openchangedb_get_new_changeNumbers (connInfo->oc_ctx,
memCtx, connInfo->username, max, &numbers)
!= MAPI_E_SUCCESS || numbers->cValues != max)
abort ();
for (count = 0; count < max; count++)
{
newNumber
= [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
[newChangeNumbers addObject: newNumber];
}
talloc_free (memCtx);
return newChangeNumbers;
}
- (NSArray *) getNewFMIDs: (uint64_t) max
{
TALLOC_CTX *memCtx;
NSMutableArray *newFMIDs;
uint64_t count;
struct UI8Array_r *numbers;
NSString *newNumber;
memCtx = talloc_zero(NULL, TALLOC_CTX);
newFMIDs = [NSMutableArray arrayWithCapacity: max];
if (mapistore_indexing_get_new_folderIDs (connInfo->mstore_ctx,
memCtx, max, &numbers)
!= MAPISTORE_SUCCESS || numbers->cValues != max)
abort ();
for (count = 0; count < max; count++)
{
newNumber = [NSString stringWithUnsignedLongLong: numbers->lpui8[count]];
[newFMIDs addObject: newNumber];
}
talloc_free (memCtx);
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
@@ -0,0 +1,32 @@
/* 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
@@ -0,0 +1,114 @@
/* 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
+33
View File
@@ -0,0 +1,33 @@
/* 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"
@interface MAPIStoreDBFolder : MAPIStoreFolder
@end
#endif /* MAPISTOREDBFOLDER_H */
+394
View File
@@ -0,0 +1,394 @@
/* 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;
static NSString *MAPIStoreRightReadItems = @"RightsReadItems";
static NSString *MAPIStoreRightCreateItems = @"RightsCreateItems";
static NSString *MAPIStoreRightEditOwn = @"RightsEditOwn";
static NSString *MAPIStoreRightEditAll = @"RightsEditAll";
static NSString *MAPIStoreRightDeleteOwn = @"RightsDeleteOwn";
static NSString *MAPIStoreRightDeleteAll = @"RightsDeleteAll";
static NSString *MAPIStoreRightCreateSubfolders = @"RightsCreateSubfolders";
static NSString *MAPIStoreRightFolderOwner = @"RightsFolderOwner";
static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
@implementation MAPIStoreDBFolder
+ (void) initialize
{
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: 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;
if ([roles containsObject: MAPIStoreRightDeleteAll])
rights |= RightsDeleteAll;
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]
|| [self _testRoleForActiveUser: MAPIStoreRightEditOwn]);
}
- (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]
|| [self _testRoleForActiveUser: MAPIStoreRightDeleteOwn]);
}
- (BOOL) subscriberCanCreateSubFolders
{
return [self _testRoleForActiveUser: MAPIStoreRightCreateSubfolders];
}
- (BOOL) supportsSubFolders
{
return YES;
}
@end
+31
View File
@@ -0,0 +1,31 @@
/* 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
@@ -0,0 +1,36 @@
/* 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
@@ -0,0 +1,31 @@
/* 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 */
+212
View File
@@ -0,0 +1,212 @@
/* 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/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
#import <NGExtensions/NSObject+Logs.h>
#import "MAPIStoreContext.h"
#import "MAPIStorePropertySelectors.h"
#import "SOGoMAPIDBMessage.h"
#import "MAPIStoreDBFolder.h"
#import "MAPIStoreDBMessage.h"
#import "MAPIStoreTypes.h"
#import "NSObject+MAPIStore.h"
#import "NSString+MAPIStore.h"
#undef DEBUG
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_errors.h>
@implementation MAPIStoreDBMessage
+ (int) getAvailableProperties: (struct SPropTagArray **) propertiesP
inMemCtx: (TALLOC_CTX *) memCtx
{
struct SPropTagArray *properties;
NSUInteger count;
enum MAPITAGS faiProperties[] = { 0x68350102, 0x683c0102, 0x683e0102,
0x683f0102, 0x68410003, 0x68420102,
0x68450102, 0x68460003,
// PR_VD_NAME_W, PR_VD_FLAGS, PR_VD_VERSION, PR_VIEW_CLSID
0x7006001F, 0x70030003, 0x70070003, 0x68330048 };
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;
}
- (id) initWithSOGoObject: (id) newSOGoObject
inContainer: (MAPIStoreObject *) newContainer
{
if ((self = [super initWithSOGoObject: newSOGoObject
inContainer: newContainer]))
{
[properties release];
properties = [newSOGoObject properties];
[properties retain];
}
return self;
}
- (uint64_t) objectVersion
{
NSNumber *versionNbr;
uint64_t objectVersion;
[(SOGoMAPIDBMessage *) sogoObject reloadIfNeeded];
versionNbr = [properties objectForKey: @"version"];
if (versionNbr)
objectVersion = (([versionNbr unsignedLongLongValue] >> 16)
& 0x0000ffffffffffffLL);
else
objectVersion = ULLONG_MAX;
return objectVersion;
}
//
// FIXME: how this can happen?
//
// We might get there if for some reasons, all classes weren't able
// to tell us the message class.
//
- (int) getPidTagMessageClass: (void **) data inMemCtx: (TALLOC_CTX *) memCtx
{
*data = [@"IPM.Note" asUnicodeInMemCtx: memCtx];
[self logWithFormat: @"METHOD '%s' - unable to determine message class. Falling back to IPM.Note", __FUNCTION__];
return MAPISTORE_SUCCESS;
}
- (int) 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];
}
- (int) getProperty: (void **) data
withTag: (enum MAPITAGS) propTag
inMemCtx: (TALLOC_CTX *) memCtx
{
id value;
int 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];
[properties setObject: [NSNumber numberWithUnsignedLongLong: newVersion]
forKey: @"version"];
[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"];
}
/* TODO: differentiate between the "Own" and "All" cases */
- (BOOL) subscriberCanReadMessage
{
return [(MAPIStoreFolder *) container subscriberCanReadMessages];
// || [self _messageIsFreeBusy]);
}
- (BOOL) subscriberCanModifyMessage
{
return ((isNew
&& [(MAPIStoreFolder *) container subscriberCanCreateMessages])
|| (!isNew
&& [(MAPIStoreFolder *) container subscriberCanModifyMessages]));
// || [self _messageIsFreeBusy]);
}
- (NSDate *) creationTime
{
return [sogoObject creationDate];
}
- (NSDate *) lastModificationTime
{
return [sogoObject lastModified];
}
@end
+31
View File
@@ -0,0 +1,31 @@
/* 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 */
+132
View File
@@ -0,0 +1,132 @@
/* 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)
{
value = NSObjectFromMAPISPropValue (&res->lpProp);
cVersion = exchange_globcnt (([value unsignedLongLongValue] >> 16)
& 0x0000ffffffffffffLL);
version = [NSNumber numberWithUnsignedLongLong: cVersion];
//[self logWithFormat: @"change number from oxcfxics: %.16lx", [value unsignedLongLongValue]];
[self logWithFormat: @" version: %.16lx", cVersion];
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: @"version"
operatorSelector: EOQualifierOperatorGreaterThanOrEqualTo
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
+33
View File
@@ -0,0 +1,33 @@
/* MAPIStoreEmbeddedMessage.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 MAPISTOREEMBEDDEDMESSAGE_H
#define MAPISTOREEMBEDDEDMESSAGE_H
#import "MAPIStoreMessage.h"
@interface MAPIStoreEmbeddedMessage : MAPIStoreMessage
@end
#endif /* MAPISTOREEMBEDDEDMESSAGE_H */
+154
View File
@@ -0,0 +1,154 @@
/* 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];
}
- (int) getPidTagAccessLevel: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return [self getLongZero: data inMemCtx: memCtx];
}
/* disabled properties */
- (int) getPidTagFolderId: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagChangeKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagParentSourceKey: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagChangeNumber: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagInstID: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagInstanceNum: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagRowType: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagDepth: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagIconIndex: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) getPidTagGenerateExchangeViews: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
return MAPISTORE_ERR_NOT_FOUND;
}
- (int) 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
@@ -0,0 +1,31 @@
/* 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 */
+80
View File
@@ -0,0 +1,80 @@
/* 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 "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];
}
- (int) 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 NO;
}
- (BOOL) subscriberCanModifyMessage
{
return NO;
}
@end
+31
View File
@@ -0,0 +1,31 @@
/* 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
@@ -0,0 +1,101 @@
/* 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
+32
View File
@@ -0,0 +1,32 @@
/* 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
@@ -0,0 +1,112 @@
/* 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
+191
View File
@@ -0,0 +1,191 @@
/* 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>
@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"
@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;
/* 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 */
- (int) openFolder: (MAPIStoreFolder **) childFolderPtr
withFID: (uint64_t) fid;
- (int) createFolder: (MAPIStoreFolder **) childFolderPtr
withRow: (struct SRow *) aRow
andFID: (uint64_t) fid;
- (int) deleteFolder;
- (int) getChildCount: (uint32_t *) rowCount
ofTableType: (enum mapistore_table_type) tableType;
- (int) createMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
isAssociated: (BOOL) isAssociated;
- (int) openMessage: (MAPIStoreMessage **) messagePtr
withMID: (uint64_t) mid
forWriting: (BOOL) readWrite
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) deleteMessageWithMID: (uint64_t) mid
andFlags: (uint8_t) flags;
- (int) moveCopyMessagesWithMIDs: (uint64_t *) srcMids
andCount: (uint32_t) count
fromFolder: (MAPIStoreFolder *) sourceFolder
withMIDs: (uint64_t *) targetMids
andChangeKeys: (struct Binary_r **) targetChangeKeys
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;
- (int) getDeletedFMIDs: (struct UI8Array_r **) fmidsPtr
andCN: (uint64_t *) cnPtr
fromChangeNumber: (uint64_t) changeNum
inTableType: (enum mapistore_table_type) tableType
inMemCtx: (TALLOC_CTX *) mem_ctx;
- (int) getTable: (MAPIStoreTable **) tablePtr
andRowCount: (uint32_t *) count
tableType: (enum mapistore_table_type) tableType
andHandleId: (uint32_t) handleId;
- (int) modifyPermissions: (struct PermissionData *) permissions
withCount: (uint16_t) pcount
andFlags: (int8_t) flags;
- (enum mapistore_error) 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
@@ -0,0 +1,31 @@
/* 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
@@ -0,0 +1,118 @@
/* 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
+37
View File
@@ -0,0 +1,37 @@
/* 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 */
Loaded 100 of 2377 files, more files were not shown because too many files have changed in this diff. Show more