Twitter: Fix joining room by disabling sending raw xml to backends which do not need it
This commit is contained in:
parent
d85cfa46a7
commit
9ff51c193c
3 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue