Changeset - 89e377ba05a4
.gitignore
Show inline comments
 
*.pb.cc
 
*.pb.h
 
plugin/python/protocol_pb2.py
 
\ No newline at end of file
 
plugin/python/protocol_pb2.py
 
Makefile
 
*.cmake
 
*.so
 
*.so.*
 
*.log
 
libtransport_test
 
CMakeFiles
 
spectrum2
 
transport_config.h
 
Doxyfile
 
moc_*
 
CMakeCache.txt
 
*.patch
 
*.orig
 
spectrum2_manager
 
dfrotz
 
spectrum2_frotz_backend
 
spectrum2_libcommuni_backend
 
spectrum2_libpurple_backend
 
spectrum2_skype_backend
 
spectrum2_smstools3_backend
 
spectrum2_swiften_backend
 
spectrum2_template_backend
 
spectrum2_twitter_backend
 
install_manifest.txt
.gitmodules
Show inline comments
 
new file 100644
 
[submodule "msvc-deps/curl"]
 
	path = msvc-deps/curl
 
	url = https://github.com/bagder/curl.git
.travis.yml
Show inline comments
 
new file 100644
 
language: cpp
 
sudo: required
 
dist: trusty
 
before_script:
 
          - curl -k https://swift.im/keys/packages.key | sudo apt-key add -
 
          - echo "deb http://swift.im/packages/ubuntu/trusty development main" | sudo tee -a /etc/apt/sources.list
 
          - sudo apt-get update -qq
 
          - sudo apt-get install -y --force-yes libswiften-dev libprotobuf-dev protobuf-compiler pidgin-dev liblog4cxx10-dev libpopt-dev libboost-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-date-time-dev libcppunit-dev
 
script:
 
          - mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=ON .. && make libtransport_test && ./src/libtransport_test
CMakeLists.txt
Show inline comments
 
@@ -26,7 +26,6 @@ option(ENABLE_SMSTOOLS3 "Build SMSTools3 plugin" ON)
 
option(ENABLE_SKYPE "Build Skype plugin" ON)
 
option(ENABLE_SWIFTEN "Build Swiften plugin" ON)
 
option(ENABLE_TWITTER "Build Twitter plugin" ON)
 
option(ENABLE_YAHOO2 "Build Libyahoo2 plugin" ON)
 

	
 
option(ENABLE_DOCS "Build Docs" ON)
 
# option(ENABLE_LOG "Build with logging using Log4cxx" ON)
 
@@ -77,7 +76,6 @@ if(NOT SWIFTEN_FOUND)
 
endif()
 

	
 
# FIND BOOST
 
set(Boost_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
 
if (WIN32)
 
	set(Boost_USE_STATIC_LIBS      ON)
 
	set(Boost_USE_MULTITHREADED      ON)
 
@@ -115,6 +113,7 @@ endif()
 
# FIND SQLITE3
 
if (ENABLE_SQLITE3)
 
	if (MSVC)
 
		set(SQLITE3_FOUND 1)
 
		ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/msvc-deps)
 
	else()
 
		if (WIN32)
 
@@ -219,10 +218,6 @@ set(dbus_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
 
find_package(dbus)
 
endif()
 

	
 
# if(ENABLE_YAHOO2)
 
# 	set(yahoo2_DIR "${CMAKE_SOURCE_DIR}/cmake_modules")
 
# 	find_package(yahoo2)
 
# endif()
 

	
 
####### Miscallanous ######
 

	
 
@@ -253,16 +248,6 @@ if(ENABLE_TESTS)
 
	endif()
 
endif()
 

	
 
if (APPLE)
 
        FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
 
        FIND_LIBRARY(SECURITY_FRAMEWORK Security)
 
        FIND_LIBRARY(APPKIT_FRAMEWORK AppKit)
 
        FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
 
        FIND_LIBRARY(SECURITYINTERFACE_FRAMEWORK SecurityInterface)
 
        MARK_AS_ADVANCED(IOKIT_FRAMEWORK APPKIT_FRAMEWORK SYSTEMCONFIGURATION_FRAMEWORK SECURITY_FRAMEWORK SECURITYINTERFACE_FRAMEWORK)
 
        SET (APPLE_FRAMEWORKS ${IOKIT_FRAMEWORK} ${APPKIT_FRAMEWORK} ${SYSTEMCONFIGURATION_FRAMEWORK} ${SECURITY_FRAMEWORK} ${SECURITYINTERFACE_FRAMEWORK})
 
endif()
 

	
 
message("  Supported features")
 
message("-----------------------")
 

	
 
@@ -361,7 +346,7 @@ if (PROTOBUF_FOUND)
 
	endif()
 

	
 
	if(IRC_FOUND)
 
		ADD_DEFINITIONS(-DCOMMUNI_SHARED)
 
		ADD_DEFINITIONS(-DIRC_SHARED)
 
		message("IRC plugin        : yes")
 
		include_directories(${QT_QTNETWORK_INCLUDE_DIR})
 
		include_directories(${IRC_INCLUDE_DIR})
 
@@ -405,18 +390,6 @@ if (PROTOBUF_FOUND)
 
		message("Skype plugin      : no (does not run on Win32)")
 
	endif()
 

	
 
#  	if(YAHOO2_FOUND)
 
# 		message("Libyahoo2 plugin  : yes")
 
#  		include_directories(${YAHOO2_INCLUDE_DIR})
 
# 	else()
 
		if(ENABLE_YAHOO2)
 
			set(YAHOO2_FOUND 1)
 
			message("Libyahoo2 plugin  : yes")
 
		else(ENABLE_YAHOO2)
 
			message("Libyahoo2 plugin  : no (user disabled)")
 
		endif()
 
#  	endif()
 

	
 
	if(ENABLE_SWIFTEN)
 
		message("Swiften plugin    : yes")
 
	else()
 
@@ -453,6 +426,10 @@ if (WIN32)
 
	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)
Dockerfile
Show inline comments
 
new file 100644
 
FROM fedora:23
 

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

	
 
RUN dnf install protobuf protobuf swiften gcc gcc-c++ make libpqxx-devel libpurple-devel protobuf-devel swiften-devel rpm-build avahi-devel boost-devel cmake cppunit-devel expat-devel libcommuni-devel libidn-devel libsqlite3x-devel log4cxx-devel mysql-devel popt-devel git libevent-devel qt-devel dbus-glib-devel libcurl-devel -y && \
 
	git clone git://github.com/hanzz/libtransport.git && \
 
	cd libtransport && \
 
	./packaging/fedora/build_rpm.sh && \
 
	rpm -U /root/rpmbuild/RPMS/x86_64/*.rpm && \
 
	cp ./packaging/docker/run.sh /run.sh && \
 
	cd .. && \
 
	rm -rf libtransport && \
 
	rm -rf ~/rpmbuild && \
 
	rm -rf /usr/share/locale/* && \
 
	rm -rf /usr/share/doc/* && \
 
	dnf remove protobuf-devel swiften-devel gcc gcc-c++ libpqxx-devel libevent-devel qt-devel dbus-glib-devel libpurple-devel make rpm-build avahi-devel boost-devel cmake cppunit-devel expat-devel libcommuni-devel libidn-devel libsqlite3x-devel log4cxx-devel mysql-devel popt-devel libcurl-devel spectrum2-debuginfo yum perl -y && \
 
	dnf clean all -y
 

	
 
CMD "/run.sh"
README.md
Show inline comments
 
file renamed from README to README.md
 
[![Build Status](https://travis-ci.org/hanzz/libtransport.png?branch=master)](https://travis-ci.org/hanzz/libtransport)
 

	
 
Spectrum is an XMPP transport/gateway. It allows XMPP users to communicate with
 
their friends who are using one of the supported networks. It supports a wide
 
range of different networks such as ICQ, XMPP (Jabber, GTalk), AIM, MSN,
README.win32
Show inline comments
 
Prerequisites
 
=============
 
 
1. Microsoft Visual C++ 2010 Express or higher edition (http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express)
 
2. Git for Windows (http://code.google.com/p/msysgit/downloads/list)
 
3. CMake 2.8 or newer (http://www.cmake.org/cmake/resources/software.html)
 
4. Python 2.x for Swiften build scripts (scons) (http://www.python.org)
 
 
Libraries
 
=========
 
3. Swiften library (http://swift.im/git/swift)
 
4. Boost 1.48 or newer (http://sourceforge.net/projects/boost/files/boost/1.49.0/)
 
5. Google ProtoBuf library (http://code.google.com/p/protobuf/downloads/list)
 
 
 
Environment
 
===========
 
 
To create spectrum build environment do:
 
 
0. Create directory where we'll install all dependencies, e.g. C:\env-msvc-x64.
 
Create C:\env-msvc-x64\bin and add it to %PATH%.
 
Assuming you have git, python and cmake in %PATH%, 
 
launch "Visual Studio 2010 command prompt" or
 
"Visual Studio 2010(x64) command prompt", depends on your target (Windows x86 or Windows x86_64).
 
1. unpack and build boost libraries:
 
 
	bootstrap.bat
 
	b2.exe --without-mpi --without-python
 
	b2.exe --without-mpi --without-python install --prefix=C:\env-msvc-x64 release
 
 
2. clone swift repository and build it. Don't forget to point it to our env directory:
 
 
	git clone git://swift.im/swift
 
	cd swift
 
	echo boost_includedir="c:/env-msvc-x64/include/boost-1_49" > config.py
 
	echo boost_libdir="c:/env-msvc-x64/lib" >> config.py 
 
	scons.bat debug=no SWIFTEN_INSTALLDIR=C:\env-msvc-x64 force_configure=1
 
	scons.bat debug=no SWIFTEN_INSTALLDIR=C:\env-msvc-x64 C:\env-msvc-x64
 
 
3. unpack and compile protobuf as described in its documentation. 
 
 
Run extract_includes.bat in vsprojects/ directory and move resulting vsprojects/include/google/ directory to our C:\env-msvc-x64\include
 
 
Move protoc.exe to C:\env-msvc-x64\bin\ and libprotobuf.lib to C:\env-msvc-x64\lib
 
 
4. Install gtkmm
 
 
Download installer from https://live.gnome.org/gtkmm/MSWindows and install gtkmm into C:\env-msvc-x64\
 
 
5. Install libpurple headers
 
 
Download http://www.pidgin.im/download/source/ , extract it and copy libpurple directory in C:\env-msvc-x64\include
 
 
6. You're ready! :) Clone libtransport into C:\env-msvc-x64\libtransport (You *must* clone it into this directory, because libtransport will try to find the dependencies in ../lib and ../include)
 
 
Compile it as:
 
 
	set CMAKE_INCLUDE_PATH=C:\env-msvc-x64\include
 
	cmake . -G "NMake Makefiles" -DBOOST_INCLUDEDIR=../include/boost-1_49 -DBOOST_LIBRARYDIR=../lib -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=C:\env-msvc-x64 -DGIT_EXECUTABLE="c:\Program Files (x86)\git\bin\git.exe"
 
	nmake
 
Prerequisites
 
=============
 

	
 
1. Microsoft Visual C++ 2010 Express or higher edition (http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express)
 
2. Git for Windows (http://code.google.com/p/msysgit/downloads/list)
 
3. CMake 2.8 or newer (http://www.cmake.org/cmake/resources/software.html)
 
4. Python 2.x for Swiften build scripts (scons) (http://www.python.org)
 

	
 
Libraries
 
=========
 
3. Swiften library (http://swift.im/git/swift)
 
4. Boost 1.48 or newer (http://sourceforge.net/projects/boost/files/boost/1.49.0/)
 
5. Google ProtoBuf library (http://code.google.com/p/protobuf/downloads/list)
 

	
 

	
 
Environment
 
===========
 

	
 
To create spectrum build environment do:
 

	
 
0. Create directory where we'll install all dependencies, e.g. C:\env-msvc-x64.
 
Create C:\env-msvc-x64\bin and add it to %PATH%.
 
Assuming you have git, python and cmake in %PATH%, 
 
launch "Visual Studio 2010 command prompt" or
 
"Visual Studio 2010(x64) command prompt", depends on your target (Windows x86 or Windows x86_64).
 
1. unpack and build boost libraries:
 

	
 
	bootstrap.bat
 
	b2.exe --without-mpi --without-python
 
	b2.exe --without-mpi --without-python install --prefix=C:\env-msvc-x64 release
 

	
 
2. clone swift repository and build it. Don't forget to point it to our env directory:
 

	
 
	git clone git://swift.im/swift
 
	cd swift
 
	echo boost_includedir="c:/env-msvc-x64/include/boost-1_49" > config.py
 
	echo boost_libdir="c:/env-msvc-x64/lib" >> config.py 
 
	scons.bat debug=no SWIFTEN_INSTALLDIR=C:\env-msvc-x64 force_configure=1
 
	scons.bat debug=no SWIFTEN_INSTALLDIR=C:\env-msvc-x64 C:\env-msvc-x64
 

	
 
3. unpack and compile protobuf as described in its documentation. 
 

	
 
Run extract_includes.bat in vsprojects/ directory and move resulting vsprojects/include/google/ directory to our C:\env-msvc-x64\include
 

	
 
Move protoc.exe to C:\env-msvc-x64\bin\ and libprotobuf.lib to C:\env-msvc-x64\lib
 

	
 
4. Install gtkmm
 

	
 
Download installer from https://live.gnome.org/gtkmm/MSWindows and install gtkmm into C:\env-msvc-x64\
 

	
 
5. Install libpurple headers
 

	
 
Download http://www.pidgin.im/download/source/ , extract it and copy libpurple directory in C:\env-msvc-x64\include
 

	
 
6. You're ready! :) Clone libtransport into C:\env-msvc-x64\libtransport (You *must* clone it into this directory, because libtransport will try to find the dependencies in ../lib and ../include)
 

	
 
Compile it as:
 

	
 
	set CMAKE_INCLUDE_PATH=C:\env-msvc-x64\include
 
	cmake . -G "NMake Makefiles" -DBOOST_INCLUDEDIR=../include/boost-1_49 -DBOOST_LIBRARYDIR=../lib -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=C:\env-msvc-x64 -DGIT_EXECUTABLE="c:\Program Files (x86)\git\bin\git.exe"
 
	nmake
backends/CMakeLists.txt
Show inline comments
 
@@ -22,9 +22,6 @@ if (PROTOBUF_FOUND)
 
		if(ENABLE_FROTZ)
 
			ADD_SUBDIRECTORY(frotz)
 
		endif()
 
 		if(YAHOO2_FOUND)
 
			ADD_SUBDIRECTORY(libyahoo2)
 
	 	endif()
 
		if (${LIBDBUSGLIB_FOUND})
 
			ADD_SUBDIRECTORY(skype)
 
		endif()
backends/frotz/CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 2.6)
 
 
ADD_SUBDIRECTORY(dfrotz)
 
 
FILE(GLOB SRC *.c *.cpp)
 
 
ADD_EXECUTABLE(spectrum2_frotz_backend ${SRC})
 
 
target_link_libraries(spectrum2_frotz_backend transport pthread ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES})
 
 
INSTALL(TARGETS spectrum2_frotz_backend RUNTIME DESTINATION bin)
 
 
cmake_minimum_required(VERSION 2.6)
 

	
 
ADD_SUBDIRECTORY(dfrotz)
 

	
 
FILE(GLOB SRC *.c *.cpp)
 

	
 
ADD_EXECUTABLE(spectrum2_frotz_backend ${SRC})
 

	
 
target_link_libraries(spectrum2_frotz_backend transport pthread ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES})
 

	
 
INSTALL(TARGETS spectrum2_frotz_backend RUNTIME DESTINATION bin)
 

	
backends/frotz/dfrotz/CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC common/*.c dumb/*.c)
 
 
ADD_EXECUTABLE(dfrotz ${SRC})
 
 
# target_link_libraries(dfrotz)
 
 
INSTALL(TARGETS dfrotz RUNTIME DESTINATION bin)
 
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC common/*.c dumb/*.c)
 

	
 
ADD_EXECUTABLE(dfrotz ${SRC})
 

	
 
# target_link_libraries(dfrotz)
 

	
 
INSTALL(TARGETS dfrotz RUNTIME DESTINATION bin)
 

	
backends/frotz/main.cpp
Show inline comments
 
@@ -8,8 +8,8 @@
 
 * program, but you don't have to.
 
 */
 

	
 
#include "transport/config.h"
 
#include "transport/networkplugin.h"
 
#include "transport/Config.h"
 
#include "transport/NetworkPlugin.h"
 
#include "Swiften/Swiften.h"
 
#include <boost/filesystem.hpp>
 
#include "unistd.h"
backends/libcommuni/CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC *.cpp)
 
FILE(GLOB HEADERS *.h)
 
QT4_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
 
ADD_EXECUTABLE(spectrum2_libcommuni_backend ${SRC})
 
 
if (NOT WIN32)
 
	target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} ${QT_LIBRARIES} transport pthread)
 
else ()
 
	target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} ${QT_LIBRARIES} transport)
 
endif()
 
INSTALL(TARGETS spectrum2_libcommuni_backend RUNTIME DESTINATION bin)
 
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC *.cpp)
 
FILE(GLOB HEADERS *.h)
 
QT4_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
 
ADD_EXECUTABLE(spectrum2_libcommuni_backend ${SRC})
 

	
 
if (NOT WIN32)
 
	target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} ${QT_LIBRARIES} transport pthread)
 
else ()
 
	target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} ${QT_LIBRARIES} transport)
 
endif()
 
INSTALL(TARGETS spectrum2_libcommuni_backend RUNTIME DESTINATION bin)
 

	
backends/libcommuni/ircnetworkplugin.cpp
Show inline comments
 
@@ -21,7 +21,7 @@
 
#include "ircnetworkplugin.h"
 
#include <IrcCommand>
 
#include <IrcMessage>
 
#include "transport/logging.h"
 
#include "transport/Logging.h"
 

	
 
DEFINE_LOGGER(logger, "IRCNetworkPlugin");
 

	
backends/libcommuni/ircnetworkplugin.h
Show inline comments
 
@@ -20,8 +20,8 @@
 

	
 
#pragma once
 
#ifndef Q_MOC_RUN
 
#include "transport/config.h"
 
#include "transport/networkplugin.h"
 
#include "transport/Config.h"
 
#include "transport/NetworkPlugin.h"
 
#include "session.h"
 
#include <QtCore>
 
#include <QtNetwork>
backends/libcommuni/main.cpp
Show inline comments
 
@@ -18,9 +18,9 @@
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 
 */
 

	
 
#include "transport/config.h"
 
#include "transport/networkplugin.h"
 
#include "transport/logging.h"
 
#include "transport/Config.h"
 
#include "transport/NetworkPlugin.h"
 
#include "transport/Logging.h"
 
#include "session.h"
 
#include <QtCore>
 
#include <QtNetwork>
backends/libcommuni/session.cpp
Show inline comments
 
@@ -23,9 +23,6 @@
 
#include <iostream>
 
#include <IrcCommand>
 
#include <IrcMessage>
 
#if COMMUNI_VERSION < 0x020000
 
#include <IrcUtil>
 
#endif
 
#include "backports.h"
 

	
 
#include "ircnetworkplugin.h"
 
@@ -33,13 +30,13 @@
 
#define FROM_UTF8(WHAT) QString::fromUtf8((WHAT).c_str(), (WHAT).size())
 
#define TO_UTF8(WHAT) std::string((WHAT).toUtf8().data(), (WHAT).toUtf8().size())
 

	
 
#include "transport/logging.h"
 
#include "transport/Logging.h"
 

	
 
DEFINE_LOGGER(logger, "IRCSession");
 
DEFINE_LOGGER(logger, "IRCConnection");
 

	
 
static bool sentList;
 

	
 
MyIrcSession::MyIrcSession(const std::string &user, IRCNetworkPlugin *np, const std::string &suffix, QObject* parent) : IrcSession(parent)
 
MyIrcSession::MyIrcSession(const std::string &user, IRCNetworkPlugin *np, const std::string &suffix, QObject* parent) : IrcConnection(parent)
 
