mirror of
https://github.com/idanoo/go-mastodon-matrix-webhooks.git
synced 2024-11-22 00:21:58 +00:00
Add notes!
This commit is contained in:
parent
cba0345278
commit
35d2e29f5f
10
main.go
10
main.go
@ -74,10 +74,14 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
country := ipLookup(i.Object.IP)
|
country := ipLookup(i.Object.IP)
|
||||||
err = sendWebhook(
|
err = sendWebhook(
|
||||||
fmt.Sprintf(
|
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.Username,
|
||||||
i.Object.Email,
|
i.Object.Email,
|
||||||
country,
|
fmt.Sprintf(
|
||||||
|
"Notes: %s",
|
||||||
|
i.Object.Notes,
|
||||||
|
),
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"https://mastodon.nz/admin/accounts/%s",
|
"https://mastodon.nz/admin/accounts/%s",
|
||||||
i.Object.ID,
|
i.Object.ID,
|
||||||
@ -140,5 +144,5 @@ func ipLookup(ip string) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return " (" + results.Country_long + ")"
|
return " from" + results.Country_long
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ type MastodonEvent struct {
|
|||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
IP string `json:"ip"`
|
IP string `json:"ip"`
|
||||||
|
Notes string `json:"invite_request"`
|
||||||
TargetAccount struct {
|
TargetAccount struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
|
Loading…
Reference in New Issue
Block a user