feat: IMAP sync incremental + Account Setup Wizard + robust FETCH parser
- ImapSynchronizer::syncFolder(): detecta eliminados (UIDs locales no en servidor), fetch nuevos (sinceUid), actualiza flags (FLAGS batch) - fetchAllUids(): SELECT + SEARCH ALL para lista completa UIDs servidor - parseAndUpdateFlags(): FETCH FLAGS en lotes 100, update DB si cambió read/flagged - AccountSetupDialog: integra ConnectionWizard para IMAP/POP3 con test de conexión real - IMAP FETCH parser robusto: logging respuesta servidor + fallback UID-by-UID - Fix: FETCH failed logging muestra first/last UID + respuesta truncada
This commit is contained in:
@@ -17,24 +17,26 @@ void AccountSetupDialogLauncher::setupAccountManually(const Account &account)
|
||||
{
|
||||
qDebug() << "[AccountSetupDialogLauncher] Setting up account:" << account.email();
|
||||
|
||||
// Save to database
|
||||
bool created = AccountDao::insert(account);
|
||||
if (!created) {
|
||||
// Save to database and retain the generated id for the synchronizer/event.
|
||||
const qint64 id = AccountDao::insert(account);
|
||||
if (id < 0) {
|
||||
qWarning() << "[AccountSetupDialogLauncher] Failed to save account to DB";
|
||||
emit accountSetupFailed("Failed to save account");
|
||||
return;
|
||||
}
|
||||
Account storedAccount = account;
|
||||
storedAccount.setId(static_cast<int>(id));
|
||||
|
||||
// Initialize synchronizer
|
||||
initializeSynchronizer(account);
|
||||
initializeSynchronizer(storedAccount);
|
||||
|
||||
// Publish event
|
||||
WinoMail::Events::AccountAddedEvent event;
|
||||
event.account = account;
|
||||
event.account = storedAccount;
|
||||
EVENT_BUS.publish(event);
|
||||
|
||||
qDebug() << "[AccountSetupDialogLauncher] Account created successfully:" << account.email();
|
||||
emit accountSetupCompleted(account);
|
||||
emit accountSetupCompleted(storedAccount);
|
||||
}
|
||||
|
||||
void AccountSetupDialogLauncher::initializeSynchronizer(const Account &account)
|
||||
|
||||
Reference in New Issue
Block a user