Fonaria als zweite Anlage neben Starface
Die SyncEngine kennt jetzt nur noch IContactBackend. Was dahinter steckt, entscheidet das Profil — der Ablauf mit getrennten Baselines, Wiederzuordnung und Konfliktaufloesung bleibt unangetastet. In ihm steckt die Erfahrung, die man nicht zweimal machen will. FonariaApiClient spricht deren REST-API. Der Kern ist das Feld `verwaltet`, das jeder Schreibvorgang mitschickt: Fonaria haelt den Kontakt als vollstaendige vCard, dieses Sync-Modell bildet davon nur einen Ausschnitt ab. Ohne diese Liste haette ein aus Outlook gespiegelter Kontakt nach dem ersten Abgleich kein Bild, keine Kategorien und keinen Jahrestag mehr — nicht weil jemand sie geloescht haette, sondern weil wir sie nicht kannten. Zwei Verluste lagen darunter und sind gefunden worden, weil der Client gegen eine echte Anlage lief: - Die Abteilung steckt im zweiten Teil von ORG. Wer nur die Firma schickt, loescht sie mit. - Neben der geschaeftlichen Anschrift kann eine private stehen. Das Sync-Modell traegt nur eine. Beides wird jetzt aus dem gelesenen Stand unveraendert zurueckgeschrieben. Umbenannt: StarfaceConnection -> SystemConnection, StarfaceAddressBook -> RemoteAddressBook. Die JSON-Namen bleiben ueber JsonProperty erhalten, sonst verloeren bestehende Profile ihre Verbindungsdaten. SyncMapping.StarfaceId behaelt seinen Namen aus demselben Grund. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace StarfaceOutlookSync.Models
|
||||
{
|
||||
/// <summary>Welche Telefonanlage auf der anderen Seite steht.</summary>
|
||||
public enum PhoneSystem
|
||||
{
|
||||
Starface,
|
||||
Fonaria
|
||||
}
|
||||
|
||||
public enum SyncDirection
|
||||
{
|
||||
Both,
|
||||
@@ -7,8 +16,12 @@ namespace StarfaceOutlookSync.Models
|
||||
StarfaceToOutlook
|
||||
}
|
||||
|
||||
public class StarfaceConnection
|
||||
public class SystemConnection
|
||||
{
|
||||
// Voreinstellung Starface, damit Profile aus der Zeit vor Fonaria
|
||||
// unveraendert weiterlaufen: Was im JSON fehlt, ist eine Starface.
|
||||
public PhoneSystem System { get; set; } = PhoneSystem.Starface;
|
||||
|
||||
public string Host { get; set; } = "";
|
||||
public int Port { get; set; } = 443;
|
||||
public bool UseSsl { get; set; } = true;
|
||||
@@ -16,7 +29,16 @@ namespace StarfaceOutlookSync.Models
|
||||
public string Password { get; set; } = "";
|
||||
}
|
||||
|
||||
public class StarfaceAddressBook
|
||||
/// <summary>
|
||||
/// Ein Adressbuch auf der Gegenseite.
|
||||
///
|
||||
/// Die Felder heissen noch nach der Starface, weil dort ihre Bedeutung
|
||||
/// herkommt: <c>Type</c> unterscheidet zentrales, persoenliches und
|
||||
/// Tag-Adressbuch, <c>TagId</c> traegt die Kennung. Bei Fonaria steht in
|
||||
/// <c>TagId</c> schlicht die Nummer des Adressbuchs und in <c>Type</c>
|
||||
/// dessen Art (private, shared, system).
|
||||
/// </summary>
|
||||
public class RemoteAddressBook
|
||||
{
|
||||
public string Type { get; set; } = "central"; // central, user, tag
|
||||
public string UserId { get; set; } = "";
|
||||
@@ -30,8 +52,13 @@ namespace StarfaceOutlookSync.Models
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public string Name { get; set; } = "";
|
||||
public StarfaceConnection StarfaceConnection { get; set; } = new StarfaceConnection();
|
||||
public StarfaceAddressBook StarfaceAddressBook { get; set; } = new StarfaceAddressBook();
|
||||
// Die JSON-Namen bleiben, wie sie waren — sonst verloeren alle
|
||||
// bestehenden Profile beim ersten Start ihre Verbindungsdaten.
|
||||
[JsonProperty("StarfaceConnection")]
|
||||
public SystemConnection Connection { get; set; } = new SystemConnection();
|
||||
|
||||
[JsonProperty("StarfaceAddressBook")]
|
||||
public RemoteAddressBook AddressBook { get; set; } = new RemoteAddressBook();
|
||||
public string OutlookFolderPath { get; set; } = "";
|
||||
public string OutlookFolderName { get; set; } = "Kontakte";
|
||||
public SyncDirection SyncDirection { get; set; } = SyncDirection.Both;
|
||||
@@ -44,6 +71,10 @@ namespace StarfaceOutlookSync.Models
|
||||
{
|
||||
public string ProfileId { get; set; } = "";
|
||||
public string OutlookEntryId { get; set; } = "";
|
||||
|
||||
// Die Kennung auf der Gegenseite — bei Fonaria die Kontakt-ID. Der
|
||||
// Name bleibt: Er steht in jeder bereits gespeicherten Zuordnung, und
|
||||
// ein Umbenennen wuerde sie alle entwerten.
|
||||
public string StarfaceId { get; set; } = "";
|
||||
|
||||
// Getrennte Baselines pro Seite. Outlook und Starface stellen denselben
|
||||
|
||||
Reference in New Issue
Block a user