Created
March 22, 2013 01:59
-
-
Save jrburke/5218378 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/apps/email/js/ext/mailapi/activesync/configurator.js b/apps/email/js/ext/mailapi/activesync/configurator.js | |
index 38d7a5a..69fe6cb 100644 | |
--- a/apps/email/js/ext/mailapi/activesync/configurator.js | |
+++ b/apps/email/js/ext/mailapi/activesync/configurator.js | |
@@ -2931,8 +2931,12 @@ ActiveSyncAccount.prototype = { | |
}); | |
} | |
else { // ActiveSync 12.x and lower | |
+ var encoder = new TextEncoder('UTF-8'); | |
+ | |
+ // On B2G 18, XHRs expect ArrayBuffers and will barf on Uint8Arrays. In | |
+ // the future, we can remove the last |.buffer| bit below. | |
this.conn.postData('SendMail', 'message/rfc822', | |
- mimeBuffer, | |
+ encoder.encode(mimeBuffer).buffer, | |
function(aError, aResponse) { | |
if (aError) { | |
console.error(aError); | |
diff --git a/apps/email/js/ext/mailapi/composer.js b/apps/email/js/ext/mailapi/composer.js | |
index f0f8fdd..21917e4 100644 | |
--- a/apps/email/js/ext/mailapi/composer.js | |
+++ b/apps/email/js/ext/mailapi/composer.js | |
@@ -3893,12 +3893,22 @@ Composer.prototype = { | |
* Request that a body be produced as a single buffer with the given options. | |
* Multiple calls to this method can be made and they may overlap. | |
* | |
+ * XXX: Currently, the callback is invoked with a String instead of an | |
+ * ArrayBuffer/node-like Buffer; consumers that do not use TextEncoder to | |
+ * produce a utf-8 encoding probably need to and we might want to change this | |
+ * here. | |
+ * | |
* @args[ | |
* @param[opts @dict[ | |
* @key[includeBcc Boolean]{ | |
* Should we include the BCC data in the headers? | |
* } | |
* ]] | |
+ * @param[callback @func[ | |
+ * @args[ | |
+ * @param[messageBuffer String] | |
+ * ] | |
+ * ]] | |
* ] | |
*/ | |
withMessageBuffer: function(opts, callback) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment