Changeset - 5dba4612b5f7
[Not reviewed]
0 4 0
Florian Kinder - 7 years ago 2018-12-01 11:38:15
florian.kinder@fankserver.com
Syntax fixes
4 files changed with 14 insertions and 6 deletions:
0 comments (0 inline, 0 general)
Dockerfile
Show inline comments
 
FROM frolvlad/alpine-glibc:alpine-3.6
 

	
 
EXPOSE 5222 5269
 
VOLUME ["/etc/spectrum2/transports", "/var/lib/spectrum2"]
 

	
 
ADD . /usr/src/spectrum2
 

	
 
RUN apk add --no-cache ca-certificates && \
 
    apk add --no-cache --virtual .build-deps cmake make gcc g++ musl-dev boost-dev glib-dev protobuf-dev mariadb-dev sqlite-dev postgresql-dev pidgin-dev libev-dev qt-dev apr-util-dev automake autoconf libtool git popt-dev curl-dev openssl && \
 
    apk add --no-cache --virtual .build-deps cmake make gcc g++ musl-dev boost-dev glib-dev protobuf-dev mariadb-dev sqlite-dev postgresql-dev pidgin-dev libev-dev qt-dev apr-util-dev automake autoconf libtool git popt-dev curl-dev openssl libevent-dev && \
 
    cd /usr/src/ && \
 

	
 
    wget https://github.com/communi/libcommuni/archive/v3.5.0.tar.gz -O libcommuni-3.5.0.tar.gz && \
 
    tar xfz libcommuni-*.tar.gz && \
 
    cd libcommuni-* && \
 
    ./configure && \
 
    make && \
 
    make install && \
 
    cd .. && rm -rf libcommuni-* && \
 

	
 
    git clone git://git.apache.org/logging-log4cxx.git && \
 
    cd logging-log4cxx && \
 
    ./autogen.sh && \
 
    ./configure && \
 
    make && \
 
    make install && \
 
    cd .. && rm -rf logging-log4cxx && \
 

	
 
    wget http://pqxx.org/download/software/libpqxx/libpqxx-4.0.1.tar.gz && \
 
    tar xfz libpqxx-*.tar.gz && \
 
    cd libpqxx-* && \
 
    ./autogen.sh && \
 
    ./configure --disable-documentation && \
 
    ./configure --enable-shared --disable-documentation && \
 
    make && \
 
    make install && \
 
    cd .. && rm -rf libpqxx-* && \
 

	
 
    wget https://swift.im/downloads/releases/swift-4.0rc2/swift-4.0rc2.tar.gz && \
 
    tar xfz swift-*.tar.gz && \
 
    cd swift-* && \
 
    ./scons SWIFT_INSTALLDIR=/usr/local /usr/local && \
 
    ./scons Swiften SWIFTEN_INSTALLDIR=/usr/local /usr/local && \
 
    cd .. && rm -rf swift-* && \
 

	
 
    cd spectrum2 && \
 
    cmake . && \
 
    make && \
 

	
 
    apk del .build-deps
backends/libpurple/main.cpp
Show inline comments
 
@@ -473,25 +473,25 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
					std::string data = stringOf(purple_account_get_int_wrapped(account, "version", 0));
 
					g_file_set_contents ("gfire.cfg", data.c_str(), data.size(), NULL);
 
				}
 
// 				VALGRIND_DO_LEAK_CHECK;
 
				m_sessions.erase(user);
 
				purple_account_disconnect_wrapped(account);
 
				purple_account_set_enabled_wrapped(account, "spectrum", FALSE);
 

	
 
				m_accounts.erase(account);
 

	
 
				purple_accounts_delete_wrapped(account);
 
#ifndef WIN32
 
#if !defined(__FreeBSD__) && !defined(__APPLE__)
 
#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
 
				malloc_trim(0);
 
#endif
 
#endif
 
