api-users: trigger tps contact info link on admin newUser
only adds email, since that's all that's available.
This commit is contained in:
+1
-1
@@ -144,7 +144,7 @@ func (js *JellyseerrWrapper) AddContactMethods(jellyfinID string, req newUserDTO
|
|||||||
contactMethods[jellyseerr.FieldDiscord] = discord.ID
|
contactMethods[jellyseerr.FieldDiscord] = discord.ID
|
||||||
contactMethods[jellyseerr.FieldDiscordEnabled] = req.DiscordContact
|
contactMethods[jellyseerr.FieldDiscordEnabled] = req.DiscordContact
|
||||||
}
|
}
|
||||||
if telegramEnabled && discord != nil {
|
if telegramEnabled && telegram != nil {
|
||||||
contactMethods[jellyseerr.FieldTelegram] = telegram.ChatID
|
contactMethods[jellyseerr.FieldTelegram] = telegram.ChatID
|
||||||
contactMethods[jellyseerr.FieldTelegramEnabled] = req.TelegramContact
|
contactMethods[jellyseerr.FieldTelegramEnabled] = req.TelegramContact
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,17 @@ func (app *appContext) NewUserFromAdmin(gc *gin.Context) {
|
|||||||
app.storage.SetEmailsKey(nu.User.ID, emailStore)
|
app.storage.SetEmailsKey(nu.User.ID, emailStore)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, tps := range app.thirdPartyServices {
|
||||||
|
if !tps.Enabled(app, &profile) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// We only have email
|
||||||
|
err := tps.AddContactMethods(nu.User.ID, req, nil, nil)
|
||||||
|
if err != nil {
|
||||||
|
app.err.Printf(lm.FailedSyncContactMethods, tps.Name(), err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
welcomeMessageSentIfNecessary := true
|
welcomeMessageSentIfNecessary := true
|
||||||
if nu.Created {
|
if nu.Created {
|
||||||
welcomeMessageSentIfNecessary = !app.WelcomeNewUser(nu.User, time.Time{})
|
welcomeMessageSentIfNecessary = !app.WelcomeNewUser(nu.User, time.Time{})
|
||||||
|
|||||||
Reference in New Issue
Block a user