Changeset - 16e3bc94250c
[Not reviewed]
0 2 0
Jan Kaluza - 13 years ago 2012-12-10 14:00:16
hanzz.k@gmail.com
set needPassword=false in twitter backend
2 files changed with 11 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/twitter/TwitterPlugin.cpp
Show inline comments
 
@@ -37,12 +37,13 @@ static int cmp(std::string a, std::string b)
 

	
 

	
 
TwitterPlugin::TwitterPlugin(Config *config, Swift::SimpleEventLoop *loop, StorageBackend *storagebackend, const std::string &host, int port) : NetworkPlugin() 
 
{
 
	this->config = config;
 
	this->storagebackend = storagebackend;
 
	this->m_firstPing = true;
 

	
 
	if (CONFIG_HAS_KEY(config, "twitter.consumer_key") == false) {
 
		consumerKey = "5mFePMiJi0KpeURONkelg";
 
	}
 
	else {
 
		consumerKey = CONFIG_STRING(config, "twitter.consumer_key");
 
@@ -101,12 +102,21 @@ void TwitterPlugin::sendData(const std::string &string)
 
	m_conn->write(Swift::createSafeByteArray(string));
 
}
 

	
 
// Receive date from the NetworkPlugin server and invoke the appropirate payload handler (implement in the NetworkPlugin class)
 
void TwitterPlugin::_handleDataRead(boost::shared_ptr<Swift::SafeByteArray> data) 
 
{
 
	if (m_firstPing) {
 
		m_firstPing = false;
 
		// Users can join the network without registering if we allow
 
		// one user to connect multiple IRC networks.
 
		NetworkPlugin::PluginConfig cfg;
 
		cfg.setNeedPassword(false);
 
		sendConfig(cfg);
 
	}
 

	
 
	std::string d(data->begin(), data->end());
 
	handleDataRead(d);
 
}
 

	
 
// User trying to login into his twitter account
 
void TwitterPlugin::handleLoginRequest(const std::string &user, const std::string &legacyName, const std::string &password) 
backends/twitter/TwitterPlugin.h
Show inline comments
 
@@ -171,8 +171,9 @@ class TwitterPlugin : public NetworkPlugin {
 
			std::map<std::string, std::string> buddiesImgs;
 
			mode twitterMode;
 

	
 
			UserData() { sessions = NULL; }
 
		};
 
		std::map<std::string, UserData> userdb;
 
		bool m_firstPing;
 
};
 
#endif
0 comments (0 inline, 0 general)