|
|
@ -488,13 +488,6 @@ func (h *MenuHandlers) ConfirmPinChange(ctx context.Context, sym string, input [
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return res, nil
|
|
|
|
return res, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -535,13 +528,6 @@ func (h *MenuHandlers) ResetOthersPin(ctx context.Context, sym string, input []b
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return res, nil
|
|
|
|
return res, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -717,12 +703,6 @@ func (h *MenuHandlers) SaveFirstname(ctx context.Context, sym string, input []by
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_firstname_set)
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_firstname_set)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if firstNameSet {
|
|
|
|
if firstNameSet {
|
|
|
@ -767,12 +747,6 @@ func (h *MenuHandlers) SaveFamilyname(ctx context.Context, sym string, input []b
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write familyName entry with", "key", storedb.DATA_FAMILY_NAME, "value", temporaryFamilyName, "error", err)
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write familyName entry with", "key", storedb.DATA_FAMILY_NAME, "value", temporaryFamilyName, "error", err)
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_familyname_set)
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_familyname_set)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if familyNameSet {
|
|
|
|
if familyNameSet {
|
|
|
@ -847,12 +821,6 @@ func (h *MenuHandlers) SaveYob(ctx context.Context, sym string, input []byte) (r
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write yob entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", temporaryYob, "error", err)
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write yob entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", temporaryYob, "error", err)
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_yob_set)
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_yob_set)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if yobSet {
|
|
|
|
if yobSet {
|
|
|
@ -896,12 +864,6 @@ func (h *MenuHandlers) SaveLocation(ctx context.Context, sym string, input []byt
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write location entry with", "key", storedb.DATA_LOCATION, "value", temporaryLocation, "error", err)
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write location entry with", "key", storedb.DATA_LOCATION, "value", temporaryLocation, "error", err)
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_location_set)
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_location_set)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if locationSet {
|
|
|
|
if locationSet {
|
|
|
@ -947,12 +909,6 @@ func (h *MenuHandlers) SaveGender(ctx context.Context, sym string, input []byte)
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write gender entry with", "key", storedb.DATA_GENDER, "value", gender, "error", err)
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write gender entry with", "key", storedb.DATA_GENDER, "value", gender, "error", err)
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_gender_set)
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_gender_set)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if genderSet {
|
|
|
|
if genderSet {
|
|
|
@ -998,12 +954,6 @@ func (h *MenuHandlers) SaveOfferings(ctx context.Context, sym string, input []by
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write offerings entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", offerings, "error", err)
|
|
|
|
logg.ErrorCtxf(ctx, "failed to write offerings entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", offerings, "error", err)
|
|
|
|
return res, err
|
|
|
|
return res, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_offerings_set)
|
|
|
|
res.FlagSet = append(res.FlagSet, flag_offerings_set)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if offeringsSet {
|
|
|
|
if offeringsSet {
|
|
|
@ -1684,12 +1634,6 @@ func (h *MenuHandlers) InviteValidRecipient(ctx context.Context, sym string, inp
|
|
|
|
// res.Content = l.Get("Your invitation to %s to join Sarafu Network has been sent.", string(recipient))
|
|
|
|
// res.Content = l.Get("Your invitation to %s to join Sarafu Network has been sent.", string(recipient))
|
|
|
|
|
|
|
|
|
|
|
|
res.Content = l.Get("Your invite request for %s to Sarafu Network failed. Please try again later.", string(recipient))
|
|
|
|
res.Content = l.Get("Your invite request for %s to Sarafu Network failed. Please try again later.", string(recipient))
|
|
|
|
// clear the temporary value as it has been used
|
|
|
|
|
|
|
|
err := store.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return res, nil
|
|
|
|
return res, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2438,3 +2382,20 @@ func (h *MenuHandlers) constructAccountAlias(ctx context.Context) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (h *MenuHandlers) ClearTemporaryValue(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
|
|
|
|
|
|
|
var res resource.Result
|
|
|
|
|
|
|
|
sessionId, ok := ctx.Value("SessionId").(string)
|
|
|
|
|
|
|
|
if !ok {
|
|
|
|
|
|
|
|
return res, fmt.Errorf("missing session")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
userStore := h.userdataStore
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// clear the temporary value at the start
|
|
|
|
|
|
|
|
err := userStore.WriteEntry(ctx, sessionId, storedb.DATA_TEMPORARY_VALUE, []byte(""))
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
logg.ErrorCtxf(ctx, "failed to clear DATA_TEMPORARY_VALUE entry with", "key", storedb.DATA_TEMPORARY_VALUE, "value", "empty", "error", err)
|
|
|
|
|
|
|
|
return res, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return res, nil
|
|
|
|
|
|
|
|
}
|
|
|
|