Changeset - be5a77cb7134
backends/libcommuni/ircnetworkplugin.h
Show inline comments
 
@@ -38,13 +38,13 @@ class IRCNetworkPlugin : public QObject, public NetworkPlugin {
 
		MyIrcSession *createSession(const std::string &user, const std::string &hostname, const std::string &nickname, const std::string &password, const std::string &suffix = "");
 
		std::string getSessionName(const std::string &user, const std::string &legacyName);
 
		std::string getTargetName(const std::string &legacyName);
 

	
 
	private:
 
		Config *config;
 
		QTcpSocket *m_socket;
 
		std::map<std::string, MyIrcSession *> m_sessions;
 
		std::vector<std::string> m_servers;
 
		int m_currentServer;
 
		std::string m_identify;
 
		bool m_firstPing;
 
};
 
\ No newline at end of file
 
};
backends/libcommuni/session.cpp
Show inline comments
 
@@ -221,25 +221,29 @@ void MyIrcSession::on_numericMessageReceived(IrcMessage *message) {
 
			channel = m->parameters().value(2);
 
			members = m->parameters().value(3).split(" ");
 

	
 
			LOG4CXX_INFO(logger, user << ": Received members for " << TO_UTF8(channel) << suffix);
 
			for (int i = 0; i < members.size(); i++) {
 
				bool flags = 0;
 
				std::string nickname = TO_UTF8(members.at(i));
 
				flags = correctNickname(nickname);
 
				m_modes[TO_UTF8(channel) + nickname] = flags;
 
				np->handleParticipantChanged(user, nickname, TO_UTF8(channel) + suffix,(int) flags, pbnetwork::STATUS_ONLINE);
 
			}
 

	
 
			break;
 
		case 366:
 
			// ask /who to get away states
 
			channel = m->parameters().value(1);
 
			LOG4CXX_INFO(logger, user << "Asking /who for channel " << TO_UTF8(channel));
 
			sendCommand(IrcCommand::createWho(channel));
 
			break;
 
		case 432:
 
			np->handleDisconnected(user, pbnetwork::CONNECTION_ERROR_INVALID_USERNAME, "Erroneous Nickname");
 
			break;
 
		case 321:
 
			m_rooms.clear();
 
			m_names.clear();
 
			break;
 
		case 322:
 
			m_rooms.push_back(TO_UTF8(m->parameters().value(1)));
 
			m_names.push_back(TO_UTF8(m->parameters().value(1)));
backends/twitter/libtwitcurl/base64.cpp
Show inline comments
 
@@ -111,13 +111,13 @@ std::string base64_decode(std::string const& encoded_string) {
 
 
    for (j = 0; j <4; j++)
 
      char_array_4[j] = base64_chars.find(char_array_4[j]);
 
 
    char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
 
    char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
 
    char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
 
 
    for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
 
  }
 
 
  return ret;
 
}
 
\ No newline at end of file
 
}
backends/twitter/libtwitcurl/base64.h
Show inline comments
 
#include <string>
 
 
std::string base64_encode(unsigned char const* , unsigned int len);
 
std::string base64_decode(std::string const& s);
 
\ No newline at end of file
 
std::string base64_decode(std::string const& s);
backends/twitter/libtwitcurl/urlencode.cpp
Show inline comments
 
@@ -28,13 +28,13 @@ std::string urlencode( const std::string &c )
 
			(c[i]=='~' || c[i]=='-' || c[i]=='_' || c[i]=='.')
 
			)
 
		{
 
			escaped.append( &c[i], 1);
 
		}
 
		else
 
		{
 
			escaped.append("%");
 
			escaped.append( char2hex(c[i]) );//converts char 255 to string "FF"
 
		}
 
	}
 
	return escaped;
 
}
 
\ No newline at end of file
 
}
backends/twitter/libtwitcurl/urlencode.h
Show inline comments
 
#ifndef __URLENCODE_H__
 
#define __URLENCODE_H__
 
 
#include <iostream>
 
#include <string>
 
 
std::string char2hex( char dec );
 
std::string urlencode( const std::string &c );
 
 
#endif // __URLENCODE_H__
 
\ No newline at end of file
 
#endif // __URLENCODE_H__
include/transport/discoitemsresponder.h
Show inline comments
 
@@ -45,13 +45,13 @@ class DiscoItemsResponder : public Swift::GetResponder<Swift::DiscoItems> {
 

	
 

	
 
	private:
 
		virtual bool handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::DiscoItems> payload);
 

	
 
	private:
 
		Component *m_component;
 
		boost::shared_ptr<Swift::DiscoItems> m_commands;
 
		boost::shared_ptr<Swift::DiscoItems> m_rooms;
 
		DiscoInfoResponder *m_discoInfoResponder;
 
};
 

	
 
}
 
