Merge branch 'master' of github.com:hanzz/libtransport
This commit is contained in:
commit
feca4f35ee
4 changed files with 16 additions and 6 deletions
|
@ -142,7 +142,13 @@ void IRCNetworkPlugin::handleMessageSendRequest(const std::string &user, const s
|
|||
std::string target = getTargetName(legacyName);
|
||||
|
||||
LOG4CXX_INFO(logger, user << ": Session name: " << session << ", message to " << target);
|
||||
m_sessions[session]->sendCommand(IrcCommand::createMessage(FROM_UTF8(target), FROM_UTF8(message)));
|
||||
|
||||
if (message.find("/me") == 0) {
|
||||
m_sessions[session]->sendCommand(IrcCommand::createCtcpAction(FROM_UTF8(target), FROM_UTF8(message.substr(4))));
|
||||
}
|
||||
else {
|
||||
m_sessions[session]->sendCommand(IrcCommand::createMessage(FROM_UTF8(target), FROM_UTF8(message)));
|
||||
}
|
||||
|
||||
if (target.find("#") == 0) {
|
||||
handleMessage(user, legacyName, message, TO_UTF8(m_sessions[session]->nickName()));
|
||||
|
|
|
@ -158,20 +158,25 @@ void MyIrcSession::on_messageReceived(IrcMessage *message) {
|
|||
}
|
||||
}
|
||||
|
||||
QString msg = m->message();
|
||||
if (m->isAction()) {
|
||||
msg = QString("/me ") + msg;
|
||||
}
|
||||
|
||||
std::string target = TO_UTF8(m->target());
|
||||
LOG4CXX_INFO(logger, user << ": Message from " << target);
|
||||
if (target.find("#") == 0) {
|
||||
bool flags = 0;
|
||||
std::string nickname = TO_UTF8(m->sender().name());
|
||||
flags = correctNickname(nickname);
|
||||
np->handleMessage(user, target + suffix, TO_UTF8(m->message()), nickname);
|
||||
np->handleMessage(user, target + suffix, TO_UTF8(msg), nickname);
|
||||
}
|
||||
else {
|
||||
bool flags = 0;
|
||||
std::string nickname = TO_UTF8(m->sender().name());
|
||||
flags = correctNickname(nickname);
|
||||
LOG4CXX_INFO(logger, nickname + suffix);
|
||||
np->handleMessage(user, nickname + suffix, TO_UTF8(m->message()));
|
||||
np->handleMessage(user, nickname + suffix, TO_UTF8(msg));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ users_per_backend=10
|
|||
|
||||
# Full path to backend binary.
|
||||
backend=/usr/bin/spectrum2_libpurple_backend
|
||||
#backend=/usr/bin/spectrum2_libircclient-qt_backend
|
||||
#backend=/usr/bin/spectrum2_libcommuni_backend
|
||||
# For skype:
|
||||
#backend=/usr/bin/xvfb-run -n BACKEND_ID -s "-screen 0 10x10x8" -f /tmp/x-skype-gw /usr/bin/spectrum2_skype_backend
|
||||
|
||||
|
|
|
@ -10,8 +10,7 @@ namespace Transport {
|
|||
StorageBackend *StorageBackend::createBackend(Config *config, std::string &error) {
|
||||
StorageBackend *storageBackend = NULL;
|
||||
#ifdef WITH_SQLITE
|
||||
if (CONFIG_STRING(config, "database.type") == "sqlite3" ||
|
||||
(CONFIG_STRING(config, "database.type") == "none" && !CONFIG_BOOL(config, "service.server_mode"))) {
|
||||
if (CONFIG_STRING(config, "database.type") == "sqlite3") {
|
||||
storageBackend = new SQLite3Backend(config);
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue