Changeset - ce2218d0864b
[Not reviewed]
0 43 0
Vitaly Takmazov - 8 years ago 2017-11-09 15:49:33
vitalyster@gmail.com
using boost::signals2 with compatibility for older swiften
43 files changed with 83 insertions and 120 deletions:
0 comments (0 inline, 0 general)
CMakeLists.txt
Show inline comments
 
@@ -399,16 +399,12 @@ if (WIN32)
 
	ADD_DEFINITIONS(-D_WIN32_WINNT=0x501)
 
	ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
 
	ADD_DEFINITIONS(-DBOOST_USE_WINDOWS_H)
 
	ADD_DEFINITIONS(-DBOOST_THREAD_USE_LIB)
 
endif()
 

	
 
# We cannot use boost:signals2, because Swiften does not use them,
 
# for now, just ignore the deprecation warning.
 
ADD_DEFINITIONS(-DBOOST_SIGNALS_NO_DEPRECATION_WARNING)
 

	
 
if(CMAKE_BUILD_TYPE MATCHES Debug)
 
	if (CMAKE_COMPILER_IS_GNUCXX)
 
		ADD_DEFINITIONS(-O0)
 
		ADD_DEFINITIONS(-ggdb)
 
	endif()
 
	ADD_DEFINITIONS(-DDEBUG)
backends/twitter/Requests/FetchFriends.h
Show inline comments
 
@@ -3,13 +3,12 @@
 

	
 
#include "transport/ThreadPool.h"
 
#include "../libtwitcurl/twitcurl.h"
 
#include "../TwitterResponseParser.h"
 
#include "transport/Logging.h"
 
#include <string>
 
#include <boost/signals.hpp>
 
#include <boost/function.hpp>
 
#include <boost/bind.hpp>
 
#include <iostream>
 

	
 
using namespace Transport;
 

	
backends/twitter/Requests/ProfileImageRequest.h
Show inline comments
 
@@ -3,13 +3,12 @@
 

	
 
#include "../TwitterResponseParser.h"
 
#include "transport/ThreadPool.h"
 
#include "transport/Logging.h"
 
#include "transport/Config.h"
 
#include <string>
 
#include <boost/signals.hpp>
 
#include <boost/function.hpp>
 
#include <boost/bind.hpp>
 
#include <iostream>
 
#include <sstream>
 

	
 
using namespace Transport;
backends/twitter/TwitterPlugin.h
Show inline comments
 
@@ -16,13 +16,12 @@
 
#include "unistd.h"
 
#include "signal.h"
 
#include "sys/wait.h"
 
#include "sys/signal.h"
 
#endif
 
#include <boost/algorithm/string.hpp>
 
#include <boost/signal.hpp>
 
#include <boost/thread.hpp>
 
#include <boost/thread/mutex.hpp>
 

	
 
#include "twitcurl.h"
 
#include "TwitterResponseParser.h"
 

	
include/Swiften/FileTransfer/MyOutgoingSIFileTransfer.h
Show inline comments
 
@@ -4,13 +4,12 @@
 
 * See Documentation/Licenses/GPLv3.txt for more information.
 
 */
 

	
 
#pragma once
 

	
 
#include <boost/shared_ptr.hpp>
 
#include <boost/signals.hpp>
 

	
 
#include "Swiften/SwiftenCompat.h"
 

	
 
#include <Swiften/FileTransfer/OutgoingFileTransfer.h>
 
#include <Swiften/FileTransfer/ReadBytestream.h>
 
#include <Swiften/FileTransfer/FileTransferError.h>
 
