From 35d2e29f5f9e9cca01a062f2b2827c16ad853b65 Mon Sep 17 00:00:00 2001 From: idanoo Date: Sun, 20 Nov 2022 18:38:00 +1300 Subject: [PATCH] Add notes! --- main.go | 10 +++++++--- structs.go | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 6c768ff..ab30cf7 100644 --- a/main.go +++ b/main.go @@ -74,10 +74,14 @@ func handler(w http.ResponseWriter, r *http.Request) { country := ipLookup(i.Object.IP) err = sendWebhook( fmt.Sprintf( - "*New Signup* %s (%s) has signed up.%s\n%s", + "New Signup%s: %s (%s) has signed up.\n%s\n%s", + country, i.Object.Username, i.Object.Email, - country, + fmt.Sprintf( + "Notes: %s", + i.Object.Notes, + ), fmt.Sprintf( "https://mastodon.nz/admin/accounts/%s", i.Object.ID, @@ -140,5 +144,5 @@ func ipLookup(ip string) string { return "" } - return " (" + results.Country_long + ")" + return " from" + results.Country_long } diff --git a/structs.go b/structs.go index 98dae18..59e49c3 100644 --- a/structs.go +++ b/structs.go @@ -14,6 +14,7 @@ type MastodonEvent struct { Username string `json:"username"` Email string `json:"email"` IP string `json:"ip"` + Notes string `json:"invite_request"` TargetAccount struct { ID string `json:"id"` Username string `json:"username"`