X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/80e348724041a694002fc38f57e8868b9b9a2be9..b961d7cdc59213673c3e4f86d3dae99daf0a1935:/whatsapp_import.go?ds=inline diff --git a/whatsapp_import.go b/whatsapp_import.go index 0021bc8..f293ebd 100644 --- a/whatsapp_import.go +++ b/whatsapp_import.go @@ -452,16 +452,6 @@ func whatsappImportNames(ctx context.Context, dir string) (names map[string]What return names, owner, nil } -// whatsappImportName adds an exact match unless distinct IDs share its name. -func whatsappImportName(names map[string]WhatsAppChat, chat WhatsAppChat) { - old, found := names[chat.Name] - if found && old.ID != chat.ID { - chat.ID = "" - } - - names[chat.Name] = chat -} - // whatsappImportPlan filters each chat at its earliest live message across the // target and root logs. Only imported days in the target are skipped. Each // remaining chat-day becomes a work message dated at its last exported message. @@ -570,6 +560,16 @@ func whatsappImportPlan(ctx context.Context, paths []string, old, rootLog []Date return plan, nil } +// whatsappImportName adds an exact match unless distinct IDs share its name. +func whatsappImportName(names map[string]WhatsAppChat, chat WhatsAppChat) { + old, found := names[chat.Name] + if found && old.ID != chat.ID { + chat.ID = "" + } + + names[chat.Name] = chat +} + // whatsappImportHistory reads batch names and live cutoffs from both logs. // Imported chat-days belong only to the target log, which is first. func whatsappImportHistory(target, root []DatedMessage, names map[string]WhatsAppChat, cutoffs map[string]time.Time, location *time.Location) (map[string]bool, error) {