-rw-r--r-- | noncore/net/opieirc/ircmessage.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/net/opieirc/ircmessage.cpp b/noncore/net/opieirc/ircmessage.cpp index 1b7072e..da8db77 100644 --- a/noncore/net/opieirc/ircmessage.cpp +++ b/noncore/net/opieirc/ircmessage.cpp | |||
@@ -47,22 +47,18 @@ IRCMessage::IRCMessage(QString line) { | |||
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | 50 | ||
51 | m_commandNumber = m_command.toInt(&m_isNumerical); | 51 | m_commandNumber = m_command.toInt(&m_isNumerical); |
52 | /* Is this a CTCP command */ | 52 | /* Is this a CTCP command */ |
53 | if ((m_command == "PRIVMSG" || m_command == "NOTICE") && m_trailing.length()>0 && m_trailing.left(1) == QChar(1)) { | 53 | if ((m_command == "PRIVMSG" || m_command == "NOTICE") && m_trailing.length()>0 && m_trailing.left(1) == QChar(1)) { |
54 | m_ctcp = TRUE; | 54 | m_ctcp = TRUE; |
55 | if (m_command == "PRIVMSG") { | 55 | |
56 | m_ctcpRequest = TRUE; | 56 | m_ctcpRequest = (m_command == "PRIVMSG"); |
57 | } | ||
58 | else { | ||
59 | m_ctcpRequest = FALSE; | ||
60 | } | ||
61 | 57 | ||
62 | /* Strip CTCP \001 characters */ | 58 | /* Strip CTCP \001 characters */ |
63 | m_allParameters = m_allParameters.replace(QRegExp(QChar(1)), ""); | 59 | m_allParameters = m_allParameters.replace(QRegExp(QChar(1)), ""); |
64 | QTextIStream ctcpStream(&m_allParameters); | 60 | QTextIStream ctcpStream(&m_allParameters); |
65 | ctcpStream >> m_ctcpDestination; | 61 | ctcpStream >> m_ctcpDestination; |
66 | ctcpStream >> temp; | 62 | ctcpStream >> temp; |
67 | m_ctcpCommand = temp.upper().right(temp.length()-1); | 63 | m_ctcpCommand = temp.upper().right(temp.length()-1); |
68 | m_parameters.clear(); | 64 | m_parameters.clear(); |
@@ -80,22 +76,26 @@ IRCMessage::IRCMessage(QString line) { | |||
80 | m_ctcp = FALSE; | 76 | m_ctcp = FALSE; |
81 | } | 77 | } |
82 | 78 | ||
83 | 79 | ||
84 | odebug << "Parsed: " << line << oendl; | 80 | odebug << "Parsed: " << line << oendl; |
85 | odebug << "Prefix: " << m_prefix << oendl; | 81 | odebug << "Prefix: " << m_prefix << oendl; |
86 | odebug << "Command: " << m_command << oendl; | 82 | odebug << "Command: " << m_command << oendl; |
87 | odebug << "Allparameters: " << m_allParameters << oendl; | 83 | odebug << "Allparameters: " << m_allParameters << oendl; |
84 | |||
88 | for (unsigned int i=0; i<m_parameters.count(); i++) { | 85 | for (unsigned int i=0; i<m_parameters.count(); i++) { |
89 | odebug << "Parameter " << i << ":" << m_parameters[i] << oendl; | 86 | odebug << "Parameter " << i << ":" << m_parameters[i] << oendl; |
90 | } | 87 | } |
91 | odebug << "CTCP Command: " << m_ctcpCommand << oendl; | 88 | |
92 | odebug << "CTCP Destination: " << m_ctcpDestination << oendl; | 89 | if(m_ctcp) { |
93 | odebug << "CTCP param count is: " << m_parameters.count() << oendl; | 90 | odebug << "CTCP " << (m_ctcpRequest? "Request" : "Reply") << ": " << m_ctcpCommand << oendl; |
91 | odebug << "CTCP Destination: " << m_ctcpDestination << oendl; | ||
92 | odebug << "CTCP param count is: " << m_parameters.count() << oendl; | ||
93 | } | ||
94 | 94 | ||
95 | } | 95 | } |
96 | 96 | ||
97 | QString IRCMessage::param(int param) { | 97 | QString IRCMessage::param(int param) { |
98 | return m_parameters[param]; | 98 | return m_parameters[param]; |
99 | } | 99 | } |
100 | 100 | ||
101 | QStringList IRCMessage::params(const QString ¶mstring) const { | 101 | QStringList IRCMessage::params(const QString ¶mstring) const { |