Skip to content

Commit

Permalink
Merge branch 'jb47783' into 'master'
Browse files Browse the repository at this point in the history
[buteo-sync-plugins-social] Fix Google calendar event duplication. Contributes to JB#47783

See merge request mer-core/buteo-sync-plugins-social!54
  • Loading branch information
chriadam committed Jan 29, 2020
2 parents 15f5e97 + fb592dd commit 1b0b1e2
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 124 deletions.
2 changes: 1 addition & 1 deletion rpm/sociald.spec
Expand Up @@ -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}

Expand Down
Expand Up @@ -174,7 +174,15 @@ namespace GoogleCalendarIncidenceComparator {
KCalCore::Person personB(*b->organizer().data());
normalizePersonEmail(&personA);
normalizePersonEmail(&personB);
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:
Expand Down

0 comments on commit 1b0b1e2

Please sign in to comment.