File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,16 @@ import "strings"
5
5
// todo: Put in a DB somehwere? Or make configurable?
6
6
// todo: Needs tests
7
7
func hasBannedPhoneNumberPrefix (phoneNumber string ) bool {
8
- for _ , prefix := range []string {
9
- // Sanctioned countries
10
- //
11
- // todo: Probably doesn't belong in an antispam package, but it's just a
12
- // convenient place for now
8
+ // Check that a +7 phone number is not a mobile number from Kazakhstan
9
+ if strings .HasPrefix ("+770" , phoneNumber ) || strings .HasPrefix ("+777" , phoneNumber ) {
10
+ return false
11
+ }
13
12
13
+ // Sanctioned countries
14
+ //
15
+ // todo: Probably doesn't belong in an antispam package, but it's just a
16
+ // convenient place for now
17
+ for _ , prefix := range []string {
14
18
"+7" , // Russia
15
19
"+30" , // Greece (Balkans)
16
20
"+40" , // Romania (Balkans)
You can’t perform that action at this time.
0 commit comments