Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117912777
D4406.1775400480.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D4406.1775400480.diff
View Options
diff --git a/lib/kolab_sync_data_email.php b/lib/kolab_sync_data_email.php
--- a/lib/kolab_sync_data_email.php
+++ b/lib/kolab_sync_data_email.php
@@ -602,30 +602,34 @@
*/
public function updateEntry($folderId, $serverId, Syncroton_Model_IEntry $entry)
{
- $msg = $this->parseMessageId($serverId);
- $message = $this->getObject($serverId);
+ $msg = $this->parseMessageId($serverId);
- if (empty($message)) {
+ if (empty($msg)) {
throw new Syncroton_Exception_Status_Sync(Syncroton_Exception_Status_Sync::SYNC_SERVER_ERROR);
}
- $is_flagged = !empty($message->headers->flags['FLAGGED']);
+ if (isset($entry->categories)) {
+ // Read the message headers only when they are needed
+ $message = $this->getObject($serverId);
+
+ if (empty($message)) {
+ throw new Syncroton_Exception_Status_Sync(Syncroton_Exception_Status_Sync::SYNC_SERVER_ERROR);
+ }
+ }
// Read status change
if (isset($entry->read)) {
// here we update only Read flag
- $flag = (((int)$entry->read != 1) ? 'UN' : '') . 'SEEN';
+ $flag = !empty($entry->read) ? 'SEEN' : 'UNSEEN';
$this->storage->set_flag($msg['uid'], $flag, $msg['foldername']);
}
// Flag change
- if (isset($entry->flag) && (empty($entry->flag) || empty($entry->flag->flagType))) {
- if ($is_flagged) {
+ if (isset($entry->flag)) {
+ if (empty($entry->flag) || empty($entry->flag->flagType)) {
$this->storage->set_flag($msg['uid'], 'UNFLAGGED', $msg['foldername']);
}
- }
- else if (!$is_flagged && !empty($entry->flag)) {
- if ($entry->flag->flagType && preg_match('/follow\s*up/i', $entry->flag->flagType)) {
+ else if (preg_match('/follow\s*up/i', $entry->flag->flagType)) {
$this->storage->set_flag($msg['uid'], 'FLAGGED', $msg['foldername']);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 5, 2:48 PM (2 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18820467
Default Alt Text
D4406.1775400480.diff (2 KB)
Attached To
Mode
D4406: Improve performance of changing mail message flag
Attached
Detach File
Event Timeline