Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 109932
Collapse All | Expand All

(-)kcheckgmail-0.5.4.orig/src/gmail.cpp (-21 / +6 lines)
Lines 44-51 Link Here
44
44
45
static const QString 
45
static const QString 
46
gGMailLoginURL = "https://www.google.com/accounts/ServiceLoginBoxAuth",
46
gGMailLoginURL = "https://www.google.com/accounts/ServiceLoginBoxAuth",
47
gGMailLoginPostFormat = "Email=%s&Passwd=%s&null=Sign%%20in&service=mail"
47
gGMailLoginPostFormat = "Email=%s&Passwd=%s&null=Sign%%20in",
48
	"&continue=https://gmail.google.com/gmail",
49
	
48
	
50
gGMailCheckURL = "%s://gmail.google.com/gmail?search=inbox"
49
gGMailCheckURL = "%s://gmail.google.com/gmail?search=inbox"
51
	"&as_subset=unread&view=tl&start=0",
50
	"&as_subset=unread&view=tl&start=0",
Lines 74-83 Link Here
74
{
73
{
75
	delete mCheckLock;
74
	delete mCheckLock;
76
	delete mLoginLock;
75
	delete mLoginLock;
77
	if(mLoginToken) {
76
	if(mLoginToken) 
78
		delete mLoginToken;
79
		mLoginToken = 0;
77
		mLoginToken = 0;
80
	}
81
	delete mCookieMap;
78
	delete mCookieMap;
82
}
79
}
83
80
Lines 97-104 Link Here
97
		
94
		
98
		if(mLoginLock->tryLock()) {
95
		if(mLoginLock->tryLock()) {
99
			if(mLoginToken)
96
			if(mLoginToken)
100
				delete mLoginToken;
97
			    mLoginToken = 0;
101
			mLoginToken = 0;
102
			mLoginLock->unlock();
98
			mLoginLock->unlock();
103
			mLoginFromTimer = false;
99
			mLoginFromTimer = false;
104
			login();
100
			login();
Lines 149-160 Link Here
149
145
150
		mCookieMap->clear();
146
		mCookieMap->clear();
151
		
147
		
152
		QString cookie;
153
		long int t = time(NULL);
154
		cookie.sprintf("T%ld/%ld/%ld", t - 2, t - 1, t);
155
156
		parseCookies("Set-Cookie: GMAIL_LOGIN="+cookie+";");
157
158
		kdDebug() << k_funcinfo << "Waiting for wallet..." << endl;
148
		kdDebug() << k_funcinfo << "Waiting for wallet..." << endl;
159
		// this will call back to gotWalletPassword().
149
		// this will call back to gotWalletPassword().
160
		// we will continue the process from there.
150
		// we will continue the process from there.
Lines 189-200 Link Here
189
	} else {
179
	} else {
190
		QCString str(data, data.size() + 1);
180
		QCString str(data, data.size() + 1);
191
		parseCookies(job->queryMetaData("setcookies"));
181
		parseCookies(job->queryMetaData("setcookies"));
192
		QRegExp rx("auth%3[Dd](.*)&amp;service=mail");
182
		// auth cookie no longer exists, no need to check for it
193
		if(rx.search(str) >= 0) {
183
		mLoginToken = 1;
194
			if(mLoginToken)
195
				delete mLoginToken;
196
			mLoginToken = new QString(rx.cap(1));
197
		} 
198
	}
184
	}
199
}
185
}
200
186
Lines 209-216 Link Here
209
		url.sprintf(gGMailPostLoginURLFormat.ascii(), 
195
		url.sprintf(gGMailPostLoginURLFormat.ascii(), 
210
			(Prefs::useHTTPS()
196
			(Prefs::useHTTPS()
211
				? "https" 
197
				? "https" 
212
				: "http" ), 
198
				: "http" )); 
213
			mLoginToken->ascii());
214
199
215
		KIO::TransferJob *job = KIO::get(url, true, false);
200
		KIO::TransferJob *job = KIO::get(url, true, false);
216
		job->addMetaData("cookies", "manual");
201
		job->addMetaData("cookies", "manual");
(-)kcheckgmail-0.5.4.orig/src/gmail.h (-1 / +1 lines)
Lines 73-79 Link Here
73
	QString mUsername;
73
	QString mUsername;
74
	QString mPasswordHash;
74
	QString mPasswordHash;
75
	QMap<QString,QString> *mCookieMap;
75
	QMap<QString,QString> *mCookieMap;
76
	QString *mLoginToken;
76
	unsigned int mLoginToken;
77
	QString mPageBuffer;
77
	QString mPageBuffer;
78
	
78
	
79
	QTimer *mTimer;
79
	QTimer *mTimer;

Return to bug 109932