--- a/libpurple/protocols/sametime/im_mime.c Fri Nov 15 01:07:08 2019 -0600
+++ b/libpurple/protocols/sametime/im_mime.c Fri Nov 15 05:16:04 2019 -0500
@@ -217,8 +217,9 @@
- return g_strdup_printf("%03x@%05xmeanwhile",
- g_random_int() & 0xfff, g_random_int() & 0xfffff);
+ gint id = g_random_int(); + return g_strdup_printf("%03x@%05xmeanwhile", (id & 0xfff00000) >> 20, @@ -226,8 +227,9 @@
- return g_strdup_printf("related_MW%03x_%04x",
- g_random_int() & 0xfff, g_random_int() & 0xffff);
+ gint id = g_random_int(); + return g_strdup_printf("related_MW%03x_%04x", (id & 0xfff0000) >> 16, /** create MIME image from purple image */
--- a/libpurple/protocols/sametime/tests/data/mime-basic.h Fri Nov 15 01:07:08 2019 -0600
+++ b/libpurple/protocols/sametime/tests/data/mime-basic.h Fri Nov 15 05:16:04 2019 -0500
@@ -3,32 +3,32 @@
- "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n"
+ "Content-Type: multipart/related; boundary=related_MWc7f_0aac\r\n" "Content-Disposition: inline\r\n"
- "--related_MWa2f_0aac\r\n"
+ "--related_MWc7f_0aac\r\n" "Content-Type: text/html; charset=us-ascii\r\n"
"Content-Disposition: inline\r\n"
"Content-Transfer-Encoding: 7bit\r\n"
- "--related_MWa2f_0aac--\r\n"
+ "--related_MWc7f_0aac--\r\n" .html = "This is a test of the MIME encoding using a short message.",
- "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n"
+ "Content-Type: multipart/related; boundary=related_MWc7f_0aac\r\n" "Content-Disposition: inline\r\n"
- "--related_MWa2f_0aac\r\n"
+ "--related_MWc7f_0aac\r\n" "Content-Type: text/html; charset=us-ascii\r\n"
"Content-Disposition: inline\r\n"
"Content-Transfer-Encoding: 7bit\r\n"
"This is a test of the MIME encoding using a short message.\r\n"
- "--related_MWa2f_0aac--\r\n"
+ "--related_MWc7f_0aac--\r\n" --- a/libpurple/protocols/sametime/tests/data/mime-image.h Fri Nov 15 01:07:08 2019 -0600
+++ b/libpurple/protocols/sametime/tests/data/mime-image.h Fri Nov 15 05:16:04 2019 -0500
@@ -5,29 +5,29 @@
"This is a test of the MIME encoding with an image: "
"<img src=\"" PURPLE_IMAGE_STORE_PROTOCOL "%u\">",
- "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n"
+ "Content-Type: multipart/related; boundary=related_MWc7f_0aac\r\n" "Content-Disposition: inline\r\n"
- "--related_MWa2f_0aac\r\n"
+ "--related_MWc7f_0aac\r\n" "Content-Type: text/html; charset=us-ascii\r\n"
"Content-Disposition: inline\r\n"
"Content-Transfer-Encoding: 7bit\r\n"
"This is a test of the MIME encoding with an image: "
- "<img src=\"cid:cc0@6a675meanwhile\">\r\n"
- "--related_MWa2f_0aac\r\n"
+ "<img src=\"cid:97c@4aa2fmeanwhile\">\r\n" + "--related_MWc7f_0aac\r\n" "Content-Type: image/png; "
"name=c6e846b12072e3bdf2c8f768e776deaa94c970ad.png\r\n"
"Content-Disposition: attachment;\r\n"
"\tfilename=c6e846b12072e3bdf2c8f768e776deaa94c970ad.png\r\n"
"Content-Transfer-Encoding: base64\r\n"
- "Content-Id: <cc0@6a675meanwhile>\r\n"
+ "Content-Id: <97c@4aa2fmeanwhile>\r\n" "iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA\r\n"
"B3RJTUUH4AoCFjAiKKTJ3QAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH\r\n"
"AAAAFklEQVQI12P4//8/AwMD47NMtZtOCwAvqQYvitHGswAAAABJRU5ErkJggg==\r\n"
- "--related_MWa2f_0aac--\r\n",
+ "--related_MWc7f_0aac--\r\n", --- a/libpurple/protocols/sametime/tests/data/mime-multiline.h Fri Nov 15 01:07:08 2019 -0600
+++ b/libpurple/protocols/sametime/tests/data/mime-multiline.h Fri Nov 15 05:16:04 2019 -0500
@@ -5,34 +5,34 @@
"This is a test of the MIME encoding using a multiline message.\n"
"This is the second line of the message.",
- "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n"
+ "Content-Type: multipart/related; boundary=related_MWc7f_0aac\r\n" "Content-Disposition: inline\r\n"
- "--related_MWa2f_0aac\r\n"
+ "--related_MWc7f_0aac\r\n" "Content-Type: text/html; charset=us-ascii\r\n"
"Content-Disposition: inline\r\n"
"Content-Transfer-Encoding: 7bit\r\n"
"This is a test of the MIME encoding using a multiline message.\r\n"
"This is the second line of the message.\r\n"
- "--related_MWa2f_0aac--\r\n"
+ "--related_MWc7f_0aac--\r\n" /* A message that ends with a newline. */
.name = "trailing-newline",
.html = "This is a test of the MIME encoding using a multiline message.\n",
- "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n"
+ "Content-Type: multipart/related; boundary=related_MWc7f_0aac\r\n" "Content-Disposition: inline\r\n"
- "--related_MWa2f_0aac\r\n"
+ "--related_MWc7f_0aac\r\n" "Content-Type: text/html; charset=us-ascii\r\n"
"Content-Disposition: inline\r\n"
"Content-Transfer-Encoding: 7bit\r\n"
"This is a test of the MIME encoding using a multiline message.\r\n"
- "--related_MWa2f_0aac--\r\n"
+ "--related_MWc7f_0aac--\r\n" --- a/libpurple/protocols/sametime/tests/data/mime-utf8.h Fri Nov 15 01:07:08 2019 -0600
+++ b/libpurple/protocols/sametime/tests/data/mime-utf8.h Fri Nov 15 05:16:04 2019 -0500
@@ -3,11 +3,11 @@
.html = "Hello world, Καλημέρα κόσμε, コンニチハ.",
- "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n"
+ "Content-Type: multipart/related; boundary=related_MWc7f_0aac\r\n" "Content-Disposition: inline\r\n"
- "--related_MWa2f_0aac\r\n"
+ "--related_MWc7f_0aac\r\n" "Content-Type: text/html; charset=us-ascii\r\n"
"Content-Disposition: inline\r\n"
"Content-Transfer-Encoding: 7bit\r\n"
@@ -16,7 +16,7 @@
"Καλημέρα "
"κόσμε, "
"コンニチハ.\r\n"
- "--related_MWa2f_0aac--\r\n"
+ "--related_MWc7f_0aac--\r\n" /* Hello world in UTF-8. */
@@ -27,11 +27,11 @@
"–—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд "
"∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა",
- "Content-Type: multipart/related; boundary=related_MWa2f_0aac\r\n"
+ "Content-Type: multipart/related; boundary=related_MWc7f_0aac\r\n" "Content-Disposition: inline\r\n"
- "--related_MWa2f_0aac\r\n"
+ "--related_MWc7f_0aac\r\n" "Content-Type: text/html; charset=us-ascii\r\n"
"Content-Disposition: inline\r\n"
"Content-Transfer-Encoding: 7bit\r\n"
@@ -45,5 +45,5 @@
"↑↗↨↻⇣ "
"┐┼╔╘░►☺♀ "
"fi�⑀₂ἠḂӥẄɐː⍎אԱა\r\n"
- "--related_MWa2f_0aac--\r\n"
+ "--related_MWc7f_0aac--\r\n"