summaryrefslogtreecommitdiff
path: root/kde-unstable/kdeplasma-addons/fix-twitter-auth.patch
blob: 0a55ce6ce724e79c35b95f0327bcfc69679c44b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
commit edc7699f4f4b6d9fc0568b031143cb653ae4294e
Author: Sebastian Kügler <sebas@kde.org>
Date:   Tue Jul 10 00:56:58 2012 +0200

    fix authorization from twitter applet
    
    user in authorize() can be empty when it's already set in d->user,
    respect that and successfully authorize.
    
    Thanks to phoenix_fbrd for finding this issue and the patch.
    
    REVIEW:105498
    BUG:302267
    
    Please reopen the bug report if you still encounter crashes.
    
    Cherry-picked from 28f6d7cee7e81fda9ba396cc6477370a8ed3ada7

diff --git a/dataengines/microblog/koauth.cpp b/dataengines/microblog/koauth.cpp
index 565d79f..7566b95 100644
--- a/dataengines/microblog/koauth.cpp
+++ b/dataengines/microblog/koauth.cpp
@@ -168,13 +168,15 @@ void KOAuth::run()
 
 void KOAuth::authorize(const QString &serviceBaseUrl, const QString &user, const QString &password)
 {
-    d->user = user;
+    if (!user.isEmpty()) {
+        d->user = user;
+    }
     d->password = password;
     d->serviceBaseUrl = serviceBaseUrl;
     d->accessToken = QByteArray();
     d->accessTokenSecret = QByteArray();
 
-    d->w->setUser(user);
+    d->w->setUser(d->user);
     d->w->setServiceBaseUrl(serviceBaseUrl);
     d->w->setPassword(password);