1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-30 02:15:40 +02:00

WIP Twilio

This commit is contained in:
binwiederhier 2023-05-12 21:47:41 -04:00
parent 214efbde36
commit cea434a57c
34 changed files with 311 additions and 143 deletions
server

View file

@ -455,6 +455,8 @@ func (s *Server) handleInternal(w http.ResponseWriter, r *http.Request, v *visit
return s.ensureUser(s.withAccountSync(s.handleAccountPhoneNumberAdd))(w, r, v)
} else if r.Method == http.MethodPost && r.URL.Path == apiAccountPhonePath {
return s.ensureUser(s.withAccountSync(s.handleAccountPhoneNumberVerify))(w, r, v)
} else if r.Method == http.MethodDelete && r.URL.Path == apiAccountPhonePath {
return s.ensureUser(s.withAccountSync(s.handleAccountPhoneNumberDelete))(w, r, v)
} else if r.Method == http.MethodGet && r.URL.Path == apiStatsPath {
return s.handleStats(w, r, v)
} else if r.Method == http.MethodGet && r.URL.Path == apiTiersPath {
@ -692,6 +694,9 @@ func (s *Server) handlePublishInternal(r *http.Request, v *visitor) (*message, e
} else if call != "" && !vrate.CallAllowed() {
return nil, errHTTPTooManyRequestsLimitCalls.With(t)
}
// FIXME check allowed phone numbers
if m.PollID != "" {
m = newPollRequestMessage(t.ID, m.PollID)
}