Propagate contact deletions during sync
When a mapped contact is deleted on one side, delete it on the other side too (respecting sync direction setting): - Deleted in Outlook -> delete in Starface (if direction allows) - Deleted in Starface -> delete in Outlook (if direction allows) - Deleted on both sides -> just remove the mapping Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
724beba34a
commit
39be854a4a
|
|
@ -144,6 +144,45 @@ namespace StarfaceOutlookSync.Services
|
|||
if (oc == null && sc == null)
|
||||
{
|
||||
// Beide Seiten geloescht -> Mapping entfernen
|
||||
Log($" Mapping verwaist (beide geloescht), entferne");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (oc == null && sc != null)
|
||||
{
|
||||
// In Outlook geloescht -> in Starface auch loeschen
|
||||
if (profile.SyncDirection == SyncDirection.Both || profile.SyncDirection == SyncDirection.OutlookToStarface)
|
||||
{
|
||||
if (await starface.DeleteContactAsync(mapping.StarfaceId))
|
||||
{
|
||||
result.Updated++;
|
||||
Log($" Geloescht (OL->SF): {sc.DisplayName}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Richtung erlaubt kein Loeschen -> Mapping behalten
|
||||
newMappings.Add(mapping);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (oc != null && sc == null)
|
||||
{
|
||||
// In Starface geloescht -> in Outlook auch loeschen
|
||||
if (profile.SyncDirection == SyncDirection.Both || profile.SyncDirection == SyncDirection.StarfaceToOutlook)
|
||||
{
|
||||
if (_outlookService.DeleteContact(mapping.OutlookEntryId))
|
||||
{
|
||||
result.Updated++;
|
||||
Log($" Geloescht (SF->OL): {oc.DisplayName}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Richtung erlaubt kein Loeschen -> Mapping behalten
|
||||
newMappings.Add(mapping);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue