Projects
Kolab:16
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 58
View file
kolab-syncroton.spec
Changed
@@ -34,9 +34,10 @@ %endif %global _ap_sysconfdir %{_sysconfdir}/%{httpd_name} +%global upstream_version 2.4.2 Name: kolab-syncroton -Version: 2.4.2 +Version: 2.4.2.2 Release: 1%{?dist} Summary: ActiveSync for Kolab Groupware @@ -44,7 +45,7 @@ License: LGPLv2 URL: http://www.syncroton.org -Source0: %{name}-%{version}.tar.gz +Source0: %{name}-%{upstream_version}.tar.gz Source1: kolab-syncroton.logrotate Source2: plesk.kolab_syncroton.inc.php @@ -82,7 +83,7 @@ and Tasks though this package - based on Syncroton technology. %prep -%setup -q -n %{name}-%{version} +%setup -q -n %{name}-%{upstream_version} #%patch0 -p1 %build
View file
debian.changelog
Changed
@@ -1,4 +1,4 @@ -kolab-syncroton (2.4.2-0~kolab1) unstable; urgency=low +kolab-syncroton (2.4.2.2-0~kolab1) unstable; urgency=low * Release version 2.4.2
View file
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_data_calendar.php
Changed
@@ -116,8 +116,7 @@ const SENSITIVITY_PRIVATE = 2; const SENSITIVITY_CONFIDENTIAL = 3; - const KEY_DTSTAMP = 'x-custom.X-ACTIVESYNC-DTSTAMP'; - const KEY_RESPONSE_DTSTAMP = 'x-custom.X-ACTIVESYNC-RESPONSE-DTSTAMP'; + const KEY_DTSTAMP = 'x-custom.X-ACTIVESYNC-DTSTAMP'; /** * Mapping of attendee status @@ -184,6 +183,7 @@ $event = is_array($serverId) ? $serverId : $this->getObject($collection->collectionId, $serverId); $config = $this->getFolderConfig($event'_mailbox'); $result = array(); + $is_outlook = stripos($this->device->devicetype, 'outlook') !== false; // Kolab Format 3.0 and xCal does support timezone per-date, but ActiveSync allows // only one timezone per-event. We'll use timezone of the start date @@ -231,7 +231,7 @@ break; case 'free_busy': - if (!empty($value)) { + if (!$is_outlook && !empty($value)) { $value = $this->busyStatusMap$value; } break; @@ -314,6 +314,17 @@ if ($email && in_array_nocase($email, $user_emails)) { $user_rsvp = !empty($attendee'rsvp'); $resp_type = $status ?: self::ATTENDEE_STATUS_UNKNOWN; + + // Synchronize the attendee status to the event status to get the same behaviour as outlook. + if ($is_outlook) { + if ($attendee'status' == 'ACCEPTED') { + $result'busyStatus' = self::BUSY_STATUS_BUSY; + } + if ($attendee'status' == 'TENTATIVE') { + $result'busyStatus' = self::BUSY_STATUS_TENTATIVE; + } + } + } $result'attendees' = new Syncroton_Model_EventAttendee($att); @@ -438,6 +449,11 @@ break; case 'free_busy': + // Outlook sets the busy state to the attendance state, and we don't want to change the event state based on that. + // Outlook doesn't have the concept of an event state, so we just ignore this. + if ($is_outlook) { + continue 2; + } $map = array_flip($this->busyStatusMap); $value = isset($map$value) ? $map$value : null; break; @@ -490,10 +506,10 @@ } // Attendees - // Outlook 2013 sends a dummy update just after MeetingResponse has been processed, - // this update resets attendee status set in the MeetingResponse request. - // We ignore changes to attendees data on such updates - if ($is_outlook && $this->isDummyOutlookUpdate($data, $entry, $event)) { + // Whenever Outlook sends dummy timezone it is an event where the user is an attendee. + // In these cases Attendees element is bogus: contains invalid status and does not + // contain all attendees. We have to ignore it. + if ($is_outlook && !$is_exception && $data->timezone === $dummy_tz) { $this->logger->debug('Dummy outlook update detected, ignoring attendee changes.'); $attendees = $entry'attendees'; } @@ -545,6 +561,22 @@ } } + // Outlook does not send the correct attendee status when changing between accepted and tentative, but it toggles the busyStatus. + if ($is_outlook) { + $status = null; + if ($data->busyStatus == self::BUSY_STATUS_BUSY) { + $status = "ACCEPTED"; + } else if ($data->busyStatus == self::BUSY_STATUS_TENTATIVE) { + $status = "TENTATIVE"; + } + + if ($status) { + $this->logger->debug("Updating our attendee status based on the busy status to {$status}."); + $emails = $this->user_emails(); + $this->find_and_update_attendee_status($attendees, $status, $emails); + } + } + if (!$is_exception) { // Make sure the event has the organizer set if (!$organizer_email && ($identity = kolab_sync::get_instance()->user->get_identity())) { @@ -630,10 +662,6 @@ // Update/Save the event if (empty($existing)) { - if ($dtstamp) { - $this->setKolabDataItem($event, self::KEY_RESPONSE_DTSTAMP, $dtstamp); - } - $folder = $this->save_event($event, $status); // Create SyncState for the new event, so it is not synced twice @@ -661,10 +689,6 @@ } } else { - if ($dtstamp) { - $this->setKolabDataItem($existing, self::KEY_RESPONSE_DTSTAMP, $dtstamp); - } - $folder = $this->update_event($event, $existing, $status, $request->instanceId); } @@ -809,25 +833,33 @@ } /** - * Update the attendee status of the user + * Update the attendee status of the user matching $emails */ - protected function update_attendee_status(&$event, $status) + protected function find_and_update_attendee_status(&$attendees, $status, $emails) { - $emails = $this->user_emails(); - - foreach ((array) $event'attendees' as $i => $attendee) { + $found = false; + foreach ((array) $attendees as $i => $attendee) { if (!empty($attendee'email') && (empty($attendee'role') || $attendee'role' != 'ORGANIZER') && in_array_nocase($attendee'email', $emails) ) { - $event'attendees'$i'status' = $status; - $event'attendees'$i'rsvp' = false; - $event_attendee = $attendee; + $attendees$i'status' = $status; + $attendees$i'rsvp' = false; $this->logger->debug('Updating existing attendee: ' . $attendee'email' . ' status: ' . $status); + $found = true; } } + return $found; + } + + /** + * Update the attendee status of the user + */ + protected function update_attendee_status(&$event, $status) + { + $emails = $this->user_emails(); - if (empty($event_attendee)) { + if (!$this->find_and_update_attendee_status($event'attendees', $status, $emails)) { $this->logger->debug('Adding new attendee ' . $emails0 . ' status: ' . $status); // Add the user to the attendees list $event'attendees' = array( @@ -1085,39 +1117,4 @@ return $rec; } - - /** - * Check if the event update request is a fake (for Outlook) - */ - protected function isDummyOutlookUpdate($data, $entry, &$result) - { - $is_dummy = false; - - // Outlook 2013 sends a dummy update just after MeetingResponse has been processed, - // this update resets attendee status set in the MeetingResponse request. - // We ignore attendees data in such updates, they should not happen according to - // https://msdn.microsoft.com/en-us/library/office/hh428685(v=exchg.140).aspx - // but they will contain some data as alarms and free/busy status so we don't - // ignore them completely - if (!empty($entry) && !empty($data->attendees) && stripos($this->device->devicetype, 'outlook') !== false) { - // Some of these requests use just dummy Timezone - $dummy_tz = str_repeat('A', 230) . '=='; - - if ($data->timezone == $dummy_tz) { - $is_dummy = true; - } - - // But some of them do not, so we have check if that is a first - // update immediately (up to 5 seconds) after MeetingResponse request - if (!$is_dummy && ($dtstamp = $this->getKolabDataItem($entry, self::KEY_RESPONSE_DTSTAMP))) { - $dtstamp = new DateTime($dtstamp); - $now = new DateTime('now', new DateTimeZone('UTC')); - $is_dummy = $now->getTimestamp() - $dtstamp->getTimestamp() <= 5; - } - - $this->unsetKolabDataItem($result, self::KEY_RESPONSE_DTSTAMP); - } - - return $is_dummy; - } }
View file
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_data_email.php
Changed
@@ -403,6 +403,7 @@ $meeting'startTime' = $event'start'; $meeting'dtStamp' = $event'created' ?? null; $meeting'endTime' = $event'end' ?? null; + $meeting'location' = $event'location' ?? null; //TODO implement recurrences. We can't detect exceptions like this (don't know how), and the recurrences structure is different from event, //so that also doesn't work like this. @@ -420,15 +421,11 @@ // } $meeting'instanceType' = Syncroton_Model_EmailMeetingRequest::TYPE_NORMAL; - $meeting'location' = $event'location' ?? null; - // Organizer if (!empty($event'attendees')) { foreach ($event'attendees' as $idx => $attendee) { - if ($attendee'role' == 'ORGANIZER') { - if ($email = $attendee'email') { - $meeting'organizer' = $email; - } + if (!empty($attendee'role') && $attendee'role' == 'ORGANIZER' && !empty($attendee'email')) { + $meeting'organizer' = $attendee'email'; break; } } @@ -439,7 +436,7 @@ $meeting'timeZone' = kolab_sync_timezone_converter::encodeTimezoneFromDate($event'start'); $meeting'globalObjId' = self::encodeGlobalObjId('uid' => $event'uid'); - //TODO handle other methods + // TODO handle other methods if ($event'_method' == 'REQUEST') { $meeting'meetingMessageType' = Syncroton_Model_EmailMeetingRequest::MESSAGE_TYPE_REQUEST; } else { @@ -1750,7 +1747,7 @@ foreach ($lines as $line) { // don't wrap already quoted lines - if ($line0 == '>') { + if (isset($line0) && $line0 == '>') { $line = '>' . rtrim($line); } else if (mb_strlen($line) > $max) {
View file
kolab-syncroton-2.4.2.tar.gz/lib/kolab_sync_message.php
Changed
@@ -269,12 +269,12 @@ $message = stream_get_contents($message); } - list($headers, $message) = preg_split('/\r?\n\r?\n/', $message, 2, PREG_SPLIT_NO_EMPTY); + list($headers, $message) = array_pad(preg_split('/\r?\n\r?\n/', $message, 2, PREG_SPLIT_NO_EMPTY), 2, ''); $hdrs = self::parse_headers($headers); // multipart message - if (preg_match('/boundary="?(a-z0-9-\'\(\)+_\,\.\/:=\? +)"?/i', $hdrs'Content-Type', $matches)) { + if (preg_match('/boundary="?(a-z0-9-\'\(\)+_\,\.\/:=\? +)"?/i', $hdrs'Content-Type' ?? '', $matches)) { $boundary = '--' . $matches1; $message = explode($boundary, $message);
View file
kolab-syncroton.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-syncroton Binary: kolab-syncroton Architecture: all -Version: 2.4.2-1~kolab1 +Version: 1:2.4.2.2-1~kolab1 Maintainer: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Uploaders: Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> Homepage: http://www.kolab.org/
View file
release.sh
Added
@@ -0,0 +1,15 @@ +#!/bin/bash + +./buildtarball.sh + +# Autobump the version +CURRENT_VERSION=$(grep '^Version: ' ./*.spec | sed 's/Version: //') +NEW_VERSION=$(echo "$CURRENT_VERSION" | awk -F. '/0-9+\./{$NF++;print}' OFS=.) +echo "Bumping from $CURRENT_VERSION to $NEW_VERSION" + +sed -i "s/$CURRENT_VERSION/$NEW_VERSION/" debian.changelog +sed -i "s/^Version:.*/Version: 1:$NEW_VERSION-1~kolab1/" ./*.dsc +sed -i "s/^Version:.*/Version: $NEW_VERSION/" ./*.spec + +osc ci -m "New release $NEW_VERSION" +osc sr Kolab:16 --yes -m "New release $NEW_VERSION"
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.