Changeset - 5a445b490f54
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-08-14 21:26:39
hanzz.k@gmail.com
check protocol before connecting user
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -174,24 +174,29 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
			std::string name = legacyName;
 
			std::string protocol = CONFIG_STRING(config, "service.protocol");
 
			if (CONFIG_STRING(config, "service.protocol") == "any") {
 
				protocol = name.substr(0, name.find("."));
 
				name = name.substr(name.find(".") + 1);
 
			}
 

	
 
			if (password.empty()) {
 
				np->handleDisconnected(user, name, 0, "Empty password.");
 
				return;
 
			}
 

	
 
			if (!purple_find_prpl(protocol.c_str())) {
 
				np->handleDisconnected(user, name, 0, "Invalid protocol " + protocol);
 
				return;
 
			}
 

	
 
			LOG4CXX_INFO(logger,  "Creating account with name '" << name.c_str() << "' and protocol '" << protocol << "'");
 
			if (purple_accounts_find(name.c_str(), protocol.c_str()) != NULL){
 
// 				Log(user, "this account already exists");
 
				account = purple_accounts_find(name.c_str(), protocol.c_str());
 
// 				User *u = (User *) account->ui_data;
 
// 				if (u && u != user) {
 
// 					Log(userInfo.jid, "This account is already connected by another jid " << user->getJID());
 
// 					return;
 
// 				}
 
			}
 
			else {
 
// 				Log(user, "creating new account");
0 comments (0 inline, 0 general)