@@ -33,13 +32,13 @@ namespace Swift {
 
			MyOutgoingSIFileTransfer(const std::string& id, const JID& from, const JID& to, const std::string& name, int size, const std::string& description, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<ReadBytestream> bytestream, IQRouter* iqRouter, SOCKS5BytestreamServer* socksServer, SOCKS5BytestreamRegistry* registry);
 

	
 
			virtual void start();
 
			virtual void stop();
 
			virtual void cancel();
 

	
 
			boost::signal<void (const boost::optional<FileTransferError>&)> onFinished;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (const boost::optional<FileTransferError>&)> onFinished;
 

	
 
		private:
 
			void handleStreamInitiationRequestResponse(StreamInitiation::ref, ErrorPayload::ref);
 
			void handleBytestreamsRequestResponse(Bytestreams::ref, ErrorPayload::ref);
 
			void finish(boost::optional<FileTransferError> error);
 
			void handleIBBSessionFinished(boost::optional<FileTransferError> error);
include/Swiften/Network/DummyConnectionServer.cpp
Show inline comments
 
@@ -3,13 +3,12 @@
 
 * Licensed under the GNU General Public License v3.
 
 * See Documentation/Licenses/GPLv3.txt for more information.
 
 */
 

	
 
#include <Swiften/Network/DummyConnectionServer.h>
 

	
 
#include <boost/signal.hpp>
 
#include <boost/bind.hpp>
 
#include <boost/system/system_error.hpp>
 
#include <boost/asio/placeholders.hpp>
 

	
 
#include <Swiften/EventLoop/EventLoop.h>
 

	
include/Swiften/Server/Server.cpp
Show inline comments
 
@@ -6,13 +6,12 @@
 

	
 
#include "Swiften/Server/Server.h"
 

	
 
#include <string>
 
#include <boost/bind.hpp>
 
#include <boost/foreach.hpp>
 
#include <boost/signal.hpp>
 

	
 
#include "Swiften/Base/String.h"
 
#include "Swiften/Network/Connection.h"
 
#include "Swiften/Network/ConnectionServer.h"
 
#include "Swiften/Network/ConnectionServerFactory.h"
 
#include "Swiften/Elements/Element.h"
 
@@ -93,13 +92,13 @@ void Server::stop() {
 
// 		session->finishSession();
 
// 	}
 
	serverFromClientSessions.clear();
 

	
 
	if (serverFromClientConnectionServer) {
 
		serverFromClientConnectionServer->stop();
 
		BOOST_FOREACH(SWIFTEN_SIGNAL_NAMESPACE::connection& connection, serverFromClientConnectionServerSignalConnections) {
 
		BOOST_FOREACH(SWIFTEN_SIGNAL_CONNECTION_NAMESPACE::connection& connection, serverFromClientConnectionServerSignalConnections) {
 
			connection.disconnect();
 
		}
 
		serverFromClientConnectionServerSignalConnections.clear();
 
		serverFromClientConnectionServer.reset();
 
	}
 

	
include/Swiften/Server/Server.h
Show inline comments
 
@@ -5,13 +5,12 @@
 
 */
 

	
 
#pragma once
 

	
 
#include <boost/shared_ptr.hpp>
 
#include <boost/optional.hpp>
 
#include <boost/signals2.hpp>
 
#include <vector>
 

	
 
#include "Swiften/Network/BoostIOServiceThread.h"
 
#include "Swiften/Network/ConnectionServer.h"
 
#include "Swiften/Server/UserRegistry.h"
 
#include "Swiften/Server/ServerSession.h"
 
@@ -22,12 +21,13 @@
 
#include "Swiften/Entity/Entity.h"
 
#include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h"
 
#include "Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h"
 
#include "Swiften/SwiftenCompat.h"
 
#include <Swiften/TLS/CertificateWithKey.h>
 
#include <Swiften/Parser/PlatformXMLParserFactory.h>
 
#include <Swiften/SwiftenCompat.h>
 

	
 
namespace Swift {
 
	class ConnectionServer;
 
	class SessionTracer;
 
	class EventLoop;
 
	class NetworkFactories;
 
@@ -56,14 +56,14 @@ namespace Swift {
 
			}
 

	
 
			SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<ConnectionServer> getConnectionServer() const {
 
				return serverFromClientConnectionServer;
 
			}
 

	
 
			boost::signal<void (const SafeByteArray&)> onDataRead;
 
			boost::signal<void (const SafeByteArray&)> onDataWritten;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (const SafeByteArray&)> onDataRead;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (const SafeByteArray&)> onDataWritten;
 

	
 
			void addTLSEncryption(TLSServerContextFactory* tlsContextFactory, CertificateWithKey::ref cert);
 

	
 
		private:
 
			void handleNewClientConnection(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Connection> c);
 
			void handleSessionStarted(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<ServerFromClientSession>);
 
@@ -77,13 +77,13 @@ namespace Swift {
 
			UserRegistry *userRegistry_;
 
			int port_;
 
			EventLoop* eventLoop;
 
			NetworkFactories* networkFactories_;
 
			bool stopping;
 
			SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<ConnectionServer> serverFromClientConnectionServer;
 
			std::vector<SWIFTEN_SIGNAL_NAMESPACE::connection> serverFromClientConnectionServerSignalConnections;
 
			std::vector<SWIFTEN_SIGNAL_CONNECTION_NAMESPACE::connection> serverFromClientConnectionServerSignalConnections;
 
			std::list<SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<ServerFromClientSession> > serverFromClientSessions;
 
			JID selfJID;
 
			StanzaChannel *stanzaChannel_;
 
			IQRouter *iqRouter_;
 
			TLSServerContextFactory *tlsFactory;
 
			CertificateWithKey::ref cert;
include/Swiften/Server/ServerFromClientSession.h
Show inline comments
 
@@ -5,13 +5,12 @@
 
 */
 

	
 
#pragma once
 

	
 
#include <boost/shared_ptr.hpp>
 
#include <boost/enable_shared_from_this.hpp>
 
#include <boost/signals.hpp>
 

	
 
#include <string>
 
#include <Swiften/Session/Session.h>
 
#include <Swiften/JID/JID.h>
 
#include <Swiften/Network/Connection.h>
 
#include <Swiften/Base/ByteArray.h>
 
@@ -45,13 +44,13 @@ namespace Swift {
 
					PayloadSerializerCollection* payloadSerializers,
 
					UserRegistry* userRegistry,
 
					XMLParserFactory* factory,
 
					Swift::JID remoteJID = Swift::JID());
 
			~ServerFromClientSession();
 

	
 
			boost::signal<void ()> onSessionStarted;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onSessionStarted;
 
			void setAllowSASLEXTERNAL();
 
			const std::string &getUser() {
 
				return user_;
 
			}
 

	
 
			void addTLSEncryption(TLSServerContextFactory* tlsContextFactory, CertificateWithKey::ref cert);
include/Swiften/Server/UserRegistry.h
Show inline comments
 
@@ -5,13 +5,12 @@
 
 */
 

	
 
#pragma once
 

	
 
#include <string>
 
#include <Swiften/Base/SafeByteArray.h>
 
#include <boost/signal.hpp>
 
#include "Swiften/Server/ServerFromClientSession.h"
 

	
 
namespace Swift {
 
	class JID;
 

	
 
	class UserRegistry {
include/Swiften/StreamStack/TLSServerLayer.h
Show inline comments
 
/*
 
 * Copyright (c) 2010 Remko Tronçon
 
 * Licensed under the GNU General Public License v3.
 
 * See Documentation/Licenses/GPLv3.txt for more information.
 
 */
 

	
 
#include <boost/signals.hpp>
 

	
 
#include "Swiften/Base/SafeByteArray.h"
 
#include "Swiften/StreamStack/StreamLayer.h"
 
#include "Swiften/TLS/Certificate.h"
 
#include <Swiften/TLS/CertificateWithKey.h>
 
#include "Swiften/TLS/CertificateVerificationError.h"
 
#include "Swiften/SwiftenCompat.h"
 
@@ -34,13 +32,13 @@ namespace Swift {
 

	
 
			TLSServerContext* getContext() const {
 
				return context;
 
			}
 

	
 
		public:
 
			boost::signal<void ()> onError;
 
			boost::signal<void ()> onConnected;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onError;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onConnected;
 

	
 
		private:
 
			TLSServerContext* context;
 
	};
 
}
include/Swiften/SwiftenCompat.h
Show inline comments
 
@@ -23,26 +23,32 @@
 
/*
 
 * Define macros for Swiften compatible shared pointer and signal namespaces.
 
 *
 
 * Using these it is possible to declare shared pointers and signals like this:
 
 *
 
 * SWIFTEN_SIGNAL_NAMESPACE::signal signal;
 
 * SWIFTEN_SIGNAL_CONNECTION_NAMESPACE::connection &connection;
 
 * SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Type> ptr;
 
 *
 
 * These are guaranteed to be the same implementation as Swift uses internally,
 
 * thus can be used when passign/retrieveing data from/to swiften.
 
 *
 
 * This is due to Swift 4 moved from boost::shared_ptr to SWIFTEN_SHRPTR_NAMESPACE::shared_ptr
 
 * and from boost::signals to boost::signals2 .
 
 */
 

	
 
#if (SWIFTEN_VERSION >= 0x040000)
 
#define SWIFTEN_UNIQUE_PTR std::unique_ptr
 
#define SWIFTEN_SHRPTR_NAMESPACE std
 
#include <boost/signals2.hpp>
 
#define SWIFTEN_SIGNAL_NAMESPACE boost::signals2
 
#define SWIFTEN_SIGNAL_CONNECTION_NAMESPACE boost::signals2
 
#define SWIFT_HOSTADDRESS(x) *(Swift::HostAddress::fromString(x))
 
#else
 
#define SWIFTEN_UNIQUE_PTR std::auto_ptr
 
#define SWIFTEN_SHRPTR_NAMESPACE boost
 
#define SWIFTEN_SIGNAL_NAMESPACE boost::signals
 
#define BOOST_SIGNALS_NO_DEPRECATION_WARNING
 
#include <boost/signals.hpp>
 
#define SWIFTEN_SIGNAL_NAMESPACE boost
 
#define SWIFTEN_SIGNAL_CONNECTION_NAMESPACE boost::signals
 
#define SWIFT_HOSTADDRESS(x) Swift::HostAddress(x)
 
#endif
include/Swiften/TLS/TLSServerContext.h
Show inline comments
 
@@ -4,18 +4,18 @@
 
 * See Documentation/Licenses/GPLv3.txt for more information.
 
 */
 

	
 
#pragma once
 

	
 
#include <boost/shared_ptr.hpp>
 
#include <boost/signals.hpp>
 

	
 
#include "Swiften/Base/SafeByteArray.h"
 
#include "Swiften/TLS/Certificate.h"
 
#include <Swiften/TLS/CertificateWithKey.h>
 
#include "Swiften/TLS/CertificateVerificationError.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
namespace Swift {
 
	class PKCS12Certificate;
 

	
 
	class TLSServerContext {
 
		public:
 
@@ -31,12 +31,12 @@ namespace Swift {
 
			virtual Certificate::ref getPeerCertificate() const = 0;
 
			virtual CertificateVerificationError::ref getPeerCertificateVerificationError() const = 0;
 

	
 
			virtual ByteArray getFinishMessage() const = 0;
 

	
 
		public:
 
			boost::signal<void (const SafeByteArray&)> onDataForNetwork;
 
			boost::signal<void (const SafeByteArray&)> onDataForApplication;
 
			boost::signal<void ()> onError;
 
			boost::signal<void ()> onConnected;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (const SafeByteArray&)> onDataForNetwork;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (const SafeByteArray&)> onDataForApplication;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onError;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onConnected;
 
	};
 
}
include/transport/Config.h
Show inline comments
 
@@ -23,13 +23,13 @@
 
#include <boost/program_options.hpp>
 
#include <boost/foreach.hpp>
 
#include <boost/format.hpp>
 
#include <boost/algorithm/string.hpp>
 
#include <boost/assign.hpp>
 
#include <boost/bind.hpp>
 
#include <boost/signalslib.hpp>
 
#include <Swiften/SwiftenCompat.h>
 

	
 
namespace Transport {
 

	
 
template <class myType>
 
const myType &safeAs(const boost::program_options::variable_value &var, const myType &def) {
 
	try  {
 
@@ -121,16 +121,16 @@ class Config {
 
		std::string getCommandLineArgs() const;
 

	
 
		/// Returns path to config file from which data were loaded.
 
		const std::string &getConfigFile() { return m_file; }
 

	
 
		/// This signal is emitted when config is loaded/reloaded.
 
		boost::signal<void ()> onConfigReloaded;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onConfigReloaded;
 

	
 
		void updateBackendConfig(const std::string &backendConfig);
 
		boost::signal<void ()> onBackendConfigUpdated;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onBackendConfigUpdated;
 

	
 
		static Config *createFromArgs(int argc, char **argv, std::string &error, std::string &host, int &port);
 
	
 
	private:
 
		int m_argc;
 
		char **m_argv;
include/transport/Frontend.h
Show inline comments
 
@@ -29,14 +29,12 @@
 
#include "Swiften/Elements/Message.h"
 
#include "Swiften/Elements/IQ.h"
 
#include "Swiften/Elements/DiscoInfo.h"
 
#include "Swiften/Elements/Presence.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class Config;
 
class UserRegistry;
 
class Component;
 
class User;
 
@@ -95,18 +93,18 @@ class Frontend {
 
		virtual std::string setOAuth2Code(const std::string &code, const std::string &state) { return "OAuth2 code is not needed for this frontend."; }
 
		virtual std::string getOAuth2URL(const std::vector<std::string> &args) { return ""; }
 
		virtual std::string getRegistrationFields() { return "Jabber ID\n3rd-party network username\n3rd-party network password"; }
 

	
 
		virtual bool isRawXMLEnabled() { return false; }
 

	
 
		boost::signal<void (User *, const std::string &name, unsigned int id)> onVCardRequired;
 
		boost::signal<void (User *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::VCard> vcard)> onVCardUpdated;
 
		boost::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyUpdated;
 
		boost::signal<void (Buddy *)> onBuddyRemoved;
 
		boost::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyAdded;
 
		boost::signal<void (Swift::Message::ref message)> onMessageReceived;
 
		boost::signal<void (bool /* isAvailable */)> onAvailableChanged;
 
		boost::signal<void (SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Presence>) > onPresenceReceived;
 
		boost::signal<void (const Swift::JID& jid, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::DiscoInfo> info)> onCapabilitiesReceived;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (User *, const std::string &name, unsigned int id)> onVCardRequired;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (User *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::VCard> vcard)> onVCardUpdated;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyUpdated;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *)> onBuddyRemoved;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyAdded;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Swift::Message::ref message)> onMessageReceived;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (bool /* isAvailable */)> onAvailableChanged;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Presence>) > onPresenceReceived;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const Swift::JID& jid, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::DiscoInfo> info)> onCapabilitiesReceived;
 
};
 

	
 
}
include/transport/HTTPRequest.h
Show inline comments
 
@@ -6,13 +6,13 @@
 
#include "transport/ThreadPool.h"
 
#include <iostream>
 
#include <sstream>
 
#include <string.h>
 
#include "rapidjson/document.h"
 

	
 
#include <boost/signal.hpp>
 
#include <Swiften/SwiftenCompat.h>
 

	
 
namespace Transport {
 

	
 
class HTTPRequest : public Thread {
 
	public:
 
		typedef enum { Get } Type;
 
@@ -35,13 +35,13 @@ class HTTPRequest : public Thread {
 
		void finalize();
 

	
 
		const std::string &getURL() {
 
			return m_url;
 
		}
 

	
 
		boost::signal<void ()> onRequestFinished;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onRequestFinished;
 

	
 
		static void globalInit() {
 
			curl_global_init(CURL_GLOBAL_ALL);
 
		}
 

	
 
		static void globalCleanup() {
include/transport/MemoryReadBytestream.h
Show inline comments
 
@@ -19,13 +19,12 @@
 
 */
 

	
 
#pragma once
 

	
 
#include <string>
 
#include <map>
 
#include <boost/signal.hpp>
 

	
 
#include "Swiften/FileTransfer/ReadBytestream.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
namespace Transport {
 

	
 
@@ -38,13 +37,13 @@ class MemoryReadBytestream : public Swift::ReadBytestream {
 

	
 
		virtual SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<std::vector<unsigned char> > read(size_t size);
 

	
 
		void setFinished() { m_finished = true; }
 
		bool isFinished() const;
 

	
 
		boost::signal<void ()> onDataNeeded;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onDataNeeded;
 

	
 
	private:
 
		bool m_finished;
 
		std::string m_data;
 
		bool neededData;
 
		unsigned long m_sent;
include/transport/PresenceOracle.h
Show inline comments
 
@@ -19,17 +19,16 @@
 
 */
 

	
 
#pragma once
 

	
 
#include <map>
 

	
 
#include <boost/signals.hpp>
 

	
 
#include <string>
 
#include <Swiften/Elements/Presence.h>
 
#include <Swiften/Client/StanzaChannel.h>
 
#include <Swiften/SwiftenCompat.h>
 

	
 
namespace Transport {
 

	
 
class Frontend;
 

	
 
class PresenceOracle {
 
@@ -41,13 +40,13 @@ class PresenceOracle {
 
		Swift::Presence::ref getHighestPriorityPresence(const Swift::JID& bareJID) const;
 
		std::vector<Swift::Presence::ref> getAllPresence(const Swift::JID& bareJID) const;
 

	
 
		void clearPresences(const Swift::JID& bareJID);
 

	
 
	public:
 
		boost::signal<void (Swift::Presence::ref)> onPresenceChange;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Swift::Presence::ref)> onPresenceChange;
 

	
 
	private:
 
		void handleIncomingPresence(Swift::Presence::ref presence);
 
		void handleStanzaChannelAvailableChanged(bool);
 

	
 
	private:
include/transport/RosterManager.h
Show inline comments
 
@@ -20,21 +20,21 @@
 

	
 
#pragma once
 

	
 
#include <string>
 
#include <algorithm>
 
#include <map>
 
#include <boost/signal.hpp>
 
#include <boost/pool/pool_alloc.hpp>
 
#include <boost/pool/object_pool.hpp>
 
// #include "rosterstorage.h"
 
#include "Swiften/Elements/RosterPayload.h"
 
#include "Swiften/Queries/GenericRequest.h"
 
#include "Swiften/Roster/SetRosterRequest.h"
 
#include "Swiften/Elements/Presence.h"
 
#include "Swiften/Network/Timer.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
namespace Transport {
 

	
 
class Buddy;
 
class User;
 
class Component;
 
@@ -91,21 +91,21 @@ class RosterManager {
 
		bool isRemoteRosterSupported() {
 
			return m_supportRemoteRoster;
 
		}
 

	
 
		/// Called when new Buddy is added to this roster.
 
		/// \param buddy newly added Buddy
 
		boost::signal<void (Buddy *buddy)> onBuddySet;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *buddy)> onBuddySet;
 

	
 
		/// Called when Buddy has been removed from this roster.
 
		/// \param buddy removed Buddy
 
		boost::signal<void (Buddy *buddy)> onBuddyUnset;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *buddy)> onBuddyUnset;
 

	
 
		boost::signal<void (Buddy *buddy)> onBuddyAdded;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *buddy)> onBuddyAdded;
 
		
 
		boost::signal<void (Buddy *buddy)> onBuddyRemoved;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *buddy)> onBuddyRemoved;
 

	
 
		void handleBuddyChanged(Buddy *buddy);
 

	
 
		void handleSubscription(Swift::Presence::ref presence);
 

	
 
		void sendBuddyRosterRemove(Buddy *buddy);
include/transport/ThreadPool.h
Show inline comments
 
#pragma once 
 

	
 
#include <boost/thread.hpp>
 
#include <boost/thread/mutex.hpp>
 
#include <boost/signals2/signal.hpp>
 
#include <queue>
 
#include <iostream>
 
#include "Swiften/EventLoop/EventLoop.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
namespace Transport {
 

	
 
/*
 
 * Thread serves as a base class for any code that has to be excuted as a thread
 
 * by the ThreadPool class. The run method defines the code that has to be run
 
@@ -53,13 +53,13 @@ class ThreadPool
 

	
 
	boost::mutex count_lock;
 
	boost::mutex pool_lock;
 
	boost::mutex criticalregion;
 
	Swift::EventLoop *loop;
 

	
 
	boost::signals2::signal < void () > onWorkerAvailable;
 
	SWIFTEN_SIGNAL_NAMESPACE::signal < void () > onWorkerAvailable;
 
	
 
	public:
 
	ThreadPool(Swift::EventLoop *loop, int maxthreads);
 
	~ThreadPool();
 
	void runAsThread(Thread *t);
 
	int getActiveThreadCount(); 
include/transport/Transport.h
Show inline comments
 
@@ -18,13 +18,12 @@
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#pragma once
 

	
 
#include <vector>
 
#include <boost/signal.hpp>
 
#include <boost/bind.hpp>
 
#include "Swiften/Network/BoostTimerFactory.h"
 
#include "Swiften/Network/BoostIOServiceThread.h"
 
#include "Swiften/Network/NetworkFactories.h"
 
#include "Swiften/Elements/DiscoInfo.h"
 
#include "Swiften/Elements/Presence.h"
 
@@ -92,30 +91,30 @@ namespace Transport {
 
			/// \return Transport Factory used to create basic Transport components.
 
			Factory *getFactory() { return m_factory; }
 

	
 
			/// This signal is emitted when server disconnects the transport because of some error.
 

	
 
			/// \param error disconnection error
 
			boost::signal<void (const std::string &error)> onConnectionError;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (const std::string &error)> onConnectionError;
 

	
 
			/// This signal is emitted when transport successfully connects the server.
 
			boost::signal<void ()> onConnected;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onConnected;
 

	
 
			/// This signal is emitted when XML stanza is sent to server.
 

	
 
			Config *getConfig() { return m_config; }
 

	
 
			/// It's emitted only for presences addressed to transport itself
 
			/// (for example to="j2j.domain.tld") and for presences comming to
 
			/// MUC (for example to="#chat%irc.freenode.org@irc.domain.tld")
 
			/// \param presence Presence.
 
			boost::signal<void (Swift::Presence::ref presence)> onUserPresenceReceived;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (Swift::Presence::ref presence)> onUserPresenceReceived;
 

	
 
			boost::signal<void (SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::IQ>)> onRawIQReceived;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void (SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::IQ>)> onRawIQReceived;
 

	
 
			boost::signal<void ()> onAdminInterfaceSet;
 
			SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onAdminInterfaceSet;
 
			
 
			void handlePresence(Swift::Presence::ref presence);
 
			void handleConnected();
 
			void handleConnectionError(const std::string &error);
 
			void handleDataRead(const std::string &data);
 
			void handleDataWritten(const std::string &data);
include/transport/User.h
Show inline comments
 
@@ -17,13 +17,12 @@
 
 * along with this program; if not, write to the Free Software
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#pragma once
 

	
 
#include <boost/signal.hpp>
 
#include <time.h>
 
#include "transport/StorageBackend.h"
 
#include <Swiften/FileTransfer/OutgoingFileTransfer.h>
 
#include "Swiften/Elements/SpectrumErrorPayload.h"
 
#include "Swiften/JID/JID.h"
 
#include "Swiften/Elements/Presence.h"
 
@@ -146,18 +145,18 @@ class User {
 
		void setStorageBackend(StorageBackend *storageBackend) {
 
			m_storageBackend = storageBackend;
 
		}
 

	
 
		void leaveRoom(const std::string &room);
 

	
 
		boost::signal<void ()> onReadyToConnect;
 
		boost::signal<void (Swift::Presence::ref presence)> onPresenceChanged;
 
		boost::signal<void (Swift::Presence::ref presence)> onRawPresenceReceived;
 
		boost::signal<void (const Swift::JID &who, const std::string &room, const std::string &nickname, const std::string &password)> onRoomJoined;
 
		boost::signal<void (const std::string &room)> onRoomLeft;
 
		boost::signal<void ()> onDisconnected;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onReadyToConnect;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Swift::Presence::ref presence)> onPresenceChanged;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Swift::Presence::ref presence)> onRawPresenceReceived;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const Swift::JID &who, const std::string &room, const std::string &nickname, const std::string &password)> onRoomJoined;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const std::string &room)> onRoomLeft;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onDisconnected;
 

	
 
	private:
 
		void onConnectingTimeout();
 

	
 
		Swift::JID m_jid;
 
		Component *m_component;
include/transport/UserManager.h
Show inline comments
 
@@ -17,13 +17,12 @@
 
 * along with this program; if not, write to the Free Software
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#pragma once
 

	
 
#include <boost/signal.hpp>
 
#include <string>
 
#include <map>
 
#include "Swiften/Elements/Message.h"
 
#include "Swiften/Elements/Presence.h"
 
#include "Swiften/JID/JID.h"
 
#include "Swiften/Disco/EntityCapsProvider.h"
 
@@ -96,17 +95,17 @@ class UserManager /*: public Swift::EntityCapsProvider*/ {
 
		void removeAllUsers(bool onUserBehalf = true);
 

	
 
// 		Swift::DiscoInfo::ref getCaps(const Swift::JID&) const;
 

	
 
		/// Called when new User class is created.
 
		/// \param user newly created User class
 
		boost::signal<void (User *user)> onUserCreated;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (User *user)> onUserCreated;
 

	
 
		/// Called when User class is going to be removed
 
		/// \param user removed User class
 
		boost::signal<void (User *user)> onUserDestroyed;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (User *user)> onUserDestroyed;
 

	
 
		/// Returns true if user is connected.
 
		/// \return True if user is connected.
 
		bool isUserConnected(const std::string &barejid) const {
 
			return m_users.find(barejid) != m_users.end();
 
		}
include/transport/UserRegistration.h
Show inline comments
 
@@ -20,14 +20,14 @@
 

	
 
#pragma once
 

	
 
#include "Swiften/Queries/Responder.h"
 
#include "Swiften/Elements/InBandRegistrationPayload.h"
 
#include "Swiften/Elements/RosterPayload.h"
 
#include <boost/signal.hpp>
 
#include <Swiften/Version.h>
 
#include "Swiften/SwiftenCompat.h"
 
#define HAVE_SWIFTEN_3  (SWIFTEN_VERSION >= 0x030000)
 

	
 
namespace Transport {
 

	
 
struct UserInfo;
 
class Component;
 
@@ -68,21 +68,21 @@ class UserRegistration {
 
		/// \param barejid bare JID of user to unregister
 
		/// \return false if there is no such user registered
 
		virtual bool doUserUnregistration(const UserInfo &userInfo) = 0;
 

	
 
		/// Called when new user has been registered.
 
		/// \param userInfo UserInfo struct with informations about user
 
		boost::signal<void (const UserInfo &userInfo)> onUserRegistered;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const UserInfo &userInfo)> onUserRegistered;
 

	
 
		/// Called when user has been unregistered.
 
		/// \param userInfo UserInfo struct with informations about user
 
		boost::signal<void (const UserInfo &userInfo)> onUserUnregistered;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const UserInfo &userInfo)> onUserUnregistered;
 

	
 
		/// Called when user's registration has been updated.
 
		/// \param userInfo UserInfo struct with informations about user
 
		boost::signal<void (const UserInfo &userInfo)> onUserUpdated;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const UserInfo &userInfo)> onUserUpdated;
 

	
 
	private:
 
		Component *m_component;
 
		StorageBackend *m_storageBackend;
 
		UserManager *m_userManager;
 
		Config *m_config;
include/transport/UserRegistry.h
Show inline comments
 
@@ -93,16 +93,16 @@ class UserRegistry : public Swift::UserRegistry {
 

	
 
		/// Returns current password for particular user
 
		/// \param barejid JID.
 
		const std::string getUserPassword(const std::string &barejid);
 

	
 
		/// Emitted when user wants to connect legacy network to validate the password.
 
		boost::signal<void (const Swift::JID &user)> onConnectUser;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const Swift::JID &user)> onConnectUser;
 

	
 
		/// Emitted when user disconnected XMPP server and therefore should disconnect legacy network.
 
		boost::signal<void (const Swift::JID &user)> onDisconnectUser;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const Swift::JID &user)> onDisconnectUser;
 

	
 
	private:
 
		typedef struct {
 
			std::string password;
 
			Swift::ServerFromClientSession *session;
 
		} Sess;
include/transport/WebSocketClient.h
Show inline comments
 
@@ -40,14 +40,12 @@
 
#endif
 

	
 
#include <string>
 
#include <algorithm>
 
#include <map>
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class Component;
 

	
 
class WebSocketClient {
 
	public:
 
@@ -57,16 +55,16 @@ class WebSocketClient {
 

	
 
		void connectServer(const std::string &u);
 
		void disconnectServer();
 

	
 
		void write(const std::string &data);
 

	
 
		boost::signal<void (const std::string &payload)> onPayloadReceived;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const std::string &payload)> onPayloadReceived;
 

	
 
		boost::signal<void ()> onWebSocketConnected;
 
		boost::signal<void (const boost::optional<Swift::Connection::Error> &error)> onWebSocketDisconnected;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onWebSocketConnected;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const boost::optional<Swift::Connection::Error> &error)> onWebSocketDisconnected;
 

	
 
	private:
 
		void handleDNSResult(const std::vector<Swift::HostAddress>&, boost::optional<Swift::DomainNameResolveError>);
 
		void handleDataRead(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::SafeByteArray> data);
 
		void handleConnected(bool error);
 
		void handleDisconnected(const boost::optional<Swift::Connection::Error> &error);
libtransport/NetworkPluginServer.cpp
Show inline comments
 
@@ -45,13 +45,12 @@
 
#include "Swiften/Elements/DeliveryReceipt.h"
 
#include "Swiften/Elements/DeliveryReceiptRequest.h"
 
#include "Swiften/Elements/InvisiblePayload.h"
 
#include "Swiften/Elements/SpectrumErrorPayload.h"
 

	
 
#include "boost/date_time/posix_time/posix_time.hpp"
 
#include "boost/signal.hpp"
 

	
 
#include "transport/utf8.h"
 

	
 
#include <Swiften/FileTransfer/ReadBytestream.h>
 
#include <Swiften/Elements/StreamInitiationFileInfo.h>
 

	
 
@@ -84,13 +83,13 @@ class NetworkConversation : public Conversation {
 

	
 
		// Called when there's new message to legacy network from XMPP network
 
		void sendMessage(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &message) {
 
			onMessageToSend(this, message);
 
		}
 

	
 
		boost::signal<void (NetworkConversation *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &)> onMessageToSend;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (NetworkConversation *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &)> onMessageToSend;
 
};
 

	
 
class NetworkFactory : public Factory {
 
	public:
 
		NetworkFactory(NetworkPluginServer *nps) {
 
			m_nps = nps;
spectrum/src/frontends/slack/SlackAPI.h
Show inline comments
 
@@ -25,14 +25,12 @@
 
#include "rapidjson/document.h"
 

	
 
#include <string>
 
#include <algorithm>
 
#include <map>
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class Component;
 
class StorageBackend;
 
class HTTPRequest;
 
class SlackIdManager;
spectrum/src/frontends/slack/SlackIdManager.h
Show inline comments
 
@@ -44,14 +44,12 @@
 
#endif
 

	
 
#include <string>
 
#include <algorithm>
 
#include <map>
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class SlackIdManager {
 
	public:
 
		SlackIdManager();
 

	
spectrum/src/frontends/slack/SlackRTM.h
Show inline comments
 
@@ -44,14 +44,12 @@
 
#endif
 

	
 
#include <string>
 
#include <algorithm>
 
#include <map>
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class Component;
 
class StorageBackend;
 
class HTTPRequest;
 
class WebSocketClient;
 
@@ -67,19 +65,19 @@ class SlackRTM {
 
		void start();
 

	
 
		void sendPing();
 

	
 
		void sendMessage(const std::string &channel, const std::string &message);
 

	
 
		boost::signal<void ()> onRTMStarted;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onRTMStarted;
 

	
 
		SlackAPI *getAPI() {
 
			return m_api;
 
		}
 

	
 
		boost::signal<void (const std::string &channel, const std::string &user, const std::string &text, const std::string &ts)> onMessageReceived;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const std::string &channel, const std::string &user, const std::string &text, const std::string &ts)> onMessageReceived;
 

	
 
#ifndef LIBTRANSPORT_TEST
 
	private:
 
#endif
 
		void handlePayloadReceived(const std::string &payload);
 
		void handleRTMStart(HTTPRequest *req, bool ok, rapidjson::Document &resp, const std::string &data);
spectrum/src/frontends/slack/SlackSession.h
Show inline comments
 
@@ -28,14 +28,12 @@
 
#include <map>
 

	
 
#include "Swiften/Elements/Message.h"
 
#include "Swiften/Network/Timer.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class Component;
 
class StorageBackend;
 
class HTTPRequest;
 
class SlackRTM;
 
@@ -46,13 +44,13 @@ class SlackIdManager;
 
class SlackSession {
 
	public:
 
		SlackSession(Component *component, StorageBackend *storageBackend, UserInfo uinfo);
 

	
 
		virtual ~SlackSession();
 

	
 
		boost::signal<void (const std::string &user)> onInstallationDone;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const std::string &user)> onInstallationDone;
 

	
 
		void sendMessage(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> message);
 

	
 
		void sendMessageToAll(const std::string &msg);
 

	
 
		void setPurpose(const std::string &purpose, const std::string &channel = "");
spectrum/src/frontends/slack/SlackUserRegistration.h
Show inline comments
 
@@ -19,14 +19,12 @@
 
 */
 

	
 
#pragma once
 

	
 
#include "transport/UserRegistration.h"
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
struct UserInfo;
 
class Component;
 
class StorageBackend;
 
class UserManager;
spectrum/src/frontends/xmpp/RosterResponder.h
Show inline comments
 
@@ -22,29 +22,27 @@
 

	
 
#include <vector>
 
#include "Swiften/Queries/Responder.h"
 
#include "Swiften/Elements/RosterPayload.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class UserManager;
 
class Buddy;
 

	
 
class RosterResponder : public Swift::Responder<Swift::RosterPayload> {
 
	public:
 
		RosterResponder(Swift::IQRouter *router, UserManager *userManager);
 
		~RosterResponder();
 

	
 
		boost::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyUpdated;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyUpdated;
 

	
 
		boost::signal<void (Buddy *)> onBuddyRemoved;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *)> onBuddyRemoved;
 

	
 
		boost::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyAdded;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyAdded;
 

	
 
	private:
 
		virtual bool handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::RosterPayload> payload);
 
		virtual bool handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::RosterPayload> payload);
 
		UserManager *m_userManager;
 
		Swift::IQRouter *m_router;
spectrum/src/frontends/xmpp/XMPPUserRegistration.h
Show inline comments
 
@@ -22,13 +22,12 @@
 

	
 
#include "Swiften/Queries/Responder.h"
 
#include "Swiften/Elements/InBandRegistrationPayload.h"
 
#include "Swiften/Elements/RosterPayload.h"
 
#include "Swiften/SwiftenCompat.h"
 

	
 
#include <boost/signal.hpp>
 
#include <Swiften/Version.h>
 
#include "transport/UserRegistration.h"
 
#define HAVE_SWIFTEN_3  (SWIFTEN_VERSION >= 0x030000)
 

	
 
namespace Transport {
 

	
spectrum/src/frontends/xmpp/blockresponder.h
Show inline comments
 
@@ -20,25 +20,24 @@
 

	
 
#pragma once
 

	
 
#include <vector>
 
#include "Swiften/Queries/SetResponder.h"
 
#include "BlockPayload.h"
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class UserManager;
 
class Buddy;
 

	
 
class BlockResponder : public Swift::SetResponder<Transport::BlockPayload> {
 
	public:
 
		BlockResponder(Swift::IQRouter *router, UserManager *userManager);
 
		~BlockResponder();
 

	
 
		boost::signal<void (Buddy *)> onBlockToggled;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (Buddy *)> onBlockToggled;
 

	
 
	private:
 
		virtual bool handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Transport::BlockPayload> payload);
 

	
 
		UserManager *m_userManager;
 
};
spectrum/src/frontends/xmpp/discoinforesponder.h
Show inline comments
 
@@ -19,13 +19,12 @@
 
 */
 

	
 
#pragma once
 

	
 
#include <vector>
 
#include <list>
 
#include <boost/signal.hpp>
 
#include "Swiften/Queries/GetResponder.h"
 
#include "Swiften/Elements/DiscoInfo.h"
 
#include "Swiften/Elements/CapsInfo.h"
 
#include "Swiften/SwiftenCompat.h"
 
#include <Swiften/Version.h>
 
#define HAVE_SWIFTEN_3  (SWIFTEN_VERSION >= 0x030000)
 
@@ -50,13 +49,13 @@ class DiscoInfoResponder : public Swift::GetResponder<Swift::DiscoInfo> {
 

	
 
		void addRoom(const std::string &jid, const std::string &name);
 
		void clearRooms();
 

	
 
		void addAdHocCommand(const std::string &node, const std::string &name);
 

	
 
		boost::signal<void (const Swift::CapsInfo &capsInfo)> onBuddyCapsInfoChanged;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (const Swift::CapsInfo &capsInfo)> onBuddyCapsInfoChanged;
 

	
 
		Swift::CapsInfo &getBuddyCapsInfo() {
 
				return m_capsInfo;
 
		}
 

	
 
	private:
spectrum/src/frontends/xmpp/formutils.h
Show inline comments
 
@@ -20,13 +20,12 @@
 

	
 
#pragma once
 

	
 
#include "Swiften/Queries/Responder.h"
 
#include "Swiften/Elements/InBandRegistrationPayload.h"
 
#include "Swiften/Elements/RosterPayload.h"
 
#include <boost/signal.hpp>
 
#include <Swiften/Version.h>
 
#define HAVE_SWIFTEN_3  (SWIFTEN_VERSION >= 0x030000)
 

	
 
namespace Transport {
 

	
 
	class AdHocCommand;
spectrum/src/frontends/xmpp/vcardresponder.h
Show inline comments
 
@@ -23,13 +23,12 @@
 
#include <vector>
 
#include "Swiften/Queries/Responder.h"
 
#include "Swiften/Elements/VCard.h"
 
#include "Swiften/Network/NetworkFactories.h"
 
#include "Swiften/Network/Timer.h"
 
#include "Swiften/SwiftenCompat.h"
 
#include <boost/signal.hpp>
 

	
 
namespace Transport {
 

	
 
class StorageBackend;
 
class UserManager;
 
class User;
 
@@ -38,14 +37,14 @@ class VCardResponder : public Swift::Responder<Swift::VCard> {
 
	public:
 
		VCardResponder(Swift::IQRouter *router, Swift::NetworkFactories *factories, UserManager *userManager);
 
		~VCardResponder();
 

	
 
		void sendVCard(unsigned int id, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::VCard> vcard);
 

	
 
		boost::signal<void (User *, const std::string &name, unsigned int id)> onVCardRequired;
 
		boost::signal<void (User *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::VCard> vcard)> onVCardUpdated;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (User *, const std::string &name, unsigned int id)> onVCardRequired;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (User *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::VCard> vcard)> onVCardUpdated;
 

	
 
		void collectTimeouted();
 

	
 
	private:
 
		struct VCardData {
 
			Swift::JID from;
spectrum_manager/src/APIServer.h
Show inline comments
 
@@ -23,13 +23,12 @@
 
#include <boost/program_options.hpp>
 
#include <boost/foreach.hpp>
 
#include <boost/format.hpp>
 
#include <boost/algorithm/string.hpp>
 
#include <boost/assign.hpp>
 
#include <boost/bind.hpp>
 
#include <boost/signal.hpp>
 

	
 
#include "rapidjson/document.h"
 

	
 
#include "mongoose.h"
 
#include "managerconfig.h"
 
#include "server.h"
spectrum_manager/src/managerconfig.h
Show inline comments
 
@@ -23,13 +23,14 @@
 
#include <boost/program_options.hpp>
 
#include <boost/foreach.hpp>
 
#include <boost/format.hpp>
 
#include <boost/algorithm/string.hpp>
 
#include <boost/assign.hpp>
 
#include <boost/bind.hpp>
 
#include <boost/signal.hpp>
 

	
 
#include "Swiften/SwiftenCompat.h"
 

	
 
/// Represents variable:value pairs.
 
typedef boost::program_options::variables_map Variables;
 

	
 
/// Represents config file.
 

	
 
@@ -73,12 +74,12 @@ class ManagerConfig {
 
		}
 

	
 
		/// Returns path to config file from which data were loaded.
 
		const std::string &getManagerConfigFile() { return m_file; }
 

	
 
		/// This signal is emitted when config is loaded/reloaded.
 
		boost::signal<void ()> onManagerConfigReloaded;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void ()> onManagerConfigReloaded;
 
	
 
	private:
 
		Variables m_variables;
 
		std::string m_file;
 
};
spectrum_manager/src/methods.h
Show inline comments
 
@@ -23,13 +23,12 @@
 
#include <boost/program_options.hpp>
 
#include <boost/foreach.hpp>
 
#include <boost/format.hpp>
 
#include <boost/algorithm/string.hpp>
 
#include <boost/assign.hpp>
 
#include <boost/bind.hpp>
 
#include <boost/signal.hpp>
 

	
 
#include "managerconfig.h"
 
#include "transport/Config.h"
 
#include "transport/protocol.pb.h"
 
#include "Swiften/Swiften.h"
 
#include "Swiften/EventLoop/SimpleEventLoop.h"
spectrum_manager/src/server.h
Show inline comments
 
@@ -23,13 +23,12 @@
 
#include <boost/program_options.hpp>
 
#include <boost/foreach.hpp>
 
#include <boost/format.hpp>
 
#include <boost/algorithm/string.hpp>
 
#include <boost/assign.hpp>
 
#include <boost/bind.hpp>
 
#include <boost/signal.hpp>
 

	
 
#include "mongoose.h"
 
#include "managerconfig.h"
 

	
 
#include "transport/Config.h"
 
#include "transport/Logging.h"
tests/libtransport/basictest.h
Show inline comments
 
@@ -63,13 +63,13 @@ class TestingConversation : public Conversation {
 

	
 
		// Called when there's new message to legacy network from XMPP network
 
		void sendMessage(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &message) {
 
			onMessageToSend(this, message);
 
		}
 

	
 
		boost::signal<void (TestingConversation *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &)> onMessageToSend;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (TestingConversation *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &)> onMessageToSend;
 
};
 

	
 
class TestingFactory : public Factory {
 
	public:
 
		TestingFactory() {
 
		}
 
@@ -95,13 +95,13 @@ class TestingFactory : public Factory {
 
			buddy->setSubscription(Buddy::Ask);
 
			if (buddyInfo.settings.find("icon_hash") != buddyInfo.settings.end())
 
				buddy->setIconHash(buddyInfo.settings.find("icon_hash")->second.s);
 
			return buddy;
 
		}
 

	
 
		boost::signal<void (TestingConversation *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &)> onMessageToSend;
 
		SWIFTEN_SIGNAL_NAMESPACE::signal<void (TestingConversation *, SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Message> &)> onMessageToSend;
 
};
 

	
 
class TestingStorageBackend : public StorageBackend {
 
	public:
 
		bool connected;
 
		std::map<std::string, UserInfo> users;
0 comments (0 inline, 0 general)