diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-10-05 08:10:58 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-10-05 08:10:58 +0100 |
commit | bb24ffc0e9e3eaf2b9cfb7e88020a9b5b0328a3e (patch) | |
tree | dd3ba6c0cf86ecc4c1fb6ab5b3f377b52c81cd06 /perllib/FixMyStreet/SMS.pm | |
parent | 70ddda2c5e851c012b2bb98ec74c87490be6dad0 (diff) |
Accept +1 geographic numbers as possibly mobile.
We have no way of knowing whether a +1 geographic number is fixed
line or mobile, so accept them all as potentially mobile.
Diffstat (limited to 'perllib/FixMyStreet/SMS.pm')
-rw-r--r-- | perllib/FixMyStreet/SMS.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/SMS.pm b/perllib/FixMyStreet/SMS.pm index ec9251a1a..c71cceadc 100644 --- a/perllib/FixMyStreet/SMS.pm +++ b/perllib/FixMyStreet/SMS.pm @@ -94,15 +94,19 @@ sub parse_username { } }; + my $may_be_mobile = 0; if ($phone) { $type = 'phone'; # Store phone without spaces ($username = $phone->format) =~ s/\s+//g; + # Is this mobile definitely or possibly a mobile? (+1 numbers) + $may_be_mobile = 1 if $phone->is_mobile || (!defined $phone->is_mobile && $phone->is_geographic); } return { type => $type, phone => $phone, + may_be_mobile => $may_be_mobile, username => $username, }; } |