aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SMS.pm
diff options
context:
space:
mode:
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,
};
}