\ No newline at end of file
 
}
include/transport/gatewayresponder.h
Show inline comments
 
@@ -31,13 +31,13 @@ class UserManager;
 

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

	
 
	private:
 
		virtual bool handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::GatewayPayload> payload);
 
		virtual bool handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::GatewayPayload> payload);
 
		UserManager *m_userManager;
 
};
 

	
 
}
 
\ No newline at end of file
 
}
include/transport/memoryusage.h
Show inline comments
 
@@ -23,13 +23,13 @@
 
#include <vector>
 

	
 
#ifndef WIN32
 
#include "signal.h"
 
#endif
 

	
 
namespace Transport {
 

	
 
#ifndef WIN32
 
	void process_mem_usage(double& shared, double& resident_set, pid_t pid = 0);
 
#endif
 

	
 
}
 
\ No newline at end of file
 
}
include/transport/rosterresponder.h
Show inline comments
 
@@ -38,13 +38,13 @@ class RosterResponder : public Swift::Responder<Swift::RosterPayload> {
 
		boost::signal<void (Buddy *, const Swift::RosterItemPayload &item)> onBuddyUpdated;
 

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

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

	
 
	private:
 
		virtual bool handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::RosterPayload> payload);
 
		virtual bool handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::RosterPayload> payload);
 
		UserManager *m_userManager;
 
};
 

	
 
}
 
\ No newline at end of file
 
}
packaging/fedora/build_rpm.sh
Show inline comments
 
new file 100755
 
#!/bin/sh
 
DIRNAME=spectrum2
 

	
 
echo "Cleaning up old sources ..."
 
rm -rf spectrum2-*
 

	
 
echo "Checking out a fresh copy ..."
 
rm -rf $DIRNAME
 
git clone ../../.git $DIRNAME
 
rm -rf $DIRNAME/.git
 

	
 
echo "Creating tarball ..."
 
tar czf $DIRNAME.tar.gz $DIRNAME
 

	
 
echo "Building package"
 
rpmbuild -ta $DIRNAME.tar.gz
packaging/fedora/spectrum2.spec
Show inline comments
 
%global groupname spectrum
 
%global username spectrum
 

	
 
Summary: XMPP transport
 
Name: spectrum2
 
Version: 2.0
 
Release: %{?_release}%{!?_release:1}%{?dist}
 
Release: 1%{?dist}
 
Group: Applications/Internet
 
License: GPLv3
 
Source0: spectrum2.tar.gz
 
URL: http://swift.im/
 
# BuildRequires: cmake
 
# BuildRequires: boost-devel
 
# BuildRequires: mysql-devel
 
# BuildRequires: cppunit-devel
 
# BuildRequires: libsqlite3x-devel
 
# BuildRequires: protobuf-devel
 
# BuildRequires: protobuf-compiler
 
# BuildRequires: popt-devel
 
# BuildRequires: libidn-devel
 
# BuildRequires: expat-devel
 
# BuildRequires: avahi-devel
 
# BuildRequires: log4cxx-devel
 
Requires: boost
 
Requires: mysql-libs
 
%if 0%{?rhel}
 
Requires: sqlite
 
BuildRequires: cmake
 
BuildRequires: boost-devel
 
BuildRequires: mysql-devel
 
BuildRequires: cppunit-devel
 
%if 0%{?rhel} > 0 && 0%{?rhel} <= 6
 
BuildRequires: sqlite-devel
 
%else
 
Requires: libsqlite3x
 
BuildRequires: libsqlite3x-devel
 
%endif
 
Requires: protobuf
 
Requires: popt
 
Requires: libidn
 
Requires: expat
 
Requires: avahi
 
Requires: log4cxx
 
#----
 
BuildRequires: protobuf-devel
 
BuildRequires: protobuf-compiler
 
BuildRequires: popt-devel
 
BuildRequires: libidn-devel
 
BuildRequires: expat-devel
 
BuildRequires: avahi-devel
 
BuildRequires: log4cxx-devel
 
BuildRequires: swiften-devel
 
Requires:      libtransport%{?_isa} = %{version}-%{release}
 
Requires:      swiften
 

	
 
%description
 
Spectrum 2.0
 
Spectrum 2 is an XMPP transport/gateway and also simple XMPP server.
 

	
 
%prep
 
%setup -q -n spectrum2
 

	
 
%build
 
%cmake . -DCMAKE_BUILD_TYPE=Debug
 
make VERBOSE=1 %{?_smp_mflags}
 

	
 
%install
 
rm -rf %{buildroot}
 
make install DESTDIR=%{buildroot}
 
install -d %{buildroot}%{_localstatedir}/{lib,run,log}/spectrum2
 
@@ -191,25 +181,25 @@ Group:      Development/Libraries
 
Requires:   boost
 

	
 
%description -n libtransport
 
Libtransport library
 

	
 
%files -n libtransport
 
%defattr(-, root, root,-)
 
%{_libdir}/libtransport*.so*
 
/usr/include/transport
 

	
 

	
 
%changelog
 
* Nov 30 2012 Jan Kaluza <jkaluza@redhat.com> - 2.0
 
* Mon Dec 03 2012 Jan Kaluza <jkaluza@redhat.com> - 2.0-1
 
- Work in progress
 

	
 
* Mon Jul 25 2011 Jan Kaluza <jkaluza@redhat.com> - 1.0-4
 
- rebuild for new boost
 

	
 
* Wed May 25 2011 Jan Kaluza <jkaluza@redhat.com> - 1.0-3
 
- fix #706719 - fixed another crash during login
 

	
 
* Tue Apr 26 2011 Jan Kaluza <jkaluza@redhat.com> - 1.0-2
 
- fix #697832 - fixed crash during login
 

	
 
* Tue Apr 19 2011 Jan Kaluza <jkaluza@redhat.com> - 1.0-1
spectrum/src/win32/ServiceWrapper.cpp
Show inline comments
 
@@ -108,13 +108,13 @@ void WINAPI ServiceMain(DWORD argc, LPSTR *argv) {
 
		ServiceStatus.dwCurrentState = SERVICE_STOPPED;
 
		SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
 
	}	
 
}
 

	
 
void ServiceWrapper::RunService() {
 
	SERVICE_TABLE_ENTRYA serviceTable[] = {
 
		{ ServiceName, ServiceMain },
 
		{ NULL, NULL}
 
	};
 

	
 
	StartServiceCtrlDispatcherA(serviceTable);
 
}
 
\ No newline at end of file
 
}
spectrum_manager/src/methods.h
Show inline comments
 
@@ -44,13 +44,13 @@ unsigned long exec_(std::string path, std::string config, std::string jid = "");
 
int getPort(const std::string &portfile);
 

	
 
int isRunning(const std::string &pidfile);
 
int start_instances(ManagerConfig *config, const std::string &_jid = "");
 
void stop_instances(ManagerConfig *config, const std::string &_jid = "");
 

	
 
int show_status(ManagerConfig *config);
 

	
 
void ask_local_server(ManagerConfig *config, Swift::BoostNetworkFactories &networkFactories, const std::string &jid, const std::string &message);
 

	
 
std::vector<std::string> show_list(ManagerConfig *config, bool show = true);
 

	
 
std::string get_response();
 
\ No newline at end of file
 
std::string get_response();
src/blockresponder.h
Show inline comments
 
@@ -34,13 +34,13 @@ class BlockResponder : public Swift::SetResponder<Transport::BlockPayload> {
 
	public:
 
		BlockResponder(Swift::IQRouter *router, UserManager *userManager);
 
		~BlockResponder();
 

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

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

	
 
		UserManager *m_userManager;
 
};
 

	
 
}
 
\ No newline at end of file
 
}
src/discoinforesponder.h
Show inline comments
 
@@ -51,13 +51,13 @@ class DiscoInfoResponder : public Swift::GetResponder<Swift::DiscoInfo> {
 

	
 
	private:
 
		virtual bool handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::DiscoInfo> payload);
 

	
 
		Swift::DiscoInfo m_transportInfo;
 
		Swift::DiscoInfo m_buddyInfo;
 
		Config *m_config;
 
		Swift::CapsInfo m_capsInfo;
 
		std::map<std::string, std::string> m_rooms;
 
		std::map<std::string, std::string> m_commands;
 
};
 

	
 
}
 
\ No newline at end of file
 
}
src/storageresponder.h
Show inline comments
 
@@ -33,13 +33,13 @@ class UserManager;
 
class StorageResponder : public Swift::Responder<Swift::PrivateStorage> {
 
	public:
 
		StorageResponder(Swift::IQRouter *router, StorageBackend *storageBackend, UserManager *userManager);
 
		~StorageResponder();
 

	
 
	private:
 
		virtual bool handleGetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::PrivateStorage> payload);
 
		virtual bool handleSetRequest(const Swift::JID& from, const Swift::JID& to, const std::string& id, boost::shared_ptr<Swift::PrivateStorage> payload);
 
		StorageBackend *m_storageBackend;
 
		UserManager *m_userManager;
 
};
 

	
 
}
 
\ No newline at end of file
 
}
0 comments (0 inline, 0 general)