Changeset - ae29c8c90253
[Not reviewed]
Merge
0 6 0
HanzZ - 13 years ago 2012-12-06 19:14:40
hanzz.k@gmail.com
Merge branch 'master' of github.com:hanzz/libtransport
2 files changed with 10 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/conversation.cpp
Show inline comments
 
@@ -47,21 +47,28 @@ void Conversation::destroyRoom() {
 
			legacyName.replace(legacyName.find_last_of("@"), 1, "%"); // OK
 
		}
 
		presence->setFrom(Swift::JID(legacyName, m_conversationManager->getComponent()->getJID().toBare(), m_nickname));
 
		presence->setTo(m_jid);
 
		presence->setType(Swift::Presence::Unavailable);
 

	
 
		Swift::MUCItem item;
 
		item.affiliation = Swift::MUCOccupant::NoAffiliation;
 
		item.role = Swift::MUCOccupant::NoRole;
 
		item.actor = "Transport";
 
		item.reason = "Spectrum 2 transport is being shut down.";
 
		Swift::MUCUserPayload *p = new Swift::MUCUserPayload ();
 
		p->addItem(item);
 

	
 
		Swift::MUCUserPayload::StatusCode c;
 
		c.code = 332;
 
		p->addStatusCode(c);
 
		Swift::MUCUserPayload::StatusCode c2;
 
		c2.code = 307;
 
		p->addStatusCode(c2);
 

	
 
		presence->addPayload(boost::shared_ptr<Swift::Payload>(p));
 
		m_conversationManager->getComponent()->getStanzaChannel()->sendPresence(presence);
 
		BOOST_FOREACH(const Swift::JID &jid, m_jids) {
 
			presence->setTo(jid);
 
			m_conversationManager->getComponent()->getStanzaChannel()->sendPresence(presence);
 
		}
 
	}
 
}
 

	
src/tests/conversationmanager.cpp
Show inline comments
 
@@ -402,7 +402,7 @@ class ConversationManagerTest : public CPPUNIT_NS :: TestFixture, public BasicTe
 
		User *user = userManager->getUser("user@localhost");
 
		TestingConversation *conv = new TestingConversation(user->getConversationManager(), "#room", true);
 
		conv->setNickname("nickname");
 
		conv->setJID("user@localhost/resource");
 
		conv->addJID("user@localhost/resource");
 
		received.clear();
 
		conv->destroyRoom();
 
		delete conv;
0 comments (0 inline, 0 general)