added UpdateClient route

This commit is contained in:
2023-05-28 23:25:18 +02:00
parent 3a9b15c2be
commit 0daca2cf8f
19 changed files with 271 additions and 44 deletions

View File

@@ -339,17 +339,13 @@ func (app *Application) NormalizeUsername(v string) string {
return strings.TrimSpace(v)
}
func (app *Application) DeliverMessage(ctx context.Context, client models.Client, msg models.Message, compatTitleOverride *string) (*string, error) {
if client.FCMToken != nil {
fcmDelivID, err := app.Pusher.SendNotification(ctx, client, msg, compatTitleOverride)
if err != nil {
log.Warn().Str("MessageID", msg.MessageID.String()).Str("ClientID", client.ClientID.String()).Err(err).Msg("FCM Delivery failed")
return nil, err
}
return langext.Ptr(fcmDelivID), nil
} else {
return langext.Ptr(""), nil
func (app *Application) DeliverMessage(ctx context.Context, client models.Client, msg models.Message, compatTitleOverride *string) (string, error) {
fcmDelivID, err := app.Pusher.SendNotification(ctx, client, msg, compatTitleOverride)
if err != nil {
log.Warn().Str("MessageID", msg.MessageID.String()).Str("ClientID", client.ClientID.String()).Err(err).Msg("FCM Delivery failed")
return "", err
}
return fcmDelivID, nil
}
func (app *Application) InsertRequestLog(data models.RequestLog) {