~emersion/soju-dev

msgstore_fs: correctly handle timestamps v1 REJECTED

Hubert Hirtz: 1
 msgstore_fs: correctly handle timestamps

 1 files changed, 2 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/soju-dev/patches/20766/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] msgstore_fs: correctly handle timestamps Export this patch

---
 msgstore_fs.go | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/msgstore_fs.go b/msgstore_fs.go
index fdeb91c..a203ac3 100644
--- a/msgstore_fs.go
+++ b/msgstore_fs.go
@@ -340,8 +340,7 @@ func (ms *fsMessageStore) LoadBeforeTime(network *network, entity string, t time
		}
		copy(history[remaining-len(buf):], buf)
		remaining -= len(buf)
		year, month, day := t.Date()
		t = time.Date(year, month, day, 0, 0, 0, 0, t.Location()).Add(-1)
		t = truncateDay(t).AddDate(0, 0, -1)
	}

	return history[remaining:], nil
@@ -364,8 +363,7 @@ func (ms *fsMessageStore) LoadAfterTime(network *network, entity string, t time.
		}
		history = append(history, buf...)
		remaining -= len(buf)
		year, month, day := t.Date()
		t = time.Date(year, month, day+1, 0, 0, 0, 0, t.Location())
		t = truncateDay(t).AddDate(0, 0, 1)
	}
	return history, nil
}
-- 
2.30.1
What bug is this patch trying to fix? This computation is a bit finicky
IIRC.

CC delthas