wip-account-creation #4

Merged
lash merged 143 commits from wip-account-creation into master 2024-08-30 14:37:58 +02:00
Showing only changes of commit 9cc75185b3 - Show all commits

View File

@ -14,6 +14,7 @@ import (
"git.defalsify.org/vise.git/cache"
"git.defalsify.org/vise.git/engine"
"git.defalsify.org/vise.git/lang"
"git.defalsify.org/vise.git/persist"
"git.defalsify.org/vise.git/resource"
"git.defalsify.org/vise.git/state"
@ -76,6 +77,16 @@ type fsData struct {
st *state.State
Alfred-mk marked this conversation as resolved Outdated
Outdated
Review

can this (and all its methods) be moved to a separate package please?

can this (and all its methods) be moved to a separate package please?
}
func codeFromCtx(ctx context.Context) string {
var code string
engine.Logg.DebugCtxf(ctx, "in msg", "ctx", ctx, "val", code)
if ctx.Value("Language") != nil {
lang := ctx.Value("Language").(lang.Language)
code = lang.Code
}
return code
}
func (fsd *fsData) SetLanguageSelected(ctx context.Context, sym string, input []byte) (resource.Result, error) {
inputStr := string(input)
res := resource.Result{}
@ -269,8 +280,12 @@ func checkAccountStatus(trackingId string) (string, error) {
}
Outdated
Review

this shouldnt switch on the input string; that requires manual syncing between here and the menu code.

how about using INCMP and the language switches on the sym instead?

Have a look at the lash/reuse-example go-vise branch, I've added an example that might illustrate.

this shouldnt switch on the input string; that requires manual syncing between here and the menu code. how about using INCMP and the language switches on the sym instead? Have a look at the `lash/reuse-example` go-vise branch, I've added an example that might illustrate.
Outdated
Review

priority

**priority**
Outdated
Review

I see this still isn't resolved.

I will make an issue of this, and mark it priority. We will handle it after merge.

I see this still isn't resolved. I will make an issue of this, and mark it priority. We will handle it after merge.
func (fsd *fsData) quit(ctx context.Context, sym string, input []byte) (resource.Result, error) {
res := resource.Result{
Content: "Your account is being created",
res := resource.Result{}
switch codeFromCtx(ctx) {
case "swa":
res.Content = "Asante kwa kutumia huduma ya Sarafu. Kwaheri!"
default:
Alfred-mk marked this conversation as resolved Outdated
Outdated
Review

should error?

should error?
Outdated
Review

priority

**priority**

The switch only takes in two options, 0 or 1.
The menu remains on the select language node if an alternative input is provided

The switch only takes in two options, 0 or 1. The menu remains on the select language node if an alternative input is provided
res.Content = "Thank you for using Sarafu. Goodbye!"
}
res.FlagReset = append(res.FlagReset, USERFLAG_ACCOUNT_UNLOCKED)
return res, nil