]> git.pld-linux.org Git - packages/libpurple-protocol-skypeweb.git/commitdiff
upstream patch to fix links in outgoing messages under bitlbee; rel 4 auto/th/libpurple-protocol-skypeweb-1.7-4
authorJan Palus <atler@pld-linux.org>
Mon, 25 Jan 2021 09:15:19 +0000 (10:15 +0100)
committerJan Palus <atler@pld-linux.org>
Mon, 25 Jan 2021 09:15:19 +0000 (10:15 +0100)
libpurple-protocol-skypeweb.spec
xhtml.patch [new file with mode: 0644]

index 52b622b7fb9ee1015944d56d02ea02b4dbd9b742..4b882e1f05e70496e2e63f2772a2a3dc9e67eaa0 100644 (file)
@@ -1,13 +1,14 @@
 Summary:       SkypeWeb API Plugin for Pidgin/libpurple/Adium
 Name:          libpurple-protocol-skypeweb
 Version:       1.7
-Release:       3
+Release:       4
 License:       GPL v3
 Group:         Applications/Communications
 Source0:       https://github.com/EionRobb/skype4pidgin/archive/%{version}.tar.gz
 # Source0-md5: 6af9359c55f4644fc8848389df582848
 Patch0:                login.patch
 Patch1:                bitlbee_img_url.patch
+Patch2:                xhtml.patch
 URL:           https://github.com/EionRobb/skype4pidgin/tree/master/skypeweb
 BuildRequires: cmake >= 2.8
 BuildRequires: glib2-devel
@@ -25,6 +26,7 @@ and chat with all your Skype buddies from within Pidgin/Adium.
 %setup -qn skype4pidgin-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 cd skypeweb
diff --git a/xhtml.patch b/xhtml.patch
new file mode 100644 (file)
index 0000000..1c66571
--- /dev/null
@@ -0,0 +1,38 @@
+From d0b6b1f1333af9427dd272447e48a0bcd8681619 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus@fastmail.com>
+Date: Mon, 25 Jan 2021 00:26:01 +0100
+Subject: [PATCH] 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.
+---
+ skypeweb/skypeweb_messages.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+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;\r
+       static GRegex *font_strip_regex = NULL;\r
+       gchar *font_stripped;\r
++      char *xhtml;\r
+       \r
+       url = g_strdup_printf("/v1/users/ME/conversations/%s/messages", purple_url_encode(convname));\r
+       \r
+       clientmessageid = skypeweb_get_js_time();\r
+       clientmessageid_str = g_strdup_printf("%" G_GINT64_FORMAT "", clientmessageid);\r
+       \r
++      purple_markup_html_to_xhtml(message, &xhtml, NULL);\r
+       // Some clients don't receive messages with <br>'s in them\r
+-      stripped = purple_strreplace(message, "<br>", "\r\n");\r
++      stripped = purple_strreplace(xhtml, "<br>", "\r\n");\r
++      g_free(xhtml);\r
+       \r
+       // Pidgin has a nasty habit of sending <font size="3"> when copy-pasting text\r
+       if (font_strip_regex == NULL) {\r
This page took 0.108443 seconds and 4 git commands to generate.