Changeset - 19786b3bb708
[Not reviewed]
0 3 0
HanzZ - 14 years ago 2011-09-26 21:09:41
hanzz.k@gmail.com
Fixed compilation with latest swiften
3 files changed with 13 insertions and 5 deletions:
0 comments (0 inline, 0 general)
include/Swiften/Network/DummyNetworkFactories.h
Show inline comments
 
@@ -11,31 +11,35 @@
 
namespace Swift {
 
	class EventLoop;
 

	
 
	class DummyNetworkFactories : public NetworkFactories {
 
		public:
 
			DummyNetworkFactories(EventLoop *eventLoop);
 
			~DummyNetworkFactories();
 

	
 
			virtual TimerFactory* getTimerFactory() const {
 
				return timerFactory;
 
			}
 

	
 
			virtual ConnectionFactory* getConnectionFactory() const {
 
				return connectionFactory;
 
			}
 

	
 
			DomainNameResolver* getDomainNameResolver() const {
 
				return domainNameResolver;
 
			}
 

	
 
			ConnectionServerFactory* getConnectionServerFactory() const {
 
				return connectionServerFactory;
 
			}
 

	
 
			virtual Swift::NATTraverser* getNATTraverser() const {
 
				return 0;
 
			}
 

	
 
		private:
 
			TimerFactory* timerFactory;
 
			ConnectionFactory* connectionFactory;
 
			DomainNameResolver* domainNameResolver;
 
			ConnectionServerFactory* connectionServerFactory;
 
	};
 
}
spectrum_manager/src/CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC *.cpp)
 
 
ADD_EXECUTABLE(spectrum_manager ${SRC})
 
ADD_EXECUTABLE(spectrum2_manager ${SRC})
 
 
target_link_libraries(spectrum_manager transport)
 
target_link_libraries(spectrum2_manager transport)
 
 
INSTALL(TARGETS spectrum_manager RUNTIME DESTINATION bin)
 
INSTALL(TARGETS spectrum2_manager RUNTIME DESTINATION bin)
 
 
INSTALL(FILES
 
	spectrum_manager.cfg
 
	DESTINATION /etc/spectrum2
 
	)
src/conversation.cpp
Show inline comments
 
@@ -85,48 +85,52 @@ void Conversation::handleParticipantChanged(const std::string &nick, int flag, i
 
	Swift::Presence::ref presence = Swift::Presence::create();
 
 	presence->setFrom(Swift::JID(m_legacyName, m_conversationManager->getComponent()->getJID().toBare(), nickname));
 
	presence->setTo(m_conversationManager->getUser()->getJID().toString());
 
	presence->setType(Swift::Presence::Available);
 

	
 
	if (!statusMessage.empty())
 
		presence->setStatus(statusMessage);
 

	
 
	Swift::StatusShow s((Swift::StatusShow::Type) status);
 

	
 
	if (s.getType() == Swift::StatusShow::None) {
 
		presence->setType(Swift::Presence::Unavailable);
 
	}
 

	
 
	presence->setShow(s.getType());
 

	
 
	Swift::MUCUserPayload *p = new Swift::MUCUserPayload ();
 
	if (m_nickname == nickname) {
 
		Swift::MUCUserPayload::StatusCode c;
 
		c.code = 110;
 
		p->addStatusCode(c);
 
	}
 

	
 
	
 
	Swift::MUCUserPayload::Item item(Swift::MUCOccupant::Member, Swift::MUCOccupant::Participant);
 
	Swift::MUCItem item;
 
	
 
	item.affiliation = Swift::MUCOccupant::Member;
 
	item.role = Swift::MUCOccupant::Participant;
 

	
 
	if (flag & Moderator) {
 
		item = Swift::MUCUserPayload::Item(Swift::MUCOccupant::Admin, Swift::MUCOccupant::Moderator);
 
		item.affiliation = Swift::MUCOccupant::Admin;
 
		item.role = Swift::MUCOccupant::Moderator;
 
	}
 

	
 
	if (!newname.empty()) {
 
		item.nick = newname;
 
		Swift::MUCUserPayload::StatusCode c;
 
		c.code = 303;
 
		p->addStatusCode(c);
 
		presence->setType(Swift::Presence::Unavailable);
 
	}
 

	
 
	p->addItem(item);
 

	
 
	presence->addPayload(boost::shared_ptr<Swift::Payload>(p));
 
	m_conversationManager->getComponent()->getStanzaChannel()->sendPresence(presence);
 
	if (!newname.empty()) {
 
		handleParticipantChanged(newname, flag, status, statusMessage);
 
	}
 
}
 

	
 
}
0 comments (0 inline, 0 general)