Gentoo Archives: gentoo-commits

From: "Jorge Manuel B. S. Vicetto (jmbsvicetto)" <jmbsvicetto@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in kde-base/kopete/files: kopete-4.4.2-yahoo-stealth-fix.patch
Date: Sun, 04 Apr 2010 15:51:51
Message-Id: E1NyS72-0002Iv-6Z@stork.gentoo.org
1 jmbsvicetto 10/04/04 15:51:48
2
3 Added: kopete-4.4.2-yahoo-stealth-fix.patch
4 Log:
5 [kde-base/kopete-4.4.2-r1] Revbumped kopete to apply a few fixes:
6 Added upstream patch to fix issues with yahoo and stealth. Fixes bug 311445 - thanks to Navid Zamani <navid.zamani@××××××××××.com>.
7 Replaced bonjour with zeroconf use flag. Fixes bug 307105 - thanks to Doktor Notor <notordoktor@×××××.com>.
8 Added explicit dep on kde-base/qimageblitz. Fixes bug 307803.
9 (Portage version: 2.2_rc67/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.1 kde-base/kopete/files/kopete-4.4.2-yahoo-stealth-fix.patch
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kopete/files/kopete-4.4.2-yahoo-stealth-fix.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/kde-base/kopete/files/kopete-4.4.2-yahoo-stealth-fix.patch?rev=1.1&content-type=text/plain
16
17 Index: kopete-4.4.2-yahoo-stealth-fix.patch
18 ===================================================================
19 Index: kopete/protocols/yahoo/libkyahoo/listtask.cpp
20 ===================================================================
21 --- kopete/protocols/yahoo/libkyahoo/listtask.cpp (revision 1110517)
22 +++ kopete/protocols/yahoo/libkyahoo/listtask.cpp (working copy)
23 @@ -34,9 +34,6 @@
24
25 }
26
27 -QStringList loginstealthedbuddies;
28 -QStringList loginunstealthedbuddies;
29 -
30 bool ListTask::take( Transfer* transfer )
31 {
32 if ( !forMe( transfer ) )
33 @@ -85,47 +82,30 @@
34 case 301:
35 if( p.second == "319"){
36 emit gotBuddy( buddy, QString(), group );
37 - /**
38 - * Note: michaelacole
39 - * Since you can log in from other places and remove or add Perm Offline status
40 - * We have to reset both conditions at login
41 - * Yahoo sends this data at this time,
42 - * so better to compile list of both now then notify kopete client.
43 - */
44 - loginunstealthedbuddies.append( buddy );
45 }
46 break;
47 case 317:
48 if( p.second == "2"){
49 - kDebug(YAHOO_RAW_DEBUG) << "Stealthed setting on" << buddy ;
50 - /** Note: michaelacole
51 - * Since you can log in from other places and remove or add Perm Offline status
52 - * We have to reset both conditions at login
53 - * Yahoo sends this data at this time,
54 - * so better to compile list of both now then notify kopete client.
55 - */
56 - loginstealthedbuddies.append( buddy );
57 - loginunstealthedbuddies.removeAll( buddy );
58 + kDebug(YAHOO_RAW_DEBUG) << "Stealthed setting on" << buddy ;
59 + emit stealthStatusChanged( buddy, Yahoo::StealthActive );
60 };
61 break;
62 - /**
63 - * Note: michaelacole
64 - * Other buddy codes are here for add to list and blacklist
65 - * I will need to capute more codes for addition here.
66 - * Blacklist is done on the server at Yahoo whereas
67 - * Kopete has its own plugin for blacklisting.
68 - */
69 + /**
70 + * Note: michaelacole
71 + * Other buddy codes are here for add to list and blacklist
72 + * I will need to capute more codes for addition here.
73 + * Blacklist is done on the server at Yahoo whereas
74 + * Kopete has its own plugin for blacklisting.
75 + */
76 }
77 }
78 - /**
79 - * Note: michaelacole
80 - * Since you can log in from other places and remove or add Perm Offline status
81 - * We have to reset both conditions at login
82 - * Yahoo sends this data at this time,
83 - * so better to compile list of both now then notify kopete client.
84 - */
85 - client()->notifyUnstealthedBuddies( loginunstealthedbuddies );
86 - client()->notifyStealthedBuddies( loginstealthedbuddies );
87 + /**
88 + * Note: michaelacole
89 + * Since you can log in from other places and remove or add Perm Offline status
90 + * We have to reset both conditions at login
91 + * Yahoo sends this data at this time,
92 + * so better to compile list of both now then notify kopete client.
93 + */
94 }
95
96
97 Index: kopete/protocols/yahoo/libkyahoo/client.cpp
98 ===================================================================
99 --- kopete/protocols/yahoo/libkyahoo/client.cpp (revision 1110517)
100 +++ kopete/protocols/yahoo/libkyahoo/client.cpp (working copy)
101 @@ -76,8 +76,7 @@
102 int error;
103 QString errorString;
104 QString errorInformation;
105 - QStringList stealthedBuddies;
106 - QStringList unstealthedBuddies;
107 + QSet<QString> stealthedBuddies;
108 // tasks
109 bool tasksInitialized;
110 LoginTask * loginTask;
111 @@ -133,14 +132,13 @@
112
113 QObject::connect( d->loginTask, SIGNAL( haveSessionID( uint ) ), SLOT( lt_gotSessionID( uint ) ) );
114 QObject::connect( d->loginTask, SIGNAL( buddyListReady() ), SLOT( processPictureQueue() ) );
115 - QObject::connect( d->loginTask, SIGNAL( buddyListReady() ), SLOT( processStealthQueue() ) );
116 QObject::connect( d->loginTask, SIGNAL( loginResponse( int, const QString& ) ),
117 SLOT( slotLoginResponse( int, const QString& ) ) );
118 QObject::connect( d->loginTask, SIGNAL( haveCookies() ), SLOT( slotGotCookies() ) );
119 QObject::connect( d->listTask, SIGNAL( gotBuddy(const QString &, const QString &, const QString &) ),
120 SIGNAL( gotBuddy(const QString &, const QString &, const QString &) ) );
121 QObject::connect( d->listTask, SIGNAL( stealthStatusChanged( const QString&, Yahoo::StealthStatus ) ),
122 - SIGNAL( stealthStatusChanged( const QString&, Yahoo::StealthStatus ) ) );
123 + SLOT( notifyStealthStatusChanged( const QString&, Yahoo::StealthStatus ) ) );
124 }
125
126 Client::~Client()
127 @@ -182,9 +180,11 @@
128 emit connected();
129 kDebug(YAHOO_RAW_DEBUG) << " starting login task ... ";
130
131 + // Clear stealth settings
132 + d->stealthedBuddies.clear();
133 +
134 d->loginTask->setStateOnConnect( (d->statusOnConnect == Yahoo::StatusInvisible) ? Yahoo::StatusInvisible : Yahoo::StatusAvailable );
135 d->loginTask->go();
136 - processStealthQueue();
137 d->active = true;
138 }
139
140 @@ -615,29 +615,6 @@
141 spt->go( true );
142 }
143
144 -// **** Stealth Handling **** michaelacole
145 -void Client::processStealthQueue()
146 -{
147 - if( d->buddyListReady ){
148 - while (!d->unstealthedBuddies.isEmpty())
149 - {
150 - QString it;
151 - it = d->unstealthedBuddies.takeFirst();
152 - kDebug(YAHOO_RAW_DEBUG) << "unstealthed setting set on" << it;
153 - stealthContact( it, Yahoo::StealthOffline , Yahoo::StealthNotActive );
154 - }
155 -
156 - while (!d->stealthedBuddies.isEmpty())
157 - {
158 - QString it;
159 - it = d->stealthedBuddies.takeFirst();
160 - kDebug(YAHOO_RAW_DEBUG) << "stealthed setting set on" << it ;
161 - stealthContact( it, Yahoo::StealthPermOffline , Yahoo::StealthActive );
162 - }
163 - }
164 -}
165 -
166 -
167 // ***** Webcam handling *****
168
169 void Client::requestWebcam( const QString &userId )
170 @@ -767,14 +744,22 @@
171 emit error( level );
172 }
173
174 -void Client::notifyStealthedBuddies( const QStringList &buddies)
175 +Yahoo::StealthStatus Client::stealthStatus( const QString &userId ) const
176 {
177 - d->stealthedBuddies = buddies;
178 + if ( d->stealthedBuddies.contains( userId ) )
179 + return Yahoo::StealthActive;
180 + else
181 + return Yahoo::StealthNotActive;
182 }
183
184 -void Client::notifyUnstealthedBuddies( const QStringList &buddies)
185 +void Client::notifyStealthStatusChanged( const QString &userId, Yahoo::StealthStatus state )
186 {
187 - d->unstealthedBuddies = buddies;
188 + if ( state == Yahoo::StealthActive )
189 + d->stealthedBuddies.insert( userId );
190 + else
191 + d->stealthedBuddies.remove( userId );
192 +
193 + emit stealthStatusChanged( userId, state );
194 }
195
196 QString Client::userId()
197 @@ -902,7 +887,7 @@
198 QObject::connect( d->statusTask, SIGNAL( statusChanged(QString,int,const QString,int,int,int) ),
199 SIGNAL( statusChanged(QString,int,const QString,int,int,int) ) );
200 QObject::connect( d->statusTask, SIGNAL( stealthStatusChanged( const QString&, Yahoo::StealthStatus ) ),
201 - SIGNAL( stealthStatusChanged( const QString&, Yahoo::StealthStatus ) ) );
202 + SLOT( notifyStealthStatusChanged( const QString&, Yahoo::StealthStatus ) ) );
203 QObject::connect( d->statusTask, SIGNAL( loginResponse( int, const QString& ) ),
204 SLOT( slotLoginResponse( int, const QString& ) ) );
205 QObject::connect( d->statusTask, SIGNAL( authorizationRejected( const QString&, const QString& ) ),
206 Index: kopete/protocols/yahoo/libkyahoo/listtask.h
207 ===================================================================
208 --- kopete/protocols/yahoo/libkyahoo/listtask.h (revision 1110517)
209 +++ kopete/protocols/yahoo/libkyahoo/listtask.h (working copy)
210 @@ -40,7 +40,7 @@
211
212 signals:
213 void gotBuddy(const QString&, const QString&, const QString&);
214 -
215 + void stealthStatusChanged( const QString&, Yahoo::StealthStatus );
216 };
217
218 #endif
219 Index: kopete/protocols/yahoo/libkyahoo/client.h
220 ===================================================================
221 --- kopete/protocols/yahoo/libkyahoo/client.h (revision 1110517)
222 +++ kopete/protocols/yahoo/libkyahoo/client.h (working copy)
223 @@ -189,6 +189,12 @@
224 void stealthContact( QString const &userId, Yahoo::StealthMode mode, Yahoo::StealthStatus state );
225
226 /**
227 + * Get the stealth status of a buddy
228 + * @param userId the yahoo ID of the buddy
229 + */
230 + Yahoo::StealthStatus stealthStatus( const QString &userId ) const;
231 +
232 + /**
233 * Request the buddy's picture
234 * @param userId the yahoo ID of the buddy
235 */
236 @@ -456,12 +462,6 @@
237 */
238 void notifyError( const QString &info, const QString &errorString, LogLevel level );
239
240 - /**
241 - * Steathed information from login..
242 - */
243 - void notifyStealthedBuddies( const QStringList &buddies);
244 - void notifyUnstealthedBuddies( const QStringList &buddies);
245 -
246 signals:
247 /** CONNECTION EVENTS */
248 /**
249 @@ -723,10 +723,10 @@
250 */
251 void processPictureQueue();
252
253 - /**
254 - * Update all Stealth info after login
255 + /**
256 + * Steathed information from login..
257 */
258 - void processStealthQueue();
259 + void notifyStealthStatusChanged( const QString &, Yahoo::StealthStatus );
260
261 private:
262 void distribute( Transfer *transfer );
263 Index: kopete/protocols/yahoo/yahoocontact.h
264 ===================================================================
265 --- kopete/protocols/yahoo/yahoocontact.h (revision 1110517)
266 +++ kopete/protocols/yahoo/yahoocontact.h (working copy)
267 @@ -56,8 +56,8 @@
268
269 void setOnlineStatus(const Kopete::OnlineStatus &status);
270 void setYahooStatus( const Kopete::OnlineStatus& );
271 - void setStealthed( bool );
272 - bool stealthed();
273 + void updateStealthed();
274 + bool stealthed() const;
275
276
277 /** The group name getter and setter methods**/
278 @@ -121,7 +121,6 @@
279 YahooChatSession *m_manager;
280 YahooWebcamDialog* m_webcamDialog;
281 YahooAccount* m_account;
282 - bool m_stealthed;
283 bool m_receivingWebcam;
284 bool m_sessionActive;
285
286 Index: kopete/protocols/yahoo/yahoocontact.cpp
287 ===================================================================
288 --- kopete/protocols/yahoo/yahoocontact.cpp (revision 1110517)
289 +++ kopete/protocols/yahoo/yahoocontact.cpp (working copy)
290 @@ -74,7 +74,6 @@
291 m_manager = 0L;
292 m_account = account;
293 m_YABEntry = 0L;
294 - m_stealthed = false;
295 m_receivingWebcam = false;
296 m_sessionActive = false;
297
298 @@ -109,7 +108,8 @@
299
300 void YahooContact::setOnlineStatus(const Kopete::OnlineStatus &status)
301 {
302 - if( m_stealthed && status.internalStatus() <= 999) // Not Stealted -> Stealthed
303 + bool isStealthed = stealthed();
304 + if( isStealthed && status.internalStatus() <= 999) // Not Stealted -> Stealthed
305 {
306 Contact::setOnlineStatus(
307 Kopete::OnlineStatus(status.status() ,
308 @@ -119,7 +119,7 @@
309 status.overlayIcons() + QStringList("yahoo_stealthed") ,
310 i18n("%1|Stealthed", status.description() ) ) );
311 }
312 - else if( !m_stealthed && status.internalStatus() > 999 )// Stealthed -> Not Stealthed
313 + else if( !isStealthed && status.internalStatus() > 999 )// Stealthed -> Not Stealthed
314 Contact::setOnlineStatus( static_cast< YahooProtocol *>( protocol() )->statusFromYahoo( status.internalStatus() - 1000 ) );
315 else
316 Contact::setOnlineStatus( status );
317 @@ -128,15 +128,14 @@
318 setStatusMessage( Kopete::StatusMessage() );
319 }
320
321 -void YahooContact::setStealthed( bool stealthed )
322 +void YahooContact::updateStealthed()
323 {
324 - m_stealthed = stealthed;
325 setOnlineStatus( onlineStatus() );
326 }
327
328 -bool YahooContact::stealthed()
329 +bool YahooContact::stealthed() const
330 {
331 - return m_stealthed;
332 + return (m_account->yahooSession()->stealthStatus( m_userId ) == Yahoo::StealthActive );
333 }
334
335 void YahooContact::serialize(QMap<QString, QString> &serializedData, QMap<QString, QString> &addressBookData)
336 Index: kopete/protocols/yahoo/yahooaccount.cpp
337 ===================================================================
338 --- kopete/protocols/yahoo/yahooaccount.cpp (revision 1110517)
339 +++ kopete/protocols/yahoo/yahooaccount.cpp (working copy)
340 @@ -978,7 +978,7 @@
341 kDebug(YAHOO_GEN_DEBUG) << "contact " << who << " doesn't exist.";
342 return;
343 }
344 - kc->setStealthed( state == Yahoo::StealthActive );
345 + kc->updateStealthed();
346 }
347
348 QString YahooAccount::prepareIncomingMessage( const QString &messageText )