Commit graph

1194 commits

Author SHA1 Message Date
Javier Amor García a0b15d0c8c Test for [RTFHandler parseFontTable]
This changeset includes changes in relevant classes to make
them easier to test.
2015-12-09 20:02:55 +01:00
Enrique J. Hernández f6973d8aa4 Merge pull request #209 from zentyal/jag/rtf-parser-fix-unicode
RTFHandler fixes with focus in unicode and characters set
2015-11-30 12:20:04 +01:00
Javier Amor García 94d4da6e1e Reimplemented [RTFHandler parse] to have an unambiguous decoding of control words
[RTFHandler parseFontTable] reimplemented on the same line.
2015-11-27 17:49:01 +01:00
Javier Amor García 2f63542e07 Fixed problem with ascii chars that had different unicode value
Also cleaned a bit the parse loop
2015-11-27 17:49:01 +01:00
Javier Amor García 3155bd0172 Fixed bug which created unnecesary font tags 2015-11-27 17:34:08 +01:00
Javier Amor García 2518b37e32 Fixed RTF support for unicode characters greater than 32767 2015-11-27 17:34:08 +01:00
Javier Amor García 8e3e4a5445 Added RTF escapes parsing 2015-11-27 17:34:07 +01:00
Javier Amor García 01dcf3d6c8 Fixed activation of characters sets in [RTFHandler parse] 2015-11-27 17:34:07 +01:00
Javier Amor García fa4d3a0e20 Reimplementation of [RTFHandler parseFontTable] 2015-11-27 17:34:06 +01:00
Jesús García Sáez e8e610c7b3 Merge pull request #212 from zentyal/safe-ldb-search
Adapt to new safe_ldb_search function
2015-11-25 12:12:28 +01:00
Carlos Pérez-Aradros Herce 9554e92c8b Adapt to new safe_ldb_search function 2015-11-23 17:01:35 +01:00
Enrique J. Hernández f64b324133 Merge pull request #203 from inverse-inc/v2
Merge from upstream
2015-11-23 12:51:52 +01:00
extrafu 19676593ea (fix) allow getting password from context for OC 2015-11-19 17:57:04 -05:00
Enrique J. Hernández 0622980f38 Merge pull request #205 from zentyal/jag/dont-sync-contact-group-from-sogo
Do not save IPM.DistList messages
2015-11-19 10:39:59 +01:00
Javier Amor García a73df96b78 [MAPIStoreGCSMessage getPidTagChangeKey:inMemCtx:] return on error
This method aborted when no PidTagChangeKey was found and the new flag was not
set. Now it returns MAPISTORE_ERR_NOT_FOUND.
2015-11-18 18:25:24 +01:00
Enrique J. Hernández 9dcf459827 Merge pull request #207 from zentyal/jag/idl-compile-warnings
sogo-openchange: Avoid compile warnings after changes in exchange.idl
2015-11-18 14:47:36 +01:00
Enrique J. Hernández 4c7bd6dd76 Merge pull request #208 from zentyal/jgarcia/wocontext-fun
User context activation when cached
2015-11-18 06:56:16 +01:00
Javier Amor García 88a74bcb5c Do not save IPM.DistList messages 2015-11-16 13:56:31 +01:00
Enrique J. Hernández 0751c51b89 Merge pull request #204 from zentyal/jvalles/event-invitation-subjects
oc-calendar: Make invitation/update mails have the event name as subject
2015-11-09 23:35:22 +01:00
Jesús García Sáez 5f5b5d9273 oc: activate user context on initialization (for real)
Even with cached ones (completes cfab18e1b8)
2015-11-09 19:56:05 +01:00
Javier Amor García 08f05ac2ef sogo-openchange: Avoid compile warnings after changes in exchange.idl
The changes in the exchange.idl file from OpenChange has changed
some string pointers from 'const char *' to 'uint8_t *'.
This changeset cast them to avoid compilation warnings.
2015-11-09 19:08:51 +01:00
Juan Vallés 946665ff49 oc-calendar: Make invitation/update mails have the event name as subject
SOGo event notification mails add information to the event name in their
subject (e.g. _Event invitation: "foo"_). The client uses the mail
subject to create a copy of the event on the attendee's calendar, so we
need to strip out that extra information if we want the event to have
the proper name.
2015-11-09 10:28:46 +01:00
Enrique J. Hernández Blasco e0d49d2407 oc-mail: Check the number of uids fetched on synchroniseCache
Equals to the number of uids requested.

There are corner-cases when this is not happening, we don't know yet
why this is happening but IMAP server log should do the trick.

This avoids to launch a NSException trying to access an element
outside the array bounds.
2015-10-29 23:04:42 +01:00
Jesús García Sáez c8d05d41a5 Merge pull request #201 from zentyal/ejhernandez/sync-expunged-msgs-first-sync
oc-mail: Sync expunged messages on first cache sync
2015-10-26 19:37:01 +01:00
Jesús García Sáez 2937ba7f30 Merge pull request #200 from zentyal/ejhernandez/always-increase-cn-set-message-read-flag
oc-mail: Always increase the CN when setting the message read flag
2015-10-26 14:38:29 +01:00
Enrique J. Hernández Blasco 6f5bb3882c oc-mail: Sync expunged messages on first cache sync
There is a use case where this has caused crashes:

A message was hard-deleted using an IMAP client, this is the first
message you deleted in that folder and you have cleared offline
items in the client so a full sync is asked by upper layer.

In that situation, the SyncLastDeleteChangeNumber version property
is not set and return 0 in [getDeletedKeysFromChangeNumber:andCN:inTableType]
making OpenChange to crash while it is asking for deleted fmids
since a given change number.

This is a regression from 18d7070c4a.
2015-10-21 11:24:14 +02:00
Juan Vallés 8800cdf641 oc-calendar: force cache synchronisation for a message before aborting
Sometimes we're trying to get the `objectVersion` of a calendar message,
but this message's entry is not in the cache. The method
`synchroniseCache` won't work in this case, so we try to force the
synchronisation of that particular message in order to get the change
number before aborting.
2015-10-20 11:33:10 +02:00
Enrique J. Hernández Blasco d998786ea6 oc-mail: Always increase the CN when setting the message read flag
And perform the real IMAP operation on save method as described by
[MS-OXCFXICS] and [MS-OXCMSG] Section 2.2.3.3, these operations must be
committed when SaveChangesMessage is called.

As it is expected by Outlook to increase the change number when
performing the `SetMessageReadFlag` ROP, if it is not done, the client
tries indefinitely to store that.
2015-10-20 09:56:11 +02:00
Enrique J. Hernández a8e02b94d4 Merge pull request #193 from zentyal/jag/attach-has-content-id
oc-mail: Fixed false positive in [MAPIStoreAttachment hasContentId]
2015-09-29 19:24:41 +02:00
Javier Amor García c01b21e402 oc-mail: Fixed false positive in [MAPIStoreAttachment hasContentId]
This method does not longer returns true if the content id
was a empty string.
In some case the old false positive triggered the removal of
attachments when sending messages.
2015-09-28 13:06:30 +02:00
Jesús García Sáez bea2415fad Merge pull request #184 from zentyal/jvalles/double-digit-folders
Make folderKey encoding consistent
2015-09-23 18:30:18 +02:00
Enrique J. Hernández Blasco deca6e383a oc: Include 0x683d0040 as another unknown FAI message property
And returning right type.

We have sorted the FAI properties by number and set the available
name as a comment to ease the tracking afterwards.
2015-09-18 21:45:00 +02:00
Enrique J. Hernández Blasco f3ac7b8334 oc: Return FAI available properties on instance method as well
The operation RopFastTransferSourceCopyTo calls the available
properties for a message using the instance method. It seems the
preferred method by Outlook to synchronise a FAI message. OpenChange
calls the message to get the available properties, so the instance
method is called. As it is specialised to return the custom hack
FAI properties, we have to call that class method instead of using
generic one available at NSObject (MAPIStoreProperties) class.

This avoids crashing the Outlook client after we synchronise the
calendar folder after changing the timeframe view (eg from day view
to month view).
2015-09-18 21:40:01 +02:00
Juan Vallés ba68bd8935 Make folderKey encoding consistent
The folder names are encoded through the `asCSSIdentifier` and
`stringByEncodingImap4FolderName` functions when we store them as folder
keys. In addition, the prefix "folder" is added to the key.

The order in which these operations were done when storing the folder
keys (and reverted when retrieving them) wasn't consistent trough the
code. This led to problems such as creating twice a folder with a digit
at the beginning of its name.

The folder name goes now through the following operations when being
stored as a key (the retrieval reverts these in the reverse order):

 * `stringByEncodingImap4FolderName`
 * `asCSSIdentifier`
 * Add "folder" prefix
2015-09-15 09:57:30 +02:00
Enrique J. Hernández Blasco b075a306c6 oc-task: Save tasks from Outlook
It was not working because we try to save as component the
full calendar and its parent was nil. We have to save the calendar
itself to save the task in the personal calendar.
2015-09-10 17:26:41 +02:00
Javier Amor García 1fdb44b0a7 Fix some compilation warnings
The warnings were introduced in the fix for attachment with used
the filename extended parameter.

Also removed trailing whitespaces.
2015-09-08 15:39:59 +02:00
Jesús García Sáez 3868ce0fb1 Merge pull request #169 from zentyal/ejhernandez/increase-cn-setting-seen-flag
oc-mail: Increase Change Number after modifying seen flag
2015-09-07 18:46:18 +02:00
Jesús García Sáez fc82eb79f6 Merge pull request #175 from zentyal/ejhernandez/versions-msg-reload-if-needed
oc: load versionsMessage on setting up
2015-09-07 16:48:55 +02:00
Enrique J. Hernández Blasco 6280e4ded6 oc: Implement setReadFlag for MAPIStoreDBMessage
This is an utility for testing as I don't see any added value
for real scenario but according to [MS-OXCMSG] all messages
can have PidTagMessageFlags.
2015-09-04 16:16:00 +02:00
Enrique J. Hernández Blasco f19074334c oc: Use enum mapistore_error as returned value for setReadFlag 2015-09-04 16:15:05 +02:00
Enrique J. Hernández Blasco b702e40ebb oc: load versionsMessage on setting up
versionsMessage object could have outdated version in a root folder
in the following case:

* Download latest contents using FXBuffer
  * versionsMessage is updated by synchroniseCache
* OpenMessage from last FXBuffer
  * Setup versions message as root folder
* Get Predecessor Change List from that message

We could just reload if needed the versions message if something
is missing but I don't know if that situation fixes more than this
one.
2015-09-03 23:01:21 +02:00
Jesús García Sáez 24e3071e24 Merge pull request #170 from zentyal/jag/attachments-nolatin-filename
sogo-openchange: Support attachments with filename extended parameter
2015-08-26 15:15:15 +02:00
Jesús García Sáez 1f29198495 Merge pull request #172 from zentyal/ejhernandez/save-draft-right-change-key
oc-mail: Return right change key after saving a draft mail
2015-08-26 13:37:42 +02:00
Enrique J. Hernández Blasco 47859b76d6 oc-mail: Return right change key after saving a draft mail
After saving a draft mail (this is done automatically by Outlook)
a GetProps call is done checking the PidTagChangeKey has been
updated properly. Without this patch, it returned MAPI_E_NOT_FOUND.

With this patch, we addressed that problem and we have updated
the Predecessor Change List metadata for the draft mail with the
change key provided by the client to avoid conflicting messages
whenever it is possible.
2015-08-24 23:42:38 +02:00
Enrique J. Hernández Blasco 3a60b6e38e oc-mail: Implement ChangeNumber >= restriction
And warn when other operator than > or >= is used.

This allows OpenChange to query for change numbers starting from
a given point.
2015-08-24 15:39:05 +02:00
Javier Amor García ae3ac0a09a oc-mail: Support attachments with filename extended parameter
The attachments which used a extended parameter for their filename
('filename*=') where silently dropped.
This was because MAPIStore was only looking for no-extended filename
parameter.
The solution is using the 'filename' from the
SOGOExtension of the NSDictionary interface.
2015-08-24 14:19:47 +02:00
Enrique J. Hernández Blasco 27b9b7bfa7 oc-mail: Increase Change Number after modifying seen flag
It is required when you are using SynchronizeImportReadStateChanges ROP
to update the MetaTagCnsetRead meta property.

See [MS-OXCFXICS] Section 3.2.5.9.4.6

This could lead to sync issues.
2015-08-10 18:38:39 +02:00
Enrique J. Hernández Blasco 321672e2c3 oc: Update predecessor change list on saving
There were cases where only the change key was updated (GCS) or
others were the change key was updated with wrong info.

This changeset has as goal to update the predecessor change list
and, change key if required, on saving taking into account the latest information
given by the client in high level ROPs such as ImportMessageMove
or SetProperties, and merge it with information provided by the server
backend (IMAP server, SOGo DB) using `synchroniseCache`.

For more details about `PidTagChangeKey` and `PidTagPredecessorChangeList`
property values check [MS-OXCFXICS] Section 2.2.1.2
2015-08-04 08:41:38 +02:00
Enrique J. Hernández Blasco 8d9b54815c oc: Receive new predecessor change list parameter on move copy op
This is to apply new API introduced by 85e2d7c commit in OpenChange
repository.
2015-08-04 08:41:38 +02:00
Enrique J. Hernández Blasco 1dbfc18379 oc: Update to new XID structure definition
From ede986f commit from OpenChange repository.
2015-08-04 08:41:38 +02:00