commit 3b6f794235a8cba68e777e2eb82c6ded9fabffb8
Author: Jan Palus <[email protected]>
Date:   Mon Jan 25 10:15:19 2021 +0100

    upstream patch to fix links in outgoing messages under bitlbee; rel 4

 libpurple-protocol-skypeweb.spec |  4 +++-
 xhtml.patch                      | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)
---
diff --git a/libpurple-protocol-skypeweb.spec b/libpurple-protocol-skypeweb.spec
index 52b622b..4b882e1 100644
--- a/libpurple-protocol-skypeweb.spec
+++ b/libpurple-protocol-skypeweb.spec
@@ -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
index 0000000..1c66571
--- /dev/null
+++ b/xhtml.patch
@@ -0,0 +1,38 @@
+From d0b6b1f1333af9427dd272447e48a0bcd8681619 Mon Sep 17 00:00:00 2001
+From: Jan Palus <[email protected]>
+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;
+       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) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libpurple-protocol-skypeweb.git/commitdiff/3b6f794235a8cba68e777e2eb82c6ded9fabffb8

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to