projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ddc5208
)
fixed small bug in handleServerMsg()
author
Marcus Eggenberger
<egs@quassel-irc.org>
Mon, 14 May 2007 22:19:47 +0000
(22:19 +0000)
committer
Marcus Eggenberger
<egs@quassel-irc.org>
Mon, 14 May 2007 22:19:47 +0000
(22:19 +0000)
core/server.cpp
patch
|
blob
|
history
diff --git
a/core/server.cpp
b/core/server.cpp
index
d9ebdc9
..
494cb97
100644
(file)
--- a/
core/server.cpp
+++ b/
core/server.cpp
@@
-172,19
+172,21
@@
void Server::handleServerMsg(QString msg) {
// next string without a whitespace is the command
cmd = msg.section(' ', 0, 0).toUpper();
// next string without a whitespace is the command
cmd = msg.section(' ', 0, 0).toUpper();
- msg = msg.
section(' ', 1
);
+ msg = msg.
mid(cmd.length()
);
// get the parameters
// get the parameters
- QString left, trailing;
- left = msg.section(" :", 0, 0);
- trailing = msg.section(" :", -1, -1);
- if(!left.isEmpty()) {
- params << left.split(' ', QString::SkipEmptyParts);
+ QString trailing = "";
+ if(msg.contains(" :")) {
+ trailing = msg.section(" :", 1);
+ msg = msg.section(" :", 0, 0);
+ }
+ if(!msg.isEmpty()) {
+ params << msg.split(' ', QString::SkipEmptyParts);
}
if(!trailing.isEmpty()) {
params << trailing;
}
}
if(!trailing.isEmpty()) {
params << trailing;
}
-
+
// numeric replies have the target as first param (RFC 2812 - 2.4). this is usually our own nick. Remove this!
uint num = cmd.toUInt();
if(num > 0) {
// numeric replies have the target as first param (RFC 2812 - 2.4). this is usually our own nick. Remove this!
uint num = cmd.toUInt();
if(num > 0) {