mirror of
https://github.com/idanoo/go-mastodon-matrix-webhooks.git
synced 2024-11-22 08:25:17 +00:00
Finish webhook for approved accounts
This commit is contained in:
parent
1403583b59
commit
ae803d1127
7
main.go
7
main.go
@ -127,22 +127,17 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
} else if i.Event == "account.approved" {
|
} else if i.Event == "account.approved" {
|
||||||
msg := fmt.Sprintf(
|
msg := fmt.Sprintf(
|
||||||
"[Account Approved](%s): %s by %s",
|
"[Signup Approved](%s): %s",
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"https://mastodon.nz/admin/accounts/%s",
|
"https://mastodon.nz/admin/accounts/%s",
|
||||||
i.Object.ID,
|
i.Object.ID,
|
||||||
),
|
),
|
||||||
i.Object.Username,
|
i.Object.Username,
|
||||||
"test",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Log to stdout
|
// Log to stdout
|
||||||
log.Println(msg)
|
log.Println(msg)
|
||||||
|
|
||||||
// Debug?
|
|
||||||
str, _ := json.Marshal(i)
|
|
||||||
log.Println(string(str))
|
|
||||||
|
|
||||||
// Send to Matrix
|
// Send to Matrix
|
||||||
err = sendWebhook(
|
err = sendWebhook(
|
||||||
msg,
|
msg,
|
||||||
|
Loading…
Reference in New Issue
Block a user