projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Explicitly provide MOC_DEFINES, use HAVE_SSL instead of QT_NO_OPENSSL. Should fix...
[quassel.git]
/
src
/
core
/
userinputhandler.cpp
diff --git
a/src/core/userinputhandler.cpp
b/src/core/userinputhandler.cpp
index
bc3bb65
..
b760957
100644
(file)
--- a/
src/core/userinputhandler.cpp
+++ b/
src/core/userinputhandler.cpp
@@
-27,6
+27,7
@@
#include "ircuser.h"
#include <QDebug>
#include "ircuser.h"
#include <QDebug>
+#include <QRegExp>
UserInputHandler::UserInputHandler(NetworkConnection *parent) : BasicHandler(parent) {
}
UserInputHandler::UserInputHandler(NetworkConnection *parent) : BasicHandler(parent) {
}
@@
-152,14
+153,18
@@
void UserInputHandler::handleInvite(const BufferInfo &bufferInfo, const QString
}
void UserInputHandler::handleJoin(const BufferInfo &bufferInfo, const QString &msg) {
}
void UserInputHandler::handleJoin(const BufferInfo &bufferInfo, const QString &msg) {
- Q_UNUSED(bufferInfo)
- QStringList params = msg.trimmed().split(" ");
+ Q_UNUSED(bufferInfo);
+
+ // trim spaces before chans or keys
+ QString sane_msg = msg;
+ sane_msg.replace(QRegExp(", +"), ",");
+ QStringList params = sane_msg.trimmed().split(" ");
QStringList chans = params[0].split(",");
QStringList keys;
int i;
for(i = 0; i < chans.count(); i++) {
QStringList chans = params[0].split(",");
QStringList keys;
int i;
for(i = 0; i < chans.count(); i++) {
- if
(chans.at(i)[0].isLetterOrNumber(
))
- chans[i].prepend(
QChar('#')
);
+ if
(!network()->isChannelName(chans[i]
))
+ chans[i].prepend(
'#'
);
}
params[0] = chans.join(",");
if(params.count() > 1) keys = params[1].split(",");
}
params[0] = chans.join(",");
if(params.count() > 1) keys = params[1].split(",");
@@
-368,6
+373,8
@@
void UserInputHandler::expand(const QString &alias, const BufferInfo &bufferInfo
for(int i = 0; i < commands.count(); i++) {
QString command = commands[i];
for(int j = params.count(); j > 0; j--) {
for(int i = 0; i < commands.count(); i++) {
QString command = commands[i];
for(int j = params.count(); j > 0; j--) {
+ IrcUser *ircUser = network()->ircUser(params[j - 1]);
+ command = command.replace(QString("$%1:hostname").arg(j), ircUser ? ircUser->host() : QString("*"));
command = command.replace(QString("$%1").arg(j), params[j - 1]);
}
command = command.replace("$0", msg);
command = command.replace(QString("$%1").arg(j), params[j - 1]);
}
command = command.replace("$0", msg);