Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 06b8ff4d authored by Glenn Maynard's avatar Glenn Maynard Committed by Steve Kondik
Browse files

Fix parsing of SMS messages from short numbers.

extractEmailAddressFromMessageBody assumed all messages sent to it start
with an email address, without doing any validation at all.  This caused
all messages sent from numbers of 4 digits or fewer (see
SmsAddress.couldBeEmailGateway) to have its first word treated as
the source address, even when there's no address at all.

Older versions of this code didn't have that problem, but had other
problems: any string containing an @, even in the middle of a sentence,
would be considered an email address.

This will still parse some messages incorrectly: if an SMS gateway
doesn't include an email address, and the sender sends a message that
happens to begin with an email address, the results are indistinguishable.
This isn't actually reliably parsable; although TS 23.040 3.8 clearly
defines this format, the format it defines is uselessly ambiguous.  This
will at least greatly reduce the number of broken cases.

http://code.google.com/p/cyanogenmod/issues/detail?id=1419
http://code.google.com/p/android/issues/detail?id=6526
parent 31c3bd25
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment