Commit 1b0b1e27 authored by chriadam's avatar chriadam

Merge branch 'jb47783' into 'master'

[buteo-sync-plugins-social] Fix Google calendar event duplication. Contributes to JB#47783

See merge request !54
parents 15f5e978 fb592ddc
......@@ -155,7 +155,7 @@ systemctl-user try-restart msyncd.service || :
%package google-calendars
Summary: Provides calendar synchronisation with Google
BuildRequires: pkgconfig(libmkcal-qt5)
BuildRequires: pkgconfig(libmkcal-qt5) >= 0.5.9
BuildRequires: pkgconfig(libkcalcoren-qt5)
Requires: %{name} = %{version}-%{release}
......
......@@ -174,7 +174,15 @@ namespace GoogleCalendarIncidenceComparator {
KCalCore::Person personB(*b->organizer().data());
normalizePersonEmail(&personA);
normalizePersonEmail(&personB);
GIC_RETURN_FALSE_IF_NOT_EQUAL_CUSTOM(personA != personB, "organizer", (personA.fullName() + " != " + personB.fullName()));
const QString aEmail = personA.email();
const QString bEmail = personB.email();
// If the aEmail is empty, the local event doesn't have organizer info.
// That's ok - Google will add organizer/creator info when we upsync,
// so don't treat it as a local modification.
// Otherwise, it is a "real" change.
if (aEmail != bEmail && !aEmail.isEmpty()) {
GIC_RETURN_FALSE_IF_NOT_EQUAL_CUSTOM(personA != personB, "organizer", (personA.fullName() + " != " + personB.fullName()));
}
switch (a->type()) {
case KCalCore::IncidenceBase::TypeEvent:
......
......@@ -122,15 +122,16 @@ private:
QMap<int, QMap<QString, QString> > m_recurringEventIdToKCalUid;
QMap<int, bool> m_syncSucceeded;
QMap<int, bool> m_cleanSyncRequired;
QMap<int, QDateTime> m_prevSinceTimestamp;
QMap<int, QDateTime> m_newSinceTimestamp;
QStringList m_calendarsBeingRequested; // calendarIds
QMap<QString, QString> m_calendarsFinishedRequested; // calendarId to updated timestamp string
QMap<QString, QString> m_calendarsThisSyncTokens; // calendarId to sync token used during this sync cycle
QMap<QString, QString> m_calendarsNextSyncTokens; // calendarId to sync token to use during next sync cycle
QMap<QString, QDateTime> m_calendarsSyncDate; // calendarId to since date to use when determining delta
QMultiMap<QString, QPair<GoogleCalendarSyncAdaptor::ChangeType, QJsonObject> > m_changesFromDownsync; // calendarId to change
QMultiMap<QString, QPair<KCalCore::Event::Ptr, QJsonObject> > m_changesFromUpsync; // calendarId to event+upsyncResponse
QSet<QString> m_syncTokenFailure; // calendarIds suffering from 410 error due to invalid sync token
QSet<QString> m_timeMinFailure; // calendarIds suffering from 410 error due to invalid timeMin value
mKCal::ExtendedCalendar::Ptr m_calendar;
mKCal::ExtendedStorage::Ptr m_storage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment