# -DWITH_PHONON=OFF : Disable Phonon support (audio notifications)
# -DWITH_LIBINDICATE=OFF : Disable libindicate support (Ayatana notifications)
# -DWITH_KDE=ON : Enable KDE4 support
-# -DWITH_CRYPT=OFF : Disable crypt support
+# -DWITH_CRYPT=OFF : Disable encryption support
# -DWITH_OXYGEN=(ON|OFF) : Whether to install Oxygen icons (default: yes, unless KDE > 4.3.0 is present and enabled)
#
# -DEMBED_DATA=ON : Embed all data files in icons the binary, rather than installing them separately
option(WITH_PHONON "Enable Phonon support (for audio notifications)" ON)
option(WITH_LIBINDICATE "Enable Ayatana notification support" ON)
option(WITH_KDE "Enable KDE4 integration" OFF)
-option(WITH_CRYPT "Enable crypt support if present on system" ON)
+option(WITH_CRYPT "Enable encryption support if present on system" ON)
# We use icon paths from KDE 4.3.x, which are partially invalid on older and possibly
# even on newer KDE versions. Do not disable this unless you are sure that your Quassel will
set(INDICATEQT_LIBRARIES "")
endif(WITH_LIBINDICATE)
-# Setup QtWebKit support
+# Setup encyption support
if(WITH_CRYPT)
find_package(QCA2)
if(QCA2_FOUND)
- message(STATUS "Found qca2, enabling crypt support")
+ message(STATUS "Found QCA2, enabling encryption support")
add_definitions(-DHAVE_QCA2)
set(LINK_QCA2 QCA2)
set(HAVE_QCA2 true)
set(MOC_DEFINES ${MOC_DEFINES} -DHAVE_QCA2)
else(QCA2_FOUND)
- message(STATUS "qca2 not found, disabling crypt support")
+ message(STATUS "QCA2 not found, disabling encryption support")
endif(QCA2_FOUND)
else(WITH_CRYPT)
- message(STATUS "Not enabling crypt support")
+ message(STATUS "Not enabling encryption support")
endif(WITH_CRYPT)
# Now set up install locations; those are set by KDE if integration is enabled
link_directories(${INDICATEQT_LIBRARY_DIRS})
endif(HAVE_INDICATEQT)
-if (QCA2_FOUND)
- include_directories(${QCA2_INCLUDE_DIR})
-endif (QCA2_FOUND)
-
if(WANT_CORE)
setup_qt4_variables(NETWORK SCRIPT SQL)
add_executable(quasselcore common/main.cpp ${COMMON_DEPS} ${CORE_DEPS})
set(QT_USE_QTDBUS 1)
include(${QT_USE_FILE})
-if (QCA2_FOUND)
- include_directories(${QCA2_INCLUDE_DIR})
-endif (QCA2_FOUND)
-
set(SOURCES
abstractmessageprocessor.cpp
backlogrequester.cpp
# Builds the common module
-if (QCA2_FOUND)
- include_directories(${QCA2_INCLUDE_DIR})
-endif (QCA2_FOUND)
-
set(QT_DONT_USE_QTGUI 1)
set(QT_USE_QTNETWORK 1)
include(${QT_USE_FILE})
syncableobject.cpp
util.cpp)
-if (QCA2_FOUND)
- set(SOURCES ${SOURCES}
- cipher.cpp)
-endif (QCA2_FOUND)
-
-if(CMAKE_HOST_WIN32)
- set(SOURCES ${SOURCES} logbacktrace_win.cpp)
-endif(CMAKE_HOST_WIN32)
-if(CMAKE_HOST_UNIX)
- set(SOURCES ${SOURCES} logbacktrace_unix.cpp)
-endif(CMAKE_HOST_UNIX)
-
set(MOC_HDRS
aliasmanager.h
backlogmanager.h
types.h
util.h)
-if (QCA2_FOUND)
- set(HEADERS ${HEADERS}
- cipher.h)
-endif (QCA2_FOUND)
-
if(APPLE)
set(SOURCES ${SOURCES} mac_utils.cpp)
set(HEADERS ${HEADERS} mac_utils.h)
endif(APPLE)
+if(CMAKE_HOST_WIN32)
+ set(SOURCES ${SOURCES} logbacktrace_win.cpp)
+endif(CMAKE_HOST_WIN32)
+if(CMAKE_HOST_UNIX)
+ set(SOURCES ${SOURCES} logbacktrace_unix.cpp)
+endif(CMAKE_HOST_UNIX)
+
qt4_wrap_cpp(MOC ${MOC_HDRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) # for version.inc and version.gen
target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
endif(APPLE)
-if (QCA2_FOUND)
- target_link_libraries(mod_common ${QCA2_LIBRARIES})
-endif (QCA2_FOUND)
-
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
find_library(libdl dl)
if(NOT libdl MATCHES "NOTFOUND")
_initialized(false),
_name(channelname),
_topic(QString()),
- network(network),
+ _network(network),
_codecForEncoding(0),
_codecForDecoding(0)
{
setObjectName(QString::number(network->networkId().toInt()) + "/" + channelname);
-
- #ifdef HAVE_QCA2
- _cipher = 0;
- #endif
}
IrcChannel::~IrcChannel() {
qWarning() << "Channel" << name() << "received IrcUser Nullpointer!";
return false;
}
-
+
if(!_userModes.contains(ircuser)) {
qWarning() << "Channel" << name() << "received data for unknown User" << ircuser->nick();
return false;
}
QString IrcChannel::userModes(const QString &nick) const {
- return userModes(network->ircUser(nick));
+ return userModes(network()->ircUser(nick));
}
void IrcChannel::setCodecForEncoding(const QString &name) {
}
QString IrcChannel::decodeString(const QByteArray &text) const {
- if(!codecForDecoding()) return network->decodeString(text);
+ if(!codecForDecoding()) return network()->decodeString(text);
return ::decodeString(text, _codecForDecoding);
}
if(codecForEncoding()) {
return _codecForEncoding->fromUnicode(string);
}
- return network->encodeString(string);
+ return network()->encodeString(string);
}
// ====================
void IrcChannel::joinIrcUsers(const QStringList &nicks, const QStringList &modes) {
QList<IrcUser *> users;
foreach(QString nick, nicks)
- users << network->newIrcUser(nick);
+ users << network()->newIrcUser(nick);
joinIrcUsers(users, modes);
}
-
+
void IrcChannel::joinIrcUser(IrcUser *ircuser) {
QList <IrcUser *> users;
users << ircuser;
// the joines are propagted by the ircuser. the signal ircUserParted is only for convenience
disconnect(ircuser, 0, this, 0);
emit ircUserParted(ircuser);
-
- if(network->isMe(ircuser) || _userModes.isEmpty()) {
+
+ if(network()->isMe(ircuser) || _userModes.isEmpty()) {
// in either case we're no longer in the channel
// -> clean up the channel and destroy it
QList<IrcUser *> users = _userModes.keys();
_userModes.clear();
foreach(IrcUser *user, users) {
- disconnect(user, 0, this, 0);
- user->partChannel(this);
+ disconnect(user, 0, this, 0);
+ user->partChannel(this);
}
emit parted();
- network->removeIrcChannel(this);
+ network()->removeIrcChannel(this);
}
}
}
void IrcChannel::part(const QString &nick) {
- part(network->ircUser(nick));
+ part(network()->ircUser(nick));
}
// SET USER MODE
}
void IrcChannel::setUserModes(const QString &nick, const QString &modes) {
- setUserModes(network->ircUser(nick), modes);
+ setUserModes(network()->ircUser(nick), modes);
}
// ADD USER MODE
}
void IrcChannel::addUserMode(const QString &nick, const QString &mode) {
- addUserMode(network->ircUser(nick), mode);
+ addUserMode(network()->ircUser(nick), mode);
}
// REMOVE USER MODE
}
void IrcChannel::removeUserMode(const QString &nick, const QString &mode) {
- removeUserMode(network->ircUser(nick), mode);
+ removeUserMode(network()->ircUser(nick), mode);
}
// INIT SET USER MODES
QStringList modes;
QVariantMap::const_iterator iter = usermodes.constBegin();
while(iter != usermodes.constEnd()) {
- users << network->newIrcUser(iter.key());
+ users << network()->newIrcUser(iter.key());
modes << iter.value().toString();
iter++;
}
A_iter++;
}
channelModes["A"] = A_modes;
-
+
QVariantMap B_modes;
QHash<QChar, QString>::const_iterator B_iter = _B_channelModes.constBegin();
while(B_iter != _B_channelModes.constEnd()) {
B_iter++;
}
channelModes["B"] = B_modes;
-
+
QVariantMap C_modes;
QHash<QChar, QString>::const_iterator C_iter = _C_channelModes.constBegin();
while(C_iter != _C_channelModes.constEnd()) {
C_iter++;
}
channelModes["C"] = C_modes;
-
+
QString D_modes;
QSet<QChar>::const_iterator D_iter = _D_channelModes.constBegin();
while(D_iter != _D_channelModes.constEnd()) {
_B_channelModes[iter.key()[0]] = iter.value().toString();
iter++;
}
-
+
iter = channelModes["C"].toMap().constBegin();
iterEnd = channelModes["C"].toMap().constEnd();
while(iter != iterEnd) {
/*******************************************************************************
*
* 3.3 CHANMODES
- *
+ *
* o CHANMODES=A,B,C,D
- *
+ *
* The CHANMODES token specifies the modes that may be set on a channel.
* These modes are split into four categories, as follows:
- *
+ *
* o Type A: Modes that add or remove an address to or from a list.
* These modes always take a parameter when sent by the server to a
* client; when sent by a client, they may be specified without a
* mode is removed both in the client's and server's MODE command.
* o Type D: Modes that change a setting on the channel. These modes
* never take a parameter.
- *
+ *
* If the server sends any additional types after these 4, the client
* MUST ignore them; this is intended to allow future extension of this
* token.
- *
+ *
* The IRC server MUST NOT list modes in CHANMODES which are also
* present in the PREFIX parameter; however, for completeness, modes
* described in PREFIX may be treated as type B modes.
// NOTE: the behavior of addChannelMode and removeChannelMode depends on the type of mode
// see list above for chanmode types
void IrcChannel::addChannelMode(const QChar &mode, const QString &value) {
- Network::ChannelModeType modeType = network->channelModeType(mode);
+ Network::ChannelModeType modeType = network()->channelModeType(mode);
switch(modeType) {
case Network::NOT_A_CHANMODE:
else if(!_A_channelModes[mode].contains(value))
_A_channelModes[mode] << value;
break;
-
+
case Network::B_CHANMODE:
_B_channelModes[mode] = value;
break;
}
void IrcChannel::removeChannelMode(const QChar &mode, const QString &value) {
- Network::ChannelModeType modeType = network->channelModeType(mode);
+ Network::ChannelModeType modeType = network()->channelModeType(mode);
switch(modeType) {
case Network::NOT_A_CHANMODE:
if(_A_channelModes.contains(mode))
_A_channelModes[mode].removeAll(value);
break;
-
+
case Network::B_CHANMODE:
_B_channelModes.remove(mode);
break;
}
bool IrcChannel::hasMode(const QChar &mode) const {
- Network::ChannelModeType modeType = network->channelModeType(mode);
+ Network::ChannelModeType modeType = network()->channelModeType(mode);
switch(modeType) {
case Network::NOT_A_CHANMODE:
}
QString IrcChannel::modeValue(const QChar &mode) const {
- Network::ChannelModeType modeType = network->channelModeType(mode);
+ Network::ChannelModeType modeType = network()->channelModeType(mode);
switch(modeType) {
case Network::B_CHANMODE:
default:
return QString();
}
-
+
}
QStringList IrcChannel::modeValueList(const QChar &mode) const {
- Network::ChannelModeType modeType = network->channelModeType(mode);
+ Network::ChannelModeType modeType = network()->channelModeType(mode);
switch(modeType) {
case Network::A_CHANMODE:
else
return QString("+%1 %2").arg(modeString).arg(params.join(" "));
}
-
-#ifdef HAVE_QCA2
-Cipher* IrcChannel::cipher() {
- if(!_cipher)
- _cipher = new Cipher();
- return _cipher;
-}
-#endif
-
-void IrcChannel::setEncrypted(bool e) {
- if(e) {
- #ifdef HAVE_QCA2
- if(topic().isEmpty())
- return;
-
- QByteArray key = network->bufferKey(name());
- if (key.isEmpty())
- return;
-
- if(!cipher()->setKey(key))
- return;
-
- //only send encrypted text to decrypter
- int index = topic().indexOf(":",topic().indexOf(":")+1);
-
- QString backup = topic().mid(0,index+1);
- QString decrypted = cipher()->decryptTopic(topic().mid(index+1).toAscii());;
- decrypted.prepend(backup);
-
- setTopic(decodeString(decrypted.toAscii()));
- #endif
- }
-}
\ No newline at end of file
#include "syncableobject.h"
-#ifdef HAVE_QCA2
-#include "cipher.h"
-#endif
-
class IrcUser;
class Network;
inline QString name() const { return _name; }
inline QString topic() const { return _topic; }
inline QString password() const { return _password; }
+ inline Network *network() const { return _network; }
inline QList<IrcUser *> ircUsers() const { return _userModes.keys(); }
QString modeValue(const QChar &mode) const;
QStringList modeValueList(const QChar &mode) const;
QString channelModeString() const;
-
+
inline QTextCodec *codecForEncoding() const { return _codecForEncoding; }
inline QTextCodec *codecForDecoding() const { return _codecForDecoding; }
void setCodecForEncoding(const QString &codecName);
QString decodeString(const QByteArray &text) const;
QByteArray encodeString(const QString &string) const;
-
- #ifdef HAVE_QCA2
- Cipher* cipher();
- #endif
-
- void setEncrypted(bool);
public slots:
void setTopic(const QString &topic);
void addChannelMode(const QChar &mode, const QString &value);
void removeChannelMode(const QChar &mode, const QString &value);
-
+
// init geters
QVariantMap initUserModes() const;
QVariantMap initChanModes() const;
// init seters
void initSetUserModes(const QVariantMap &usermodes);
void initSetChanModes(const QVariantMap &chanModes);
-
+
signals:
void topicSet(const QString &topic); // needed by NetworkModel
// void passwordSet(const QString &password);
// void userModeRemoved(QString nick, QString mode);
// void channelModeAdded(const QChar &mode, const QString &value);
// void channelModeRemoved(const QChar &mode, const QString &value);
-
+
void ircUsersJoined(QList<IrcUser *> ircusers);
// void ircUsersJoined(QStringList nicks, QStringList modes);
void ircUserParted(IrcUser *ircuser);
QString _name;
QString _topic;
QString _password;
-
+
QHash<IrcUser *, QString> _userModes;
- Network *network;
+ Network *_network;
QTextCodec *_codecForEncoding;
QTextCodec *_codecForDecoding;
QHash<QChar, QString> _B_channelModes;
QHash<QChar, QString> _C_channelModes;
QSet<QChar> _D_channelModes;
-
- #ifdef HAVE_QCA2
- Cipher *_cipher;
- #endif
};
#endif
_codecForDecoding(0)
{
updateObjectName();
-
- #ifdef HAVE_QCA2
- _cipher = 0;
- #endif
+
}
IrcUser::~IrcUser() {
_lastSpokenTo[buffer] = time;
emit lastSpokenToUpdated(buffer, time);
}
-
-#ifdef HAVE_QCA2
-Cipher* IrcUser::cipher() {
- if(!_cipher)
- _cipher = new Cipher();
- return _cipher;
-}
-#endif
-
-void IrcUser::setEncrypted(bool e) {
- Q_UNUSED(e);
- // TODO
-}
\ No newline at end of file
#include "syncableobject.h"
#include "types.h"
-#ifdef HAVE_QCA2
-#include "cipher.h"
-#endif
-
class SignalProxy;
class Network;
class IrcChannel;
inline QDateTime lastSpokenTo(BufferId id) const { return _lastSpokenTo.value(id); }
void setLastSpokenTo(BufferId id, const QDateTime &time);
- #ifdef HAVE_QCA2
- Cipher* cipher();
- #endif
-
- void setEncrypted(bool);
-
public slots:
void setUser(const QString &user);
void setHost(const QString &host);
void addUserModes(const QString &modes);
void removeUserModes(const QString &modes);
-
+
signals:
// void userSet(QString user);
// void hostSet(QString host);
QHash<BufferId, QDateTime> _lastActivity;
QHash<BufferId, QDateTime> _lastSpokenTo;
-
- #ifdef HAVE_QCA2
- Cipher *_cipher;
- #endif
};
#endif
/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2010 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
IrcUser *Network::newIrcUser(const QString &hostmask, const QVariantMap &initData) {
QString nick(nickFromMask(hostmask).toLower());
if(!_ircUsers.contains(nick)) {
- IrcUser *ircuser = new IrcUser(hostmask, this);
+ IrcUser *ircuser = ircUserFactory(hostmask);
if(!initData.isEmpty()) {
ircuser->fromVariantMap(initData);
ircuser->setInitialized();
return info;
}
-QByteArray Network::bufferKey(const QString &recipient) const {
- return _keyHash[recipient.toLower()];
-}
-
-void Network::setBufferKey(const QString &recipient, const QByteArray &key) {
- _keyHash[recipient.toLower()] = key;
-}
-
// ====================
// Public Slots:
// ====================
// we just assume that in PREFIX are only prefix chars stored
for(int i = 0; i < defaultPrefixes.size(); i++) {
if(prefix.contains(defaultPrefixes[i])) {
- _prefixes += defaultPrefixes[i];
- _prefixModes += defaultPrefixModes[i];
+ _prefixes += defaultPrefixes[i];
+ _prefixModes += defaultPrefixModes[i];
}
}
// check for success
// check if it's only prefix modes
for(int i = 0; i < defaultPrefixes.size(); i++) {
if(prefix.contains(defaultPrefixModes[i])) {
- _prefixes += defaultPrefixes[i];
- _prefixModes += defaultPrefixModes[i];
+ _prefixes += defaultPrefixes[i];
+ _prefixModes += defaultPrefixModes[i];
}
}
// now we've done all we've could...
QDebug operator<<(QDebug dbg, const NetworkInfo &i) {
dbg.nospace() << "(id = " << i.networkId << " name = " << i.networkName << " identity = " << i.identity
- << " codecForServer = " << i.codecForServer << " codecForEncoding = " << i.codecForEncoding << " codecForDecoding = " << i.codecForDecoding
- << " serverList = " << i.serverList << " useRandomServer = " << i.useRandomServer << " perform = " << i.perform
- << " useAutoIdentify = " << i.useAutoIdentify << " autoIdentifyService = " << i.autoIdentifyService << " autoIdentifyPassword = " << i.autoIdentifyPassword
+ << " codecForServer = " << i.codecForServer << " codecForEncoding = " << i.codecForEncoding << " codecForDecoding = " << i.codecForDecoding
+ << " serverList = " << i.serverList << " useRandomServer = " << i.useRandomServer << " perform = " << i.perform
+ << " useAutoIdentify = " << i.useAutoIdentify << " autoIdentifyService = " << i.autoIdentifyService << " autoIdentifyPassword = " << i.autoIdentifyPassword
<< " useSasl = " << i.useSasl << " saslAccount = " << i.saslAccount << " saslPassword = " << i.saslPassword
<< " useAutoReconnect = " << i.useAutoReconnect << " autoReconnectInterval = " << i.autoReconnectInterval
- << " autoReconnectRetries = " << i.autoReconnectRetries << " unlimitedReconnectRetries = " << i.unlimitedReconnectRetries
- << " rejoinChannels = " << i.rejoinChannels << ")";
+ << " autoReconnectRetries = " << i.autoReconnectRetries << " unlimitedReconnectRetries = " << i.unlimitedReconnectRetries
+ << " rejoinChannels = " << i.rejoinChannels << ")";
return dbg.space();
}
/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2010 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
Server() : port(6667), useSsl(false), sslVersion(0), useProxy(false), proxyType(QNetworkProxy::Socks5Proxy), proxyHost("localhost"), proxyPort(8080) {}
Server(const QString &host, uint port, const QString &password, bool useSsl)
: host(host), port(port), password(password), useSsl(useSsl), sslVersion(0),
- useProxy(false), proxyType(QNetworkProxy::Socks5Proxy), proxyHost("localhost"), proxyPort(8080) {}
+ useProxy(false), proxyType(QNetworkProxy::Socks5Proxy), proxyHost("localhost"), proxyPort(8080) {}
bool operator==(const Server &other) const;
bool operator!=(const Server &other) const;
};
static QStringList presetDefaultChannels(const QString &networkName);
static NetworkInfo networkInfoFromPreset(const QString &networkName);
- // Blowfish stuff
- QByteArray bufferKey(const QString &recipient) const;
- void setBufferKey(const QString &recipient, const QByteArray &key);
-
public slots:
void setNetworkName(const QString &networkName);
void setCurrentServer(const QString ¤tServer);
void emitConnectionError(const QString &);
-private slots:
- void removeIrcUser(IrcUser *ircuser);
- void removeIrcChannel(IrcChannel *ircChannel);
- void removeChansAndUsers();
+protected slots:
+ virtual void removeIrcUser(IrcUser *ircuser);
+ virtual void removeIrcChannel(IrcChannel *ircChannel);
+ virtual void removeChansAndUsers();
signals:
void aboutToBeDestroyed();
protected:
inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new IrcChannel(channelname, this); }
+ inline virtual IrcUser *ircUserFactory(const QString &hostmask) { return new IrcUser(hostmask, this); }
private:
QPointer<SignalProxy> _proxy;
QHash<QString, IrcChannel *> _ircChannels; // stores all known channels
QHash<QString, QString> _supports; // stores results from RPL_ISUPPORT
- // Blowfish key map
- QHash<QString, QByteArray> _keyHash;
-
ServerList _serverList;
bool _useRandomServer;
QStringList _perform;
set(QT_USE_QTSCRIPT 1)
include(${QT_USE_FILE})
-if (QCA2_FOUND)
- include_directories(${QCA2_INCLUDE_DIR})
-endif (QCA2_FOUND)
-
set(SOURCES
abstractsqlstorage.cpp
core.cpp
coreignorelistmanager.cpp
coreircchannel.cpp
coreirclisthelper.cpp
+ coreircuser.cpp
corenetwork.cpp
corenetworkconfig.cpp
coresession.cpp
coreignorelistmanager.h
coreircchannel.h
coreirclisthelper.h
+ coreircuser.h
corenetwork.h
corenetworkconfig.h
coresession.h
include_directories(${OPENSSL_INCLUDE_DIR})
endif(HAVE_SSL)
+if(HAVE_QCA2)
+ set(SOURCES ${SOURCES} cipher.cpp)
+ set(HEADERS ${HEADERS} cipher.h)
+ include_directories(${QCA2_INCLUDE_DIR})
+endif(HAVE_QCA2)
+
qt4_wrap_cpp(MOC ${MOC_HDRS})
set(CORE_RCS ${CORE_RCS} core/sql.qrc PARENT_SCOPE)
add_library(mod_core STATIC ${SOURCES} ${MOC} ${HEADERS})
add_dependencies(mod_core mod_common)
+
+if(HAVE_QCA2)
+ target_link_libraries(mod_core ${QCA2_LIBRARIES})
+endif(HAVE_QCA2)
/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2010 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
***************************************************************************/
#include "coreircchannel.h"
+#include "corenetwork.h"
INIT_SYNCABLE_OBJECT(CoreIrcChannel)
CoreIrcChannel::CoreIrcChannel(const QString &channelname, Network *network)
: IrcChannel(channelname, network),
_receivedWelcomeMsg(false)
{
+#ifdef HAVE_QCA2
+ _cipher = 0;
+#endif
}
+
+CoreIrcChannel::~CoreIrcChannel() {
+#ifdef HAVE_QCA2
+ delete _cipher;
+#endif
+}
+
+#ifdef HAVE_QCA2
+Cipher *CoreIrcChannel::cipher() const {
+ if(!_cipher)
+ _cipher = new Cipher();
+
+ return _cipher;
+}
+
+void CoreIrcChannel::setEncrypted(bool e) {
+ if(e) {
+ if(topic().isEmpty())
+ return;
+
+ QByteArray key = qobject_cast<CoreNetwork *>(network())->cipherKey(name());
+ if(key.isEmpty())
+ return;
+
+ if(!cipher()->setKey(key))
+ return;
+
+ QByteArray decrypted = cipher()->decryptTopic(topic().toAscii());
+ setTopic(decodeString(decrypted));
+ }
+}
+
+#endif
/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2010 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "ircchannel.h"
+#ifdef HAVE_QCA2
+# include "cipher.h"
+#endif
+
class CoreIrcChannel : public IrcChannel {
SYNCABLE_OBJECT
Q_OBJECT
public:
CoreIrcChannel(const QString &channelname, Network *network);
+ virtual ~CoreIrcChannel();
inline virtual const QMetaObject *syncMetaObject() const { return &IrcChannel::staticMetaObject; }
+#ifdef HAVE_QCA2
+ Cipher *cipher() const;
+ void setEncrypted(bool);
+#endif
+
inline bool receivedWelcomeMsg() const { return _receivedWelcomeMsg; }
inline void setReceivedWelcomeMsg() { _receivedWelcomeMsg = true; }
private:
bool _receivedWelcomeMsg;
+
+#ifdef HAVE_QCA2
+ mutable Cipher *_cipher;
+#endif
};
#endif //COREIRCCHANNEL_H
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2010 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "coreircuser.h"
+
+CoreIrcUser::CoreIrcUser(const QString &hostmask, Network *network) : IrcUser(hostmask, network) {
+#ifdef HAVE_QCA2
+ _cipher = 0;
+#endif
+}
+
+CoreIrcUser::~CoreIrcUser() {
+#ifdef HAVE_QCA2
+ delete _cipher;
+#endif
+}
+
+#ifdef HAVE_QCA2
+Cipher *CoreIrcUser::cipher() const {
+ if(!_cipher)
+ _cipher = new Cipher();
+
+ return _cipher;
+}
+
+void CoreIrcUser::setEncrypted(bool e) {
+ Q_UNUSED(e);
+ // TODO
+}
+
+#endif
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2010 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef COREIRCUSER_H_
+#define COREIRCUSER_H_
+
+#include "ircuser.h"
+
+#ifdef HAVE_QCA2
+# include "cipher.h"
+#endif
+
+class CoreIrcUser : public IrcUser {
+ SYNCABLE_OBJECT
+ Q_OBJECT
+
+public:
+ CoreIrcUser(const QString &hostmask, Network *network);
+ virtual ~CoreIrcUser();
+
+ inline virtual const QMetaObject *syncMetaObject() const { return &IrcUser::staticMetaObject; }
+
+#ifdef HAVE_QCA2
+ Cipher *cipher() const;
+ void setEncrypted(bool);
+#endif
+
+#ifdef HAVE_QCA2
+private:
+ mutable Cipher *_cipher;
+#endif
+};
+
+#endif
_channelKeys.remove(channel.toLower());
}
+#ifdef HAVE_QCA2
+QByteArray CoreNetwork::cipherKey(const QString &recipient) const {
+ return _cipherKeys.value(recipient.toLower(), QByteArray());
+}
+
+void CoreNetwork::setCipherKey(const QString &recipient, const QByteArray &key) {
+ if(!key.isEmpty())
+ _cipherKeys[recipient.toLower()] = key;
+ else
+ _cipherKeys.remove(recipient.toLower());
+}
+#endif /* HAVE_QCA2 */
+
bool CoreNetwork::setAutoWhoDone(const QString &channel) {
QString chan = channel.toLower();
if(_autoWhoPending.value(chan, 0) <= 0)
uint now = QDateTime::currentDateTime().toTime_t();
if(_pingCount != 0) {
qDebug() << "UserId:" << userId() << "Network:" << networkName() << "missed" << _pingCount << "pings."
- << "BA:" << socket.bytesAvailable() << "BTW:" << socket.bytesToWrite();
+ << "BA:" << socket.bytesAvailable() << "BTW:" << socket.bytesToWrite();
}
if((int)_pingCount >= networkConfig()->maxPingCount() && now - _lastPingTime <= (uint)(_pingTimer.interval() / 1000) + 1) {
// the second check compares the actual elapsed time since the last ping and the pingTimer interval
#include "network.h"
#include "coreircchannel.h"
+#include "coreircuser.h"
#include <QTimer>
# include <QTcpSocket>
#endif
+#ifdef HAVE_QCA2
+# include "cipher.h"
+#endif
+
#include "coresession.h"
class CoreIdentity;
void addChannelKey(const QString &channel, const QString &key);
void removeChannelKey(const QString &channel);
+ // Blowfish stuff
+#ifdef HAVE_QCA2
+ QByteArray cipherKey(const QString &recipient) const;
+ void setCipherKey(const QString &recipient, const QByteArray &key);
+#endif
+
void setAutoWhoEnabled(bool enabled);
void setAutoWhoInterval(int interval);
void setAutoWhoDelay(int delay);
protected:
inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new CoreIrcChannel(channelname, this); }
+ inline virtual IrcUser *ircUserFactory(const QString &hostmask) { return new CoreIrcUser(hostmask, this); }
+
+protected slots:
+ // TODO: remove cached cipher keys, when appropriate
+ //virtual void removeIrcUser(IrcUser *ircuser);
+ //virtual void removeIrcChannel(IrcChannel *ircChannel);
+ //virtual void removeChansAndUsers();
private slots:
void socketHasData();
QList<QByteArray> _msgQueue;
QString _requestedUserModes; // 2 strings separated by a '-' character. first part are requested modes to add, the second to remove
+
+ // Blowfish key map
+ QHash<QString, QByteArray> _cipherKeys;
};
#endif //CORENETWORK_H
/***************************************************************************
- * Copyright (C) 2005-10 by the Quassel Project *
+ * Copyright (C) 2005-2010 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "util.h"
#include "ctcphandler.h"
-#include "coreidentity.h"
-#include "ircuser.h"
-#include <QDebug>
#include <QRegExp>
#ifdef HAVE_QCA2
-#include "cipher.h"
+# include "cipher.h"
#endif
CoreUserInputHandler::CoreUserInputHandler(CoreNetwork *parent)
awayMsg = identity->awayReason();
}
if(awayMsg.isEmpty()) {
- awayMsg = tr("away");
+ awayMsg = tr("away");
}
}
}
}
void CoreUserInputHandler::handleDelkey(const BufferInfo &bufferInfo, const QString &msg) {
- #ifdef HAVE_QCA2
- if (!bufferInfo.isValid())
+#ifdef HAVE_QCA2
+ if(!bufferInfo.isValid())
return;
-
+
QStringList parms = msg.split(' ', QString::SkipEmptyParts);
-
+
if(parms.isEmpty() && !bufferInfo.bufferName().isEmpty())
parms.prepend(bufferInfo.bufferName());
if(parms.isEmpty()) {
- QString message = tr("[usage] /delkey <nick|channel> deletes the encryption key for nick or channel or just /delkey when in a channel or query.");
-
- if(bufferInfo.bufferName().isEmpty())
- emit displayMsg(Message::Info, BufferInfo::StatusBuffer, "", message);
- else
- emit displayMsg(Message::Info, bufferInfo.bufferName(), message);
+ emit displayMsg(Message::Info, bufferInfo.bufferName(), "",
+ tr("[usage] /delkey <nick|channel> deletes the encryption key for nick or channel or just /delkey when in a channel or query."));
return;
}
- if(network()->bufferKey(parms[0]).isEmpty()) {
- QString message = tr("No key has been set for %1.").arg(parms[0]);
+ QString target = parms.at(0);
- if(bufferInfo.bufferName().isEmpty())
- emit displayMsg(Message::Info, BufferInfo::StatusBuffer, "", message);
- else
- emit displayMsg(Message::Info, bufferInfo.bufferName(), message);
+ if(network()->cipherKey(target).isEmpty()) {
+ emit displayMsg(Message::Info, bufferInfo.bufferName(), tr("No key has been set for %1.").arg(target));
return;
}
- network()->setBufferKey(parms[0], "");
+ network()->setCipherKey(target, QByteArray());
- if(network()->isChannelName(parms[0]) && network()->channels().contains(parms[0])) {
- network()->ircChannel(parms[0])->setEncrypted(false);
+ if(network()->isChannelName(target) && network()->channels().contains(target)) {
+ qobject_cast<CoreIrcChannel *>(network()->ircChannel(target))->setEncrypted(false);
}
- else if(network()->nicks().contains(parms[0])) {
- network()->ircUser(parms[0])->setEncrypted(false);
+ else if(network()->nicks().contains(target)) {
+ qobject_cast<CoreIrcUser *>(network()->ircUser(target))->setEncrypted(false);
}
- QString message = tr("The key for %1 has been deleted.").arg(parms[0]);
-
- if(bufferInfo.bufferName().isEmpty())
- emit displayMsg(Message::Info, BufferInfo::StatusBuffer, "", message);
- else
- emit displayMsg(Message::Info, bufferInfo.bufferName(), message);
-
- #else
- emit displayMsg(Message::Error, BufferInfo::StatusBuffer, "", tr("Error: Setting an encryption key requires Quassel to have been built "
- "with support for the Qt Cryptographic Architecture (QCA) library. "
- "Contact your distributor about a Quassel package with QCA "
- "support, or rebuild Quassel with QCA present."));
- #endif
+ emit displayMsg(Message::Info, bufferInfo.bufferName(), tr("The key for %1 has been deleted.").arg(target));
+
+#else
+ Q_UNUSED(msg)
+ emit displayMsg(Message::Error, bufferInfo.bufferName(), "", tr("Error: Setting an encryption key requires Quassel to have been built "
+ "with support for the Qt Cryptographic Architecture (QCA2) library. "
+ "Contact your distributor about a Quassel package with QCA2 "
+ "support, or rebuild Quassel with QCA2 present."));
+#endif
}
void CoreUserInputHandler::handleDeop(const BufferInfo &bufferInfo, const QString &msg) {
if(!msg.contains(' '))
return;
- QByteArray target = serverEncode(msg.section(' ', 0, 0));
- putPrivmsg(target, userEncode(target, msg.section(' ', 1)), false);
+ QString target = msg.section(' ', 0, 0);
+ QByteArray encMsg = userEncode(target, msg.section(' ', 1));
+
+#ifdef HAVE_QCA2
+ encMsg = encrypt(target, encMsg);
+#endif
+
+ putPrivmsg(serverEncode(target), encMsg, false);
}
void CoreUserInputHandler::handleNick(const BufferInfo &bufferInfo, const QString &msg) {
void CoreUserInputHandler::handleSay(const BufferInfo &bufferInfo, const QString &msg) {
if(bufferInfo.bufferName().isEmpty())
return; // server buffer
- putPrivmsg(serverEncode(bufferInfo.bufferName()), channelEncode(bufferInfo.bufferName(), msg), false);
+
+ QByteArray encMsg = channelEncode(bufferInfo.bufferName(), msg);
+#ifdef HAVE_QCA2
+ encMsg = encrypt(bufferInfo.bufferName(), encMsg);
+#endif
+
+ putPrivmsg(serverEncode(bufferInfo.bufferName()), encMsg, false);
emit displayMsg(Message::Plain, bufferInfo.type(), bufferInfo.bufferName(), msg, network()->myNick(), Message::Self);
}
void CoreUserInputHandler::handleSetkey(const BufferInfo &bufferInfo, const QString &msg) {
- #ifdef HAVE_QCA2
+#ifdef HAVE_QCA2
if(!bufferInfo.isValid())
return;
-
+
QStringList parms = msg.split(' ', QString::SkipEmptyParts);
-
+
if(parms.count() == 1 && !bufferInfo.bufferName().isEmpty())
parms.prepend(bufferInfo.bufferName());
else if(parms.count() != 2) {
- QString message =tr("[usage] /setkey <nick|channel> <key> sets the encryption key for nick or channel. /setkey <key> when in a channel or query buffer sets the key for it.");
-
- if(bufferInfo.bufferName().isEmpty())
- emit displayMsg(Message::Info, BufferInfo::StatusBuffer, "", message);
- else
- emit displayMsg(Message::Info, bufferInfo.bufferName(), message);
+ emit displayMsg(Message::Info, bufferInfo.bufferName(),
+ tr("[usage] /setkey <nick|channel> <key> sets the encryption key for nick or channel. "
+ "/setkey <key> when in a channel or query buffer sets the key for it."));
return;
}
- network()->setBufferKey(parms[0], parms[1].toLocal8Bit());
-
- if(network()->isChannelName(parms[0]) && network()->channels().contains(parms[0]))
- network()->ircChannel(parms[0])->setEncrypted(true);
- else if(network()->nicks().contains(parms[0]))
- network()->ircUser(parms[0])->setEncrypted(true);
-
- QString message = tr("The key for %1 has been set.").arg(parms[0]);
- if (bufferInfo.bufferName().isEmpty())
- emit displayMsg(Message::Info, BufferInfo::StatusBuffer, "", message);
- else
- emit displayMsg(Message::Info, bufferInfo.bufferName(), message);
- #else
- emit displayMsg(Message::Error, BufferInfo::StatusBuffer, "", tr("Error: Setting an encryption key requires Quassel to have been built "
- "with support for the Qt Cryptographic Architecture (QCA) library. "
- "Contact your distributor about a Quassel package with QCA "
- "support, or rebuild Quassel with QCA present."));
- #endif
+
+ QString target = parms.at(0);
+ QByteArray key = parms.at(1).toLocal8Bit();
+
+ network()->setCipherKey(target, key);
+
+ if(network()->isChannelName(target) && network()->channels().contains(target))
+ qobject_cast<CoreIrcChannel *>(network()->ircChannel(target))->setEncrypted(true);
+ else if(network()->nicks().contains(target))
+ qobject_cast<CoreIrcUser *>(network()->ircUser(target))->setEncrypted(true);
+
+ emit displayMsg(Message::Info, bufferInfo.bufferName(), tr("The key for %1 has been set.").arg(target));
+#else
+ Q_UNUSED(msg)
+ emit displayMsg(Message::Error, bufferInfo.bufferName(), tr("Error: Setting an encryption key requires Quassel to have been built "
+ "with support for the Qt Cryptographic Architecture (QCA) library. "
+ "Contact your distributor about a Quassel package with QCA "
+ "support, or rebuild Quassel with QCA present."));
+#endif
}
void CoreUserInputHandler::handleTopic(const BufferInfo &bufferInfo, const QString &msg) {
- if(bufferInfo.bufferName().isEmpty()) return;
+ if(bufferInfo.bufferName().isEmpty())
+ return;
+
QList<QByteArray> params;
params << serverEncode(bufferInfo.bufferName());
+
if(!msg.isEmpty()) {
- #ifdef HAVE_QCA2
- const QByteArray bufferName = bufferInfo.bufferName().toAscii();
- QByteArray message = channelEncode(bufferInfo.bufferName(), msg);
- params << encrypt(bufferName, message);
- #else
- params << channelEncode(bufferInfo.bufferName(), msg);
- #endif
+# ifdef HAVE_QCA2
+ params << encrypt(bufferInfo.bufferName(), channelEncode(bufferInfo.bufferName(), msg));
+# else
+ params << channelEncode(bufferInfo.bufferName(), msg);
+# endif
}
-
+
emit putCmd("TOPIC", params);
}
emit putCmd(serverEncode(cmd.toUpper()), serverEncode(msg.split(" ")));
}
+// TODO: handle cutoff of encrypted messages
void CoreUserInputHandler::putPrivmsg(const QByteArray &target, const QByteArray &message, bool encrypted) {
QByteArray temp = message;
-
- #ifdef HAVE_QCA2
- if(!encrypted) {
- temp = encrypt(target, temp);
- encrypted = true;
- }
- #endif
static const char *cmd = "PRIVMSG";
int overrun = lastParamOverrun(cmd, QList<QByteArray>() << target << temp);
}
#ifdef HAVE_QCA2
-QByteArray CoreUserInputHandler::encrypt(const QByteArray &target, QByteArray &message) {
- if(target.isEmpty())
- return message;
-
- if(message.isEmpty())
- return message;
+QByteArray CoreUserInputHandler::encrypt(const QString &target, const QByteArray &message_) const {
+ if(target.isEmpty() || message_.isEmpty())
+ return message_;
- QByteArray key = network()->bufferKey(target);
+ QByteArray key = network()->cipherKey(target);
if(key.isEmpty())
- return message;
-
- IrcChannel *channel = network()->ircChannel(target);
- IrcUser *user = network()->ircUser(target);
-
- if(channel && channel->cipher()->setKey(key))
- channel->cipher()->encrypt(message);
- else if(user && user->cipher()->setKey(key))
- user->cipher()->encrypt(message);
+ return message_;
+
+ QByteArray message = message_;
+
+ CoreIrcChannel *channel = qobject_cast<CoreIrcChannel *>(network()->ircChannel(target));
+ if(channel) {
+ if(channel->cipher()->setKey(key))
+ channel->cipher()->encrypt(message);
+ } else {
+ CoreIrcUser *user = qobject_cast<CoreIrcUser *>(network()->ircUser(target));
+ if(user && user->cipher()->setKey(key))
+ user->cipher()->encrypt(message);
+ }
return message;
}
private:
void banOrUnban(const BufferInfo &bufferInfo, const QString &text, bool ban);
- void putPrivmsg(const QByteArray &target, const QByteArray &message, bool encrypted);
+ void putPrivmsg(const QByteArray &target, const QByteArray &message, bool isEncrypted);
int lastParamOverrun(const QString &cmd, const QList<QByteArray> ¶ms);
- #ifdef HAVE_QCA2
- QByteArray encrypt(const QByteArray &target, QByteArray &message);
- #endif
-
+#ifdef HAVE_QCA2
+ QByteArray encrypt(const QString &target, const QByteArray &message) const;
+#endif
+
struct Command {
BufferInfo bufferInfo;
QString command;
#include <QDebug>
#ifdef HAVE_QCA2
-#include "cipher.h"
+# include "cipher.h"
#endif
IrcServerHandler::IrcServerHandler(CoreNetwork *parent)
? *targetIter
: senderNick;
- #ifdef HAVE_QCA2
+#ifdef HAVE_QCA2
msg = decrypt(target, msg);
- #endif
+#endif
// it's possible to pack multiple privmsgs into one param using ctcp
// - > we let the ctcpHandler do the work
network()->ctcpHandler()->parse(Message::Plain, prefix, target, msg);
QString topic;
if(params.count() > 1) {
- topic = params[1];
- #ifdef HAVE_QCA2
- topic = decryptTopic(channel->name(), topic);
- #endif
+ QByteArray rawTopic = params[1];
+#ifdef HAVE_QCA2
+ rawTopic = decrypt(channel->name(), rawTopic, true);
+#endif
+ topic = channelDecode(channel->name(), rawTopic);
}
-
+
channel->setTopic(topic);
emit displayMsg(Message::Topic, BufferInfo::ChannelBuffer, channel->name(), tr("%1 has changed topic for %2 to: \"%3\"").arg(ircuser->nick()).arg(channel->name()).arg(topic));
return;
QString channel = serverDecode(params[0]);
- QString topic = channelDecode(channel, params[1]);
-
- #ifdef HAVE_QCA2
- topic = decryptTopic(channel, topic);
- #endif
-
+ QByteArray rawTopic = params[1];
+#ifdef HAVE_QCA2
+ rawTopic = decrypt(channel, rawTopic, true);
+#endif
+ QString topic = channelDecode(channel, rawTopic);
+
IrcChannel *chan = network()->ircChannel(channel);
if(chan)
chan->setTopic(topic);
}
#ifdef HAVE_QCA2
-QByteArray IrcServerHandler::decrypt(const QString &bufferName, QByteArray &message) {
- if(bufferName.isEmpty())
- return message;
-
- if(message.isEmpty())
- return message;
+QByteArray IrcServerHandler::decrypt(const QString &bufferName, const QByteArray &message_, bool isTopic) {
+ if(bufferName.isEmpty() || message_.isEmpty())
+ return message_;
- const QByteArray key = network()->bufferKey(bufferName);
+ const QByteArray key = network()->cipherKey(bufferName);
if(key.isEmpty())
- return message;
-
- IrcChannel *channel = network()->ircChannel(bufferName);
- IrcUser *user = network()->ircUser(bufferName);
-
- //only send encrypted text to decrypter
- int index = message.indexOf(":",message.indexOf(":")+1);
+ return message_;
- /* if(this->identifyMsgEnabled()) // Workaround braindead Freenode prefixing messages with +
- ++index;*/
-
- QByteArray backup = message.mid(0,index+1);
+ QByteArray message = message_;
- if (channel && channel->cipher()->setKey(key))
- message = channel->cipher()->decrypt(message.mid(index+1));
- else if (user && user->cipher()->setKey(key))
- message = user->cipher()->decrypt(message.mid(index+1));
-
- message.prepend(backup);
+ CoreIrcChannel *channel = qobject_cast<CoreIrcChannel *>(network()->ircChannel(bufferName));
+ if(channel) {
+ if(channel->cipher()->setKey(key))
+ message = isTopic? channel->cipher()->decryptTopic(message) : channel->cipher()->decrypt(message);
+ } else {
+ CoreIrcUser *user = qobject_cast<CoreIrcUser *>(network()->ircUser(bufferName));
+ if(user && user->cipher()->setKey(key))
+ message = user->cipher()->decrypt(message);
+ }
- message = channelDecode(bufferName, message).toAscii();
-
return message;
}
-
-QString IrcServerHandler::decryptTopic(const QString &bufferName, QString &topic) {
- if(bufferName.isEmpty())
- return topic;
-
- if(topic.isEmpty())
- return topic;
-
- const QByteArray key = network()->bufferKey(bufferName);
- if(key.isEmpty())
- return topic;
-
- IrcChannel *channel = network()->ircChannel(bufferName);
- IrcUser *user = network()->ircUser(bufferName);
-
- //only send encrypted text to decrypter
- int index = topic.indexOf(":",topic.indexOf(":")+1);
-
- QString backup = topic.mid(0,index+1);
-
- if (channel && channel->cipher()->setKey(key))
- topic = channel->cipher()->decryptTopic(topic.mid(index+1).toAscii());
- else if (user && user->cipher()->setKey(key))
- topic = user->cipher()->decryptTopic(topic.mid(index+1).toAscii());
-
- topic.prepend(backup);
- topic = channelDecode(bufferName, topic.toAscii());
-
- return topic;
-}
#endif
-
-/***********************************************************************************/
-
-
// key: quit message
// value: the corresponding netsplit object
QHash<QString, Netsplit*> _netsplits;
-
- #ifdef HAVE_QCA2
- QByteArray decrypt(const QString &bufferName, QByteArray &message);
- QString decryptTopic(const QString &bufferName, QString &topic);
- #endif
-};
+#ifdef HAVE_QCA2
+ QByteArray decrypt(const QString &target, const QByteArray &message, bool isTopic = false);
+#endif
+};
#endif
endif(HAVE_WEBKIT)
include(${QT_USE_FILE})
-if (QCA2_FOUND)
- include_directories(${QCA2_INCLUDE_DIR})
-endif (QCA2_FOUND)
-
-if(INDICATEQT_FOUND)
- include_directories(${INDICATEQT_INCLUDE_DIRS})
-endif(INDICATEQT_FOUND)
-
set(SOURCES
aboutdlg.cpp
awaylogfilter.cpp
set(SOURCES ${SOURCES} indicatornotificationbackend.cpp)
set(MOC_HDRS ${MOC_HDRS} indicatornotificationbackend.h)
set(FORMS ${FORMS} indicatornotificationconfigwidget.ui)
+ include_directories(${INDICATEQT_INCLUDE_DIRS})
endif(INDICATEQT_FOUND)
foreach(FORM ${FORMS})