Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/skype4pidgin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Palus <jpalus@fastmail.com>2021-01-25 02:26:01 +0300
committerJan Palus <jpalus@fastmail.com>2021-01-25 02:36:05 +0300
commitd0b6b1f1333af9427dd272447e48a0bcd8681619 (patch)
tree205e72e5406f811d03fb33ae992e4c9c1ad8495c
parent15e7cbc3441445bc0bd76143154fc51724c13747 (diff)
Ensure sent message is in XHTML format
It appears that Skype client is very sensitive to type of message that is being sent. Implicit linkifing through `purple_markup_linkify()` for some reason adds links with uppercase "<A HREF" which is ignored by skype client. While Pidgin itself seems to handle it correctly, it is not the case for all libpurple clients ie BitlBee. Follow other protocols (ie Jabber) and ensure message is XHTML before sending.
-rw-r--r--skypeweb/skypeweb_messages.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/skypeweb/skypeweb_messages.c b/skypeweb/skypeweb_messages.c
index ccd8f8d..8e6ba79 100644
--- a/skypeweb/skypeweb_messages.c
+++ b/skypeweb/skypeweb_messages.c
@@ -1487,14 +1487,17 @@ skypeweb_send_message(SkypeWebAccount *sa, const gchar *convname, const gchar *m
gchar *stripped;
static GRegex *font_strip_regex = NULL;
gchar *font_stripped;
+ char *xhtml;
url = g_strdup_printf("/v1/users/ME/conversations/%s/messages", purple_url_encode(convname));
clientmessageid = skypeweb_get_js_time();
clientmessageid_str = g_strdup_printf("%" G_GINT64_FORMAT "", clientmessageid);
+ purple_markup_html_to_xhtml(message, &xhtml, NULL);
// Some clients don't receive messages with <br>'s in them
- stripped = purple_strreplace(message, "<br>", "\r\n");
+ stripped = purple_strreplace(xhtml, "<br>", "\r\n");
+ g_free(xhtml);
// Pidgin has a nasty habit of sending <font size="3"> when copy-pasting text
if (font_strip_regex == NULL) {