aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SMS.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2017-10-05 14:14:06 +0100
committerMatthew Somerville <matthew@mysociety.org>2017-10-05 14:14:06 +0100
commit4d5828bdc5076dcc08d73a0760c25fd434ce3dff (patch)
treee43540168e15ac0ec490da234f3ce1118db971cb /perllib/FixMyStreet/SMS.pm
parent861b3ace16097b5558d749210509afe4f0bdf70f (diff)
parentbb24ffc0e9e3eaf2b9cfb7e88020a9b5b0328a3e (diff)
Merge remote-tracking branch 'origin/fix-geographic-mobile-numbers'
Diffstat (limited to 'perllib/FixMyStreet/SMS.pm')
-rw-r--r--perllib/FixMyStreet/SMS.pm4
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,
};
}