Skip to content

Commit

Permalink
Merge branch 'master' into horde_5_2
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Oct 28, 2013
2 parents c081ba0 + ae4ea3a commit 43849e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
10 changes: 6 additions & 4 deletions framework/ActiveSync/lib/Horde/ActiveSync/State/Mongo.php
Expand Up @@ -842,7 +842,7 @@ public function getLastSyncTimestamp($id = null, $user = null)
}

if (empty($results) || empty($results['ok'])) {
throw new Horde_ActiveSync_Exception('Error running aggregation.');
throw new Horde_ActiveSync_Exception(empty($results['errmsg']) ? 'Error running aggregation.' : $results['errmsg']);
}
if (empty($results) || empty($results['ok'])) {
return 0;
Expand Down Expand Up @@ -1237,8 +1237,8 @@ protected function _getPIMChangeTS(array $changes)
foreach ($changes as $change) {
$match['$or'][] = array(
'$and' => array(
'message_uid' => $change['id'],
'sync_deleted' => $change['type'] == Horde_ActiveSync::CHANGE_TYPE_DELETE
array('message_uid' => $change['id']),
array('sync_deleted' => $change['type'] == Horde_ActiveSync::CHANGE_TYPE_DELETE)
)
);
}
Expand All @@ -1257,7 +1257,9 @@ protected function _getPIMChangeTS(array $changes)
throw new Horde_ActiveSync_Exception($e);
}
if (empty($rows) || empty($rows['ok'])) {
throw new Horde_ActiveSync_Exception('Error running aggregation.');
throw new Horde_ActiveSync_Exception(sprintf(
'Error running aggregation: %s',
empty($rows['errmsg']) ? '' : $rows['errmsg']));
}
$results = array();
foreach ($rows as $row) {
Expand Down
21 changes: 13 additions & 8 deletions kronolith/lib/Event.php
Expand Up @@ -1581,19 +1581,24 @@ public function toASAppointment(array $options = array())
// No HTML supported. Always use plaintext.
$note->type = Horde_ActiveSync::BODYPREF_TYPE_PLAIN;
if (isset($bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize'])) {
if (Horde_String::length($this->description) > $bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize']) {
$note->data = Horde_String::substr($this->description, 0, $bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize']);
$note->truncated = 1;
} else {
$note->data = $this->description;
}
$note->estimateddatasize = Horde_String::length($this->description);
$truncation = $bp[Horde_ActiveSync::BODYPREF_TYPE_PLAIN]['truncationsize'];
} elseif (isset($bp[Horde_ActiveSync::BODYPREF_TYPE_HTML])) {
$truncation = $bp[Horde_ActiveSync::BODYPREF_TYPE_HTML]['truncationsize'];
$this->description = Horde_Text_Filter::filter($note->data, 'Text2html', array('parselevel' => Horde_Text_Filter_Text2html::MICRO));
} else {
$truncation = false;
}
if ($truncation && Horde_String::length($this->description) > $truncation) {
$note->data = Horde_String::substr($this->desciption, 0, $truncation);
$note->truncated = 1;
} else {
$note->data = $this->description;
}
$note->estimateddatasize = Horde_String::length($this->description);
$message->airsyncbasebody = $note;
} else {
$message->setBody($this->description);
}

$message->setLocation($this->location);
}

Expand Down

0 comments on commit 43849e2

Please sign in to comment.