From d2f749076d37523a3eb2ab780eed6ea74e4512f9 Mon Sep 17 00:00:00 2001 From: ketmar Date: Sat, 4 Dec 2021 12:01:19 +0000 Subject: [PATCH] twitting fixes FossilOrigin-Name: bf17a9007e25c71b7fa74e8d4308944b278e00465dea5ecd6decc3ff45161be0 --- chibackend/sqbase.d | 35 +++++++++++++++++++++-------------- dialogs.d | 4 ++-- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/chibackend/sqbase.d b/chibackend/sqbase.d index fd52062..0219985 100644 --- a/chibackend/sqbase.d +++ b/chibackend/sqbase.d @@ -4552,6 +4552,8 @@ void processEmailTwits (TwitProcessCallback cb) { email TEXT NOT NULL UNIQUE ); `); + + scope(exit) { if (cb !is null) cb("dropping temp tables", twitcount, twitcount); dbView.execute(`DROP TABLE IF EXISTS disemails;`); @@ -4618,7 +4620,7 @@ void processEmailTwits (TwitProcessCallback cb) { dbView.execute(` DELETE FROM disemails; INSERT INTO disemails - SELECT DISTINCT(from_mail) FROM info; + SELECT DISTINCT(from_mail) FROM info WHERE from_mail<>'' AND from_mail NOT NULL; `); if (cb !is null) cb(Message, twitdone, twitcount); @@ -4870,17 +4872,22 @@ DETACH DATABASE chiview; public void chiroRecalcAllTwits (TwitProcessCallback cb) { // clear all twits - conwriteln("clearing all mutes..."); - if (cb !is null) cb("clearing mutes", 0, 0); - dbView.execute(` - UPDATE threads - SET mute=0, title=NULL - ;`); - conwriteln("processing email twits..."); - processEmailTwits(cb); - conwriteln("processing msgid twits..."); - processMsgidTwits(cb); - conwriteln("propagating thread twits..."); - processThreadMutes(cb); - conwriteln("twit recalculation complete."); + try { + conwriteln("clearing all mutes..."); + if (cb !is null) cb("clearing mutes", 0, 0); + dbView.execute(` + UPDATE threads + SET mute=0, title=NULL + ;`); + conwriteln("processing email twits..."); + processEmailTwits(cb); + conwriteln("processing msgid twits..."); + processMsgidTwits(cb); + conwriteln("propagating thread twits..."); + processThreadMutes(cb); + conwriteln("twit recalculation complete."); + } catch (Exception e) { + auto s = e.toString(); + conwriteln("=== FATAL ===", s); + } } diff --git a/dialogs.d b/dialogs.d index 0d7c9ec..fd7f95f 100644 --- a/dialogs.d +++ b/dialogs.d @@ -828,10 +828,10 @@ public class TitlerWindow : SubWindow { minWinSize.w = 320; + edtTitle.focus(); + relayoutResize(); centerWindow(); - - edtTitle.focus(); } this (const(char)[] aname, const(char)[] amail, const(char)[] afolder, const(char)[] atitle) { -- 2.11.4.GIT