Changeset - 9ff51c193cc3
[Not reviewed]
0 3 0
Jan Kaluza - 9 years ago 2016-01-05 15:44:18
jkaluza@redhat.com
Twitter: Fix joining room by disabling sending raw xml to backends which do not need it
3 files changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
backends/twitter/TwitterPlugin.cpp
Show inline comments
 
@@ -177,9 +177,10 @@ void TwitterPlugin::handleLogoutRequest(const std::string &user, const std::stri
 
void TwitterPlugin::handleJoinRoomRequest(const std::string &user, const std::string &room, const std::string &nickname, const std::string &password)
 
{
 
	if(room == adminChatRoom) {	
 
		LOG4CXX_INFO(logger, "Received Join Twitter room request for " << user)
 
		LOG4CXX_INFO(logger, "Received Join Twitter room request for " << user << " '" << nickname << "'")
 

	
 
		setTwitterMode(user, 2);
 
		handleParticipantChanged(user, nickname, room, 0, pbnetwork::STATUS_ONLINE);
 
		handleParticipantChanged(user, adminNickName, room, 0, pbnetwork::STATUS_ONLINE);
 
		userdb[user].nickName = nickname;
 
		handleMessage(user, adminChatRoom, "Connected to Twitter room! Populating your followers list", adminNickName);
libtransport/NetworkPluginServer.cpp
Show inline comments
 
@@ -1103,6 +1103,10 @@ void NetworkPluginServer::handleRawXML(const std::string &xml) {
 
}
 

	
 
void NetworkPluginServer::handleRawPresenceReceived(boost::shared_ptr<Swift::Presence> presence) {
 
	if (!CONFIG_BOOL_DEFAULTED(m_config, "features.rawxml", false)) {
 
		return;
 
	}
 

	
 
	User *user = m_userManager->getUser(presence->getFrom().toBare());
 
	if (!user)
 
		return;
tests/twitter/twitter_test.py
Show inline comments
 
@@ -41,6 +41,7 @@ class Client(sleekxmpp.ClientXMPP):
 
		self.tests["friends2"] = ["#friends after unfollow command", False]
 
		self.tests["mode1"] = ["#mode 1 response", False]
 
		self.tests["mode1buddy"] = ["#mode 1 buddy added", False]
 
		self.tests["mode2"] = ["#mode 2 join room", False]
 

	
 
		self.status = "timeline"
 
		self.timestamp = int(time.time())
 
@@ -83,6 +84,9 @@ class Client(sleekxmpp.ClientXMPP):
 
		roster = iq['roster']['items']
 

	
 
		if self.status == "mode1" and roster.has_key("colinpwheeler@localhost"):
 
			self.plugin['xep_0045'].joinMUC("#twitter@localhost", "client", wait=True)
 
			self.tests["mode2"][1] = True
 
			self.plugin['xep_0045'].leaveMUC("#twitter@localhost", "client")
 
			self.status = "unfollow"
 
			self.tests["mode1buddy"][1] = True
 
			self.send_message(mto="twitter.com@localhost", mbody="#unfollow colinpwheeler")
0 comments (0 inline, 0 general)