Telegram: Allow admin to add telegram contact

Works in the same way as on the form, but can now be done in the
accounts tab.
This commit is contained in:
Harvey Tindall
2021-05-07 18:20:35 +01:00
parent 0f41d1e6cf
commit 2d93b3b7ee
13 changed files with 229 additions and 12 deletions
+6 -1
View File
@@ -119,7 +119,7 @@ func (app *appContext) loadRoutes(router *gin.Engine) {
router.Use(static.Serve(p+"/invite/", app.webFS))
router.GET(p+"/invite/:invCode", app.InviteProxy)
if app.config.Section("telegram").Key("enabled").MustBool(false) {
router.GET(p+"/invite/:invCode/telegram/verified/:pin", app.TelegramVerified)
router.GET(p+"/invite/:invCode/telegram/verified/:pin", app.TelegramVerifiedInvite)
}
}
if *SWAGGER {
@@ -158,6 +158,11 @@ func (app *appContext) loadRoutes(router *gin.Engine) {
api.GET(p+"/config", app.GetConfig)
api.POST(p+"/config", app.ModifyConfig)
api.POST(p+"/restart", app.restart)
if app.config.Section("telegram").Key("enabled").MustBool(false) {
api.GET(p+"/telegram/pin", app.TelegramGetPin)
api.GET(p+"/telegram/verified/:pin", app.TelegramVerified)
api.POST(p+"/users/telegram", app.TelegramAddUser)
}
if app.config.Section("ombi").Key("enabled").MustBool(false) {
api.GET(p+"/ombi/users", app.OmbiUsers)
api.POST(p+"/ombi/defaults", app.SetOmbiDefaults)