summaryrefslogtreecommitdiff
path: root/sent.go
diff options
context:
space:
mode:
authorDmitry Ilvokhin <d@ilvokhin.com>2025-03-05 22:14:27 +0000
committerDmitry Ilvokhin <d@ilvokhin.com>2025-03-05 22:14:27 +0000
commit98da712a92bf3320e4a1045405564e76f58fb514 (patch)
treeca3eaaa8ba6be4085f23a202f1b9e132fa7a46ad /sent.go
parent547a44a9fb502a308f596e6ffe1a90bd6c4607bc (diff)
downloadflatbot-98da712a92bf3320e4a1045405564e76f58fb514.tar.gz
flatbot-98da712a92bf3320e4a1045405564e76f58fb514.tar.bz2
flatbot-98da712a92bf3320e4a1045405564e76f58fb514.zip
Basic implemention of the full flow
Diffstat (limited to 'sent.go')
-rw-r--r--sent.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/sent.go b/sent.go
index dc16051..dd3c4c4 100644
--- a/sent.go
+++ b/sent.go
@@ -43,6 +43,21 @@ func removeAlreadySent(fetched []flat, sent []flat) []flat {
return recent
}
+func removeDelisted(sent []flat, allFlats []flat) []flat {
+ if !slices.IsSortedFunc(allFlats, compareID) {
+ panic("allFlats expected to be sorted")
+ }
+ recent := make([]flat, 0)
+ for _, f := range sent {
+ _, found := slices.BinarySearchFunc(allFlats, f, compareID)
+ if !found {
+ continue
+ }
+ recent = append(recent, f)
+ }
+ return recent
+}
+
func writeSent(sent []flat, filename string) error {
jsonData, err := json.Marshal(sent)
if err != nil {