[packages/libpurple-protocol-skypeweb] upstream patch to fix login inside bitlbee; rel 2

atler atler at pld-linux.org
Sun Jan 24 14:09:57 CET 2021


commit fd0125d2b437a5693d0b39ea4bd12ebaf58d3527
Author: Jan Palus <atler at pld-linux.org>
Date:   Sun Jan 24 14:09:21 2021 +0100

    upstream patch to fix login inside bitlbee; rel 2

 libpurple-protocol-skypeweb.spec |  4 ++-
 login.patch                      | 77 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+), 1 deletion(-)
---
diff --git a/libpurple-protocol-skypeweb.spec b/libpurple-protocol-skypeweb.spec
index 606a3c1..c2deeb1 100644
--- a/libpurple-protocol-skypeweb.spec
+++ b/libpurple-protocol-skypeweb.spec
@@ -1,11 +1,12 @@
 Summary:	SkypeWeb API Plugin for Pidgin/libpurple/Adium
 Name:		libpurple-protocol-skypeweb
 Version:	1.7
-Release:	1
+Release:	2
 License:	GPL v3
 Group:		Applications/Communications
 Source0:	https://github.com/EionRobb/skype4pidgin/archive/%{version}.tar.gz
 # Source0-md5:	6af9359c55f4644fc8848389df582848
+Patch0:		login.patch
 URL:		https://github.com/EionRobb/skype4pidgin/tree/master/skypeweb
 BuildRequires:	cmake >= 2.8
 BuildRequires:	glib2-devel
@@ -21,6 +22,7 @@ and chat with all your Skype buddies from within Pidgin/Adium.
 
 %prep
 %setup -qn skype4pidgin-%{version}
+%patch0 -p1
 
 %build
 cd skypeweb
diff --git a/login.patch b/login.patch
new file mode 100644
index 0000000..0473142
--- /dev/null
+++ b/login.patch
@@ -0,0 +1,77 @@
+From 91b0d8a6114c66bf291ca8142c2ee2df12d3923a Mon Sep 17 00:00:00 2001
+From: bodqhrohro <bodqhrohro at yandex.ru>
+Date: Fri, 25 Sep 2020 17:56:38 +0300
+Subject: [PATCH] Make the opid stage optional
+
+---
+ skypeweb/skypeweb_login.c | 55 ++++++++++++++++++---------------------
+ 1 file changed, 26 insertions(+), 29 deletions(-)
+
+diff --git a/skypeweb/skypeweb_login.c b/skypeweb/skypeweb_login.c
+index 650cd67..a8c9d50 100644
+--- a/skypeweb/skypeweb_login.c
++++ b/skypeweb/skypeweb_login.c
+@@ -259,37 +259,34 @@ skypeweb_login_got_opid(PurpleHttpConnection *http_conn, PurpleHttpResponse *res
+ 	data = purple_http_response_get_data(response, &len);
+ 	
+ 	ppft = skypeweb_string_get_chunk(data, len, ",sFT:'", "',");
+-	if (!ppft) {
+-		purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Failed getting PPFT value, please try logging in via browser first"));
+-		return;
+-	}
+ 	opid = skypeweb_string_get_chunk(data, len, "&opid=", "'");
+-	if (!opid) {
+-		purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, _("Failed getting opid value, try using 'Alternate Auth Method' settings"));
+-		return;
++	if (!ppft || !opid) {
++		// Maybe this stage isn't needed this time: passing over the Magic T
++		skypeweb_login_got_t(http_conn, response, user_data);
++	} else {
++		postdata = g_string_new("");
++		g_string_append_printf(postdata, "opid=%s&", purple_url_encode(opid));
++		g_string_append(postdata, "site_name=lw.skype.com&");
++		g_string_append(postdata, "oauthPartner=999&");
++		g_string_append(postdata, "client_id=578134&");
++		g_string_append(postdata, "redirect_uri=https%3A%2F%2Fweb.skype.com&");
++		g_string_append_printf(postdata, "PPFT=%s&", purple_url_encode(ppft));
++		g_string_append(postdata, "type=28&");
++
++		tmplen = postdata->len;
++		if (postdata->len > INT_MAX) tmplen = INT_MAX;
++
++		request = purple_http_request_new(live_login_url);
++		purple_http_request_set_method(request, "POST");
++		purple_http_request_set_cookie_jar(request, sa->cookie_jar);
++		purple_http_request_header_set(request, "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
++		purple_http_request_header_set(request, "Accept", "*/*");
++		purple_http_request_set_contents(request, postdata->str, tmplen);
++		purple_http_request(sa->pc, request, skypeweb_login_got_t, sa);
++		purple_http_request_unref(request);
++
++		g_string_free(postdata, TRUE);
+ 	}
+-	postdata = g_string_new("");
+-	g_string_append_printf(postdata, "opid=%s&", purple_url_encode(opid));
+-	g_string_append(postdata, "site_name=lw.skype.com&");
+-	g_string_append(postdata, "oauthPartner=999&");
+-	g_string_append(postdata, "client_id=578134&");
+-	g_string_append(postdata, "redirect_uri=https%3A%2F%2Fweb.skype.com&");
+-	g_string_append_printf(postdata, "PPFT=%s&", purple_url_encode(ppft));
+-	g_string_append(postdata, "type=28&");
+-
+-	tmplen = postdata->len;
+-	if (postdata->len > INT_MAX) tmplen = INT_MAX;
+-	
+-	request = purple_http_request_new(live_login_url);
+-	purple_http_request_set_method(request, "POST");
+-	purple_http_request_set_cookie_jar(request, sa->cookie_jar);
+-	purple_http_request_header_set(request, "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+-	purple_http_request_header_set(request, "Accept", "*/*");
+-	purple_http_request_set_contents(request, postdata->str, tmplen);
+-	purple_http_request(sa->pc, request, skypeweb_login_got_t, sa);
+-	purple_http_request_unref(request);
+-	
+-	g_string_free(postdata, TRUE);
+ 	
+ 	g_free(ppft);
+ 	g_free(opid);
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list