projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
the alias engine can now expand nicks to their hostnames
[quassel.git]
/
src
/
core
/
userinputhandler.cpp
diff --git
a/src/core/userinputhandler.cpp
b/src/core/userinputhandler.cpp
index
0c2c042
..
6167170
100644
(file)
--- a/
src/core/userinputhandler.cpp
+++ b/
src/core/userinputhandler.cpp
@@
-41,6
+41,8
@@
void UserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const QStri
int secondSlashPos = msg.indexOf('/', 1);
int firstSpacePos = msg.indexOf(' ');
if(!msg.startsWith('/') || (secondSlashPos != -1 && (secondSlashPos < firstSpacePos || firstSpacePos == -1))) {
int secondSlashPos = msg.indexOf('/', 1);
int firstSpacePos = msg.indexOf(' ');
if(!msg.startsWith('/') || (secondSlashPos != -1 && (secondSlashPos < firstSpacePos || firstSpacePos == -1))) {
+ if(msg.startsWith("//"))
+ msg.remove(0, 1); // //asdf is transformed to /asdf
cmd = QString("SAY");
} else {
cmd = msg.section(' ', 0, 0).remove(0, 1).toUpper();
cmd = QString("SAY");
} else {
cmd = msg.section(' ', 0, 0).remove(0, 1).toUpper();
@@
-154,9
+156,15
@@
void UserInputHandler::handleJoin(const BufferInfo &bufferInfo, const QString &m
QStringList params = msg.trimmed().split(" ");
QStringList chans = params[0].split(",");
QStringList keys;
QStringList params = msg.trimmed().split(" ");
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('#'));
+ }
+ params[0] = chans.join(",");
if(params.count() > 1) keys = params[1].split(",");
emit putCmd("JOIN", serverEncode(params)); // FIXME handle messages longer than 512 bytes!
if(params.count() > 1) keys = params[1].split(",");
emit putCmd("JOIN", serverEncode(params)); // FIXME handle messages longer than 512 bytes!
- i
nt i
= 0;
+ i = 0;
for(; i < keys.count(); i++) {
if(i >= chans.count()) break;
networkConnection()->addChannelKey(chans[i], keys[i]);
for(; i < keys.count(); i++) {
if(i >= chans.count()) break;
networkConnection()->addChannelKey(chans[i], keys[i]);
@@
-360,6
+368,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);