Closed Bug 645729 Opened 13 years ago Closed 13 years ago

Make sure 'body' data is sent along with special links (mailto and sms)

Categories

(Firefox for Android Graveyard :: General, defect, P4)

defect

Tracking

(firefox7 fixed, fennec7+)

VERIFIED FIXED
Firefox 7
Tracking Status
firefox7 --- fixed
fennec 7+ ---

People

(Reporter: mfinkle, Assigned: alexp)

References

Details

Attachments

(1 file, 2 obsolete files)

Some special links, mailto and SMS, support a 'body' item that should prepopulate the body of the resulting helper application. This does not seem to be working for SMS on Android. We should make sure we have the code working for any special links that support 'body.

mailto: and sms: are two special links I know about right now. Any others?
OS: Mac OS X → All
Hardware: x86 → All
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0next+
Calendar (calendar:)? and instant messaging (xmpp:)?
Priority: -- → P4
Assignee: nobody → alexp
tracking-fennec: 2.0next+ → 6+
It looks like that "mailto:" and "sms:" are the only commonly used protocols, which support the "body" item.
"mailto:" already works without any special actions - the URIs with the "body" item are handled properly, so we only need to add support for "sms:".
Attached patch Patch (obsolete) — Splinter Review
Handle "body" item in the "sms:" URIs.
Attachment #535248 - Flags: review?(blassey.bugs)
Comment on attachment 535248 [details] [diff] [review]
Patch

Review of attachment 535248 [details] [diff] [review]:
-----------------------------------------------------------------

close, just handle the case where there are other uri args

::: embedding/android/GeckoAppShell.java
@@ +770,5 @@
> +                    if (bodyPos >= 0 && bodyPos + 5 < query.length()) {
> +                        String body = query.substring(bodyPos + 5);
> +                        intent.putExtra("sms_body", body);
> +                        // Remove the query part from the URI
> +                        uri = Uri.parse(aUriSpec.substring(0, aUriSpec.indexOf('?')));

what if there are more arguments to the uri than just body? This doesn't seem to handle that
Attachment #535248 - Flags: review?(blassey.bugs) → review-
(In reply to comment #4)
> what if there are more arguments to the uri than just body? This doesn't
> seem to handle that

I had this concern too, but if I read the RFC correctly, "body" is the only valid field: http://tools.ietf.org/html/rfc5724#section-2
I also think we wouldn't want to implement a full parser for the query string, unless it's really needed.
its the only reserved argument, but that doesn't mean its the only possible one. You just have to split() the string with "&"
(In reply to comment #6)
> You just have to split() the string with "&"

Hmm... If I just do it with the original encoded URI, not with the query string, that would work, I guess.
Attached patch Patch v2 (obsolete) — Splinter Review
Handle the cases with additional fields.
Attachment #535248 - Attachment is obsolete: true
Attachment #535444 - Flags: review?(blassey.bugs)
Comment on attachment 535444 [details] [diff] [review]
Patch v2

Review of attachment 535444 [details] [diff] [review]:
-----------------------------------------------------------------

If you haven't please test this with an extra arg. sms:5551234567?body=foo&bar=boo and sms:5551234567?bar=boo&body=foo
Attachment #535444 - Flags: review?(blassey.bugs) → review+
(In reply to comment #9)
> If you haven't please test this with an extra arg.
> sms:5551234567?body=foo&bar=boo and sms:5551234567?bar=boo&body=foo

Yes, I've tested all possible variants - everything works.

Just want to point out though that those extra arguments actually confuse the standard SMS application, which sometimes cannot find the contact if an extra argument is provided after the phone number.
r=blassey
Attachment #535444 - Attachment is obsolete: true
Attachment #539938 - Flags: review+
Status: NEW → ASSIGNED
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/4b326eca59f8
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 7
Verified:
Mozilla/5.0 (Android; Linux armv71; rv7.0a1) Gecko/20110622 Firefox/7.0a1 Fennec/7.0a1
Device: Thunderbolt
OS: Android 2.2
Status: RESOLVED → VERIFIED
tracking-fennec: 6+ → 7+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: