From 0010d62d63848d71934c45243a2aa2529aa98076 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 8 Oct 2019 01:31:37 -0400 Subject: [PATCH] nicer upgrade for zonkers --- upgradedb.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/upgradedb.go b/upgradedb.go index 2a04ffa..f9d8165 100644 --- a/upgradedb.go +++ b/upgradedb.go @@ -21,6 +21,7 @@ import ( "os" "regexp" "strings" + "time" ) func doordie(db *sql.DB, s string, args ...interface{}) { @@ -208,6 +209,7 @@ func upgradedb() { log.Fatalf("can't query zonkers: %s", err) } filtmap := make(map[int64][]*Filter) + now := time.Now().UTC() for rows.Next() { var userid int64 var name, wherefore string @@ -216,21 +218,27 @@ func upgradedb() { log.Fatalf("error scanning zonker: %s", err) } f := new(Filter) + f.Date = now switch wherefore { case "zord": + f.Name = "hide " + name f.Text = name f.Hide = true case "zilence": + f.Name = "silence " + name f.Text = name f.Collapse = true case "zoggle": + f.Name = "skip " + name f.Actor = name f.SkipMedia = true case "zonker": + f.Name = "reject " + name f.Actor = name f.IncludeAudience = true f.Reject = true case "zomain": + f.Name = "reject " + name f.Actor = name f.IncludeAudience = true f.Reject = true