{
 
	this->np = np;
 
	this->user = user;
 
@@ -137,7 +134,7 @@ bool MyIrcSession::correctNickname(std::string &nickname) {
 

	
 
void MyIrcSession::on_joined(IrcMessage *message) {
 
	IrcJoinMessage *m = (IrcJoinMessage *) message;
 
	std::string nickname = TO_UTF8(m->sender().name());
 
	std::string nickname = TO_UTF8(m->nick());
 
	bool op = correctNickname(nickname);
 
	getIRCBuddy(TO_UTF8(m->channel().toLower()), nickname).setOp(op);
 
	np->handleParticipantChanged(user, nickname, TO_UTF8(m->channel().toLower()) + suffix, op, pbnetwork::STATUS_ONLINE);
 
@@ -147,7 +144,7 @@ void MyIrcSession::on_joined(IrcMessage *message) {
 

	
 
void MyIrcSession::on_parted(IrcMessage *message) {
 
	IrcPartMessage *m = (IrcPartMessage *) message;
 
	std::string nickname = TO_UTF8(m->sender().name());
 
	std::string nickname = TO_UTF8(m->nick());
 
	bool op = correctNickname(nickname);
 
	removeIRCBuddy(TO_UTF8(m->channel().toLower()), nickname);
 
	LOG4CXX_INFO(logger, user << ": " << nickname << " parted " << TO_UTF8(m->channel().toLower()) + suffix);
 
@@ -156,7 +153,7 @@ void MyIrcSession::on_parted(IrcMessage *message) {
 

	
 
void MyIrcSession::on_quit(IrcMessage *message) {
 
	IrcQuitMessage *m = (IrcQuitMessage *) message;
 
	std::string nickname = TO_UTF8(m->sender().name());
 
	std::string nickname = TO_UTF8(m->nick());
 
	bool op = correctNickname(nickname);
 

	
 
	for(AutoJoinMap::iterator it = m_autoJoin.begin(); it != m_autoJoin.end(); it++) {
 
@@ -171,7 +168,7 @@ void MyIrcSession::on_quit(IrcMessage *message) {
 

	
 
void MyIrcSession::on_nickChanged(IrcMessage *message) {
 
	IrcNickMessage *m = (IrcNickMessage *) message;
 
	std::string nickname = TO_UTF8(m->sender().name());
 
	std::string nickname = TO_UTF8(m->nick());
 
	correctNickname(nickname);
 

	
 
	for(AutoJoinMap::iterator it = m_autoJoin.begin(); it != m_autoJoin.end(); it++) {
 
@@ -214,7 +211,7 @@ void MyIrcSession::on_modeChanged(IrcMessage *message) {
 
void MyIrcSession::on_topicChanged(IrcMessage *message) {
 
	IrcTopicMessage *m = (IrcTopicMessage *) message;
 

	
 
	std::string nickname = TO_UTF8(m->sender().name());
 
	std::string nickname = TO_UTF8(m->nick());
 
	correctNickname(nickname);
 

	
 
	LOG4CXX_INFO(logger, user << ": " << nickname << " topic changed to " << TO_UTF8(m->topic()));
 
@@ -224,14 +221,14 @@ void MyIrcSession::on_topicChanged(IrcMessage *message) {
 
void MyIrcSession::on_messageReceived(IrcMessage *message) {
 
	IrcPrivateMessage *m = (IrcPrivateMessage *) message;
 
	if (m->isRequest()) {
 
		QString request = m->message().split(" ", QString::SkipEmptyParts).value(0).toUpper();
 
		QString request = m->content().split(" ", QString::SkipEmptyParts).value(0).toUpper();
 
		if (request == "PING" || request == "TIME" || request == "VERSION") {
 
			LOG4CXX_INFO(logger, user << ": " << TO_UTF8(request) << " received and has been answered");
 
			return;
 
		}
 
	}
 

	
 
	QString msg = m->message();
 
	QString msg = m->content();
 
	if (m->isAction()) {
 
		msg = QString("/me ") + msg;
 
	}
 
@@ -249,12 +246,12 @@ void MyIrcSession::on_messageReceived(IrcMessage *message) {
 
	std::string target = TO_UTF8(m->target().toLower());
 
	LOG4CXX_INFO(logger, user << ": Message from " << target);
 
	if (target.find("#") == 0) {
 
		std::string nickname = TO_UTF8(m->sender().name());
 
		std::string nickname = TO_UTF8(m->nick());
 
		correctNickname(nickname);
 
		np->handleMessage(user, target + suffix, TO_UTF8(msg), nickname, TO_UTF8(html));
 
	}
 
	else {
 
		std::string nickname = TO_UTF8(m->sender().name());
 
		std::string nickname = TO_UTF8(m->nick());
 
		correctNickname(nickname);
 
		if (m_pms.find(nickname) != m_pms.end()) {
 
			if (hasIRCBuddy(m_pms[nickname], nickname)) {
 
@@ -393,19 +390,19 @@ void MyIrcSession::awayTimeout() {
 

	
 
void MyIrcSession::on_noticeMessageReceived(IrcMessage *message) {
 
	IrcNoticeMessage *m = (IrcNoticeMessage *) message;
 
	LOG4CXX_INFO(logger, user << ": NOTICE " << TO_UTF8(m->message()));
 
	LOG4CXX_INFO(logger, user << ": NOTICE " << TO_UTF8(m->content()));
 

	
 
	QString msg = m->message();
 
	QString msg = m->content();
 
	CommuniBackport::toPlainText(msg);
 

	
 
	std::string target = TO_UTF8(m->target().toLower());
 
	if (target.find("#") == 0) {
 
		std::string nickname = TO_UTF8(m->sender().name());
 
		std::string nickname = TO_UTF8(m->nick());
 
		correctNickname(nickname);
 
		np->handleMessage(user, target + suffix, TO_UTF8(msg), nickname);
 
	}
 
	else {
 
		std::string nickname = TO_UTF8(m->sender().name());
 
		std::string nickname = TO_UTF8(m->nick());
 
		correctNickname(nickname);
 
		if (nickname.find(".") != std::string::npos) {
 
			return;
backends/libcommuni/session.h
Show inline comments
 
@@ -22,8 +22,8 @@
 
#define SESSION_H
 

	
 
#ifndef Q_MOC_RUN
 
#include <IrcSession>
 
#include <transport/networkplugin.h>
 
#include <IrcConnection>
 
#include <transport/NetworkPlugin.h>
 
#include "Swiften/Swiften.h"
 
#include <boost/smart_ptr/make_shared.hpp>
 
#include <QTimer>
 
@@ -33,7 +33,7 @@ using namespace Transport;
 

	
 
class IRCNetworkPlugin;
 

	
 
class MyIrcSession : public IrcSession
 
class MyIrcSession : public IrcConnection
 
{
 
    Q_OBJECT
 

	
backends/libpurple/CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC *.cpp)
 
 
ADD_EXECUTABLE(spectrum2_libpurple_backend ${SRC})
 
 
if(CMAKE_COMPILER_IS_GNUCXX)
 
	if (NOT WIN32)
 
	target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread)
 
	else()
 
	target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin)
 
	endif()
 
else()
 
target_link_libraries(spectrum2_libpurple_backend sqlite3 ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin ${PROTOBUF_LIBRARY})
 
endif()
 
 
INSTALL(TARGETS spectrum2_libpurple_backend RUNTIME DESTINATION bin)
 
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC *.cpp)
 

	
 
ADD_EXECUTABLE(spectrum2_libpurple_backend ${SRC})
 

	
 
if(CMAKE_COMPILER_IS_GNUCXX)
 
	if (NOT WIN32)
 
	target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread)
 
	else()
 
	target_link_libraries(spectrum2_libpurple_backend ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin)
 
	endif()
 
else()
 
target_link_libraries(spectrum2_libpurple_backend sqlite3 ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin ${PROTOBUF_LIBRARY})
 
endif()
 

	
 
INSTALL(TARGETS spectrum2_libpurple_backend RUNTIME DESTINATION bin)
 

	
backends/libpurple/geventloop.cpp
Show inline comments
 
@@ -30,7 +30,7 @@
 

	
 
#include "purple_defs.h"
 

	
 
#include "transport/logging.h"
 
#include "transport/Logging.h"
 

	
 
DEFINE_LOGGER(logger, "EventLoop");
 

	
backends/libpurple/main.cpp
Show inline comments
 
@@ -10,10 +10,9 @@
 
#include <algorithm>
 
#include <iostream>
 

	
 
#include "transport/networkplugin.h"
 
#include "transport/logging.h"
 
#include "transport/config.h"
 
#include "transport/logging.h"
 
#include "transport/NetworkPlugin.h"
 
#include "transport/Logging.h"
 
#include "transport/Config.h"
 
#include "geventloop.h"
 

	
 
// #include "valgrind/memcheck.h"
 
@@ -518,7 +517,11 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
				}
 
				m_vcards[user + name] = id;
 

	
 
				if (CONFIG_BOOL(config, "backend.no_vcard_fetch") && name != purple_account_get_username_wrapped(account)) {
 
				PurplePlugin *prpl = purple_find_prpl_wrapped(purple_account_get_protocol_id_wrapped(account));
 
				PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
				bool support_get_info = prpl_info && prpl_info->get_info;
 

	
 
				if (!support_get_info || (CONFIG_BOOL(config, "backend.no_vcard_fetch") && name != purple_account_get_username_wrapped(account))) {
 
					PurpleNotifyUserInfo *user_info = purple_notify_user_info_new_wrapped();
 
					notify_user_info(purple_account_get_connection_wrapped(account), name.c_str(), user_info);
 
					purple_notify_user_info_destroy_wrapped(user_info);
 
@@ -526,7 +529,6 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
				else {
 
					serv_get_info_wrapped(purple_account_get_connection_wrapped(account), name.c_str());
 
				}
 
				
 
			}
 
		}
 

	
 
@@ -635,6 +637,11 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
 
			PurpleAccount *account = m_sessions[user];
 
			if (account) {
 
				serv_send_typing_wrapped(purple_account_get_connection_wrapped(account), buddyName.c_str(), PURPLE_NOT_TYPING);
 
				PurpleConversation *conv = purple_find_conversation_with_account_wrapped(PURPLE_CONV_TYPE_CHAT, buddyName.c_str(), account);
 
				if (conv) {
 
					purple_conversation_set_data_wrapped(conv, "unseen_count", 0);
 
					purple_conversation_update_wrapped(conv, PURPLE_CONV_UPDATE_UNSEEN);
 
				}
 
			}
 
		}
 

	
backends/libpurple/purple_defs.h
Show inline comments
 
@@ -224,6 +224,12 @@ extern purple_conversation_new_wrapped_fnc purple_conversation_new_wrapped;
 
typedef PurpleConversationType  (_cdecl * purple_conversation_get_type_wrapped_fnc)(const PurpleConversation *conv);
 
extern purple_conversation_get_type_wrapped_fnc purple_conversation_get_type_wrapped;
 

	
 
typedef void (_cdecl * purple_conversation_set_data_wrapped_func)(const PurpleConversation *conv, const char *key, gpointer data); 
 
extern purple_conversation_set_data_wrapped_func purple_conversation_set_data_wrapped;
 

	
 
typedef void (_cdecl * purple_conversation_update_wrapped_func)(const PurpleConversation *conv, PurpleConversationUpdateType type); 
 
extern purple_conversation_update_wrapped_func purple_conversation_update_wrapped;
 

	
 
typedef void  (_cdecl * purple_conv_im_send_wrapped_fnc)(PurpleConvIm *im, const char *message);
 
extern purple_conv_im_send_wrapped_fnc purple_conv_im_send_wrapped;
 

	
 
@@ -524,6 +530,8 @@ extern wpurple_g_io_channel_win32_new_socket_wrapped_fnc wpurple_g_io_channel_wi
 
#define purple_find_conversation_with_account_wrapped purple_find_conversation_with_account
 
#define purple_conversation_new_wrapped purple_conversation_new
 
#define purple_conversation_get_type_wrapped purple_conversation_get_type
 
#define purple_conversation_set_data_wrapped purple_conversation_set_data
 
#define purple_conversation_update_wrapped purple_conversation_update
 
#define purple_conv_im_send_wrapped purple_conv_im_send
 
#define purple_conv_chat_send_wrapped purple_conv_chat_send
 
#define purple_conversation_destroy_wrapped purple_conversation_destroy
backends/libyahoo2/CMakeLists.txt
Show inline comments
 
deleted file
backends/libyahoo2/httpfetch.cpp
Show inline comments
 
deleted file
backends/libyahoo2/httpfetch.h
Show inline comments
 
deleted file
backends/libyahoo2/main.cpp
Show inline comments
 
deleted file
backends/libyahoo2/sample_client.example
Show inline comments
 
deleted file
backends/libyahoo2/yahoo/crypt.c
Show inline comments
 
deleted file
backends/libyahoo2/yahoo/libyahoo2.c
Show inline comments
 
deleted file

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)