// 				VALGRIND_DO_LEAK_CHECK;
 
			}
 
		}
 

	
 
		void handleStatusChangeRequest(const std::string &user, int status, const std::string &statusMessage) {
 
			PurpleAccount *account = m_sessions[user];
 
			if (account) {
 
				int st;
 
				switch(status) {
 
@@ -2102,25 +2102,25 @@ static PurpleCoreUiOps coreUiOps =
 
	transport_core_ui_init,
 
	NULL,
 
	spectrum_ui_get_info,
 
	NULL,
 
	NULL,
 
	NULL
 
};
 

	
 
static void signed_on(PurpleConnection *gc, gpointer unused) {
 
	PurpleAccount *account = purple_connection_get_account_wrapped(gc);
 
	np->handleConnected(np->m_accounts[account]);
 
#ifndef WIN32
 
#if !defined(__FreeBSD__) && !defined(__APPLE__)
 
#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
 
	// force returning of memory chunks allocated by libxml2 to kernel
 
	malloc_trim(0);
 
#endif
 
#endif
 
	purple_roomlist_get_list_wrapped(gc);
 

	
 
	// For prpl-gg
 
	execute_purple_plugin_action(gc, "Download buddylist from Server");
 
	if (CONFIG_STRING(config, "service.protocol") == "prpl-hangouts") {
 
		storeUserToken(np->m_accounts[account], OAUTH_TOKEN, purple_account_get_password_wrapped(account));
 
	}
 
	else if (CONFIG_STRING(config, "service.protocol") == "prpl-steam-mobile") {
 
@@ -2326,25 +2326,25 @@ static void transportDataReceived(gpointer data, gint source, PurpleInputConditi
 
		if (writeInput != 0) {
 
			purple_input_remove_wrapped(writeInput);
 
			writeInput = 0;
 
		}
 
		np->readyForData();
 
	}
 
}
 

	
 
int main(int argc, char **argv) {
 
	boost::locale::generator gen;
 
	std::locale::global(gen(""));
 
#ifndef WIN32
 
#if !defined(__FreeBSD__) && !defined(__APPLE__)
 
#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
 
		mallopt(M_CHECK_ACTION, 2);
 
		mallopt(M_PERTURB, 0xb);
 
#endif
 

	
 
		signal(SIGPIPE, SIG_IGN);
 

	
 
		if (signal(SIGCHLD, spectrum_sigchld_handler) == SIG_ERR) {
 
			std::cout << "SIGCHLD handler can't be set\n";
 
			return -1;
 
		}
 
#endif
 

	
backends/swiften/main.cpp
Show inline comments
 
@@ -218,28 +218,30 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient {
 
			SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Client> client = m_users[user];
 
			if (client) {
 
				client->onConnected.disconnect(boost::bind(&SwiftenPlugin::handleSwiftConnected, this, user));
 
				client->onDisconnected.disconnect(boost::bind(&SwiftenPlugin::handleSwiftDisconnected, this, user, _1));
 
				client->onMessageReceived.disconnect(boost::bind(&SwiftenPlugin::handleSwiftMessageReceived, this, user, _1));
 
				m_users.erase(user);
 
				m_handlers.erase(user);
 
			}
 

	
 
#ifndef WIN32
 
#ifndef __FreeBSD__
 
#ifndef __MACH__
 
#if defined (__GLIBC__)
 
			// force returning of memory chunks allocated by libxml2 to kernel
 
			malloc_trim(0);
 
#endif
 
#endif
 
#endif
 
#endif
 
		}
 

	
 
		void handleSwiftConnected(const std::string &user) {
 
			LOG4CXX_INFO(logger, user << ": Connected to XMPP server.");
 
			handleConnected(user);
 
			m_users[user]->requestRoster();
 
			Swift::Presence::ref response = Swift::Presence::create();
 
			response->setFrom(m_users[user]->getJID());
 
			m_users[user]->sendPresence(response);
 
		}
 

	
spectrum/src/main.cpp
Show inline comments
 
@@ -311,29 +311,31 @@ int main(int argc, char **argv)
 
	std::string jid;
 
#ifdef WIN32
 
	std::string install_service_name, uninstall_service_name, run_service_name;
 
	// determine the name of the currently executing file
 
	char szFilePath[MAX_PATH];
 
	GetModuleFileNameA(NULL, szFilePath, sizeof(szFilePath));
 
	std::string exe_file(szFilePath);
 
#endif
 
	setlocale(LC_ALL, "");
 
#ifndef WIN32
 
#ifndef __FreeBSD__
 
#ifndef __MACH__
 
#if defined (__GLIBC__)
 
	mallopt(M_CHECK_ACTION, 2);
 
	mallopt(M_PERTURB, 0xb);
 
#endif
 
#endif
 
#endif
 
#endif
 

	
 
#ifndef WIN32
 
	if (signal(SIGINT, spectrum_sigint_handler) == SIG_ERR) {
 
		std::cout << "SIGINT handler can't be set\n";
 
		return -1;
 
	}
 

	
 
	if (signal(SIGTERM, spectrum_sigterm_handler) == SIG_ERR) {
 
		std::cout << "SIGTERM handler can't be set\n";
 
		return -1;
 
	}
 
#else
0 comments (0 inline, 0 general)