File: OAuthFlow.cpp

package info (click to toggle)
spectrum2 2.2.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,548 kB
  • sloc: cpp: 32,594; python: 1,751; javascript: 273; makefile: 34; sql: 31; xml: 10
file content (19 lines) | stat: -rw-r--r-- 751 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "OAuthFlow.h"
DEFINE_LOGGER(oauthFlowRequestLogger, "OAuthFlow")
void OAuthFlow::run()
{
	success = twitObj->oAuthRequestToken( authUrl );
}

void OAuthFlow::finalize()
{
	if (!success) {
		LOG4CXX_ERROR(oauthFlowRequestLogger, "Error creating twitter authorization url!");
		np->handleMessage(user, "twitter.com", "Error creating twitter authorization url!");
		np->handleLogoutRequest(user, username);
	} else {
		np->handleMessage(user, "twitter.com", std::string("Please visit the following link and authorize this application: ") + authUrl);
		np->handleMessage(user, "twitter.com", std::string("Please reply with the PIN provided by twitter. Prefix the pin with '#pin'. Ex. '#pin 1234'"));
		np->OAuthFlowComplete(user, twitObj);
	}	
}