Compare commits
No commits in common. "c9678df1525f814ce1b457e32f37f24db7001330" and "83a10efcd9b42b64b0210ad280eaabd4d232af67" have entirely different histories.
c9678df152
...
83a10efcd9
@ -601,20 +601,16 @@ func (h *MenuHandlers) ValidateBlockedNumber(ctx context.Context, sym string, in
|
|||||||
return res, fmt.Errorf("missing session")
|
return res, fmt.Errorf("missing session")
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(input) == "0" {
|
if h.st.Back() {
|
||||||
res.FlagReset = append(res.FlagReset, flag_unregistered_number)
|
res.FlagReset = append(res.FlagReset, flag_unregistered_number)
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
blockedNumber := string(input)
|
blockedNumber := string(input)
|
||||||
formattedNumber, err := phone.FormatPhoneNumber(blockedNumber)
|
_, err = store.ReadEntry(ctx, blockedNumber, storedb.DATA_PUBLIC_KEY)
|
||||||
if err != nil {
|
if !phone.IsValidPhoneNumber(blockedNumber) {
|
||||||
res.FlagSet = append(res.FlagSet, flag_unregistered_number)
|
res.FlagSet = append(res.FlagSet, flag_unregistered_number)
|
||||||
logg.ErrorCtxf(ctx, "Failed to format the phone number: %s", blockedNumber, "error", err)
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = store.ReadEntry(ctx, formattedNumber, storedb.DATA_PUBLIC_KEY)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if db.IsNotFound(err) {
|
if db.IsNotFound(err) {
|
||||||
logg.InfoCtxf(ctx, "Invalid or unregistered number")
|
logg.InfoCtxf(ctx, "Invalid or unregistered number")
|
||||||
@ -625,7 +621,7 @@ func (h *MenuHandlers) ValidateBlockedNumber(ctx context.Context, sym string, in
|
|||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = store.WriteEntry(ctx, sessionId, storedb.DATA_BLOCKED_NUMBER, []byte(formattedNumber))
|
err = store.WriteEntry(ctx, sessionId, storedb.DATA_BLOCKED_NUMBER, []byte(blockedNumber))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ var (
|
|||||||
sessionID string
|
sessionID string
|
||||||
src = rand.NewSource(42)
|
src = rand.NewSource(42)
|
||||||
g = rand.New(src)
|
g = rand.New(src)
|
||||||
secondarySessionId = "+254700000000"
|
secondarySessionId = "0700000000"
|
||||||
)
|
)
|
||||||
|
|
||||||
var groupTestFile = flag.String("test-file", "group_test.json", "The test file to use for running the group tests")
|
var groupTestFile = flag.String("test-file", "group_test.json", "The test file to use for running the group tests")
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
CATCH no_admin_privilege flag_admin_privilege 0
|
CATCH no_admin_privilege flag_admin_privilege 0
|
||||||
LOAD reset_account_authorized 0
|
LOAD reset_account_authorized 0
|
||||||
RELOAD reset_account_authorized
|
RELOAD reset_account_authorized
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user