From 12973d29bcf5805eb39244b074b96629cea67994 Mon Sep 17 00:00:00 2001 From: JustAnotherID Date: Fri, 20 Oct 2023 11:19:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=8D=E6=B8=85=E7=90=86=E4=BB=8E?= =?UTF-8?q?=E6=9C=AA=E5=8F=91=E8=A8=80=E8=BF=87=E7=9A=84=E7=BE=A4=EF=BC=8C?= =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=96=B0=E5=8A=A0=E7=BE=A4=E8=A2=AB=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dice/im_session.go | 4 ++++ tray_darwin.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dice/im_session.go b/dice/im_session.go index db810076..03531000 100644 --- a/dice/im_session.go +++ b/dice/im_session.go @@ -897,6 +897,10 @@ func (s *IMSession) QuitInactiveGroup(threshold, hint time.Time) { if strings.HasPrefix(grp.GroupID, "PG-") { continue } + if grp.RecentDiceSendTime == 0 { + // 防止骰子从未发言过的新加群被立即清理掉 + continue + } last := time.Unix(grp.RecentDiceSendTime, 0) if last.Before(threshold) { match := platformRE.FindStringSubmatch(grp.GroupID) diff --git a/tray_darwin.go b/tray_darwin.go index f5d17d25..b998c069 100644 --- a/tray_darwin.go +++ b/tray_darwin.go @@ -124,7 +124,7 @@ func httpServe(e *echo.Echo, dm *dice.DiceManager, hideUI bool) { } _ = ln.Close() - //exec.Command(`cmd`, `/c`, `start`, fmt.Sprintf(`http://localhost:%s`, portStr)).Start() + // exec.Command(`cmd`, `/c`, `start`, fmt.Sprintf(`http://localhost:%s`, portStr)).Start() fmt.Println("如果浏览器没有自动打开,请手动访问:") fmt.Printf(`http://localhost:%s`, portStr) // 默认:3211 err = e.Start(dm.ServeAddress)