]> git.giacomolli.uk - onechat/blobdiff - whatsapp_import.go
Return known failures without redundant checks
[onechat] / whatsapp_import.go
index 0021bc8be5904d820375a70e5635eec349ee3143..f293ebd9741956496030b56470c3151daacd999a 100644 (file)
@@ -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) {