author | skyhusker <skyhusker> | 2005-02-02 13:36:32 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-02-02 13:36:32 (UTC) |
commit | 737b0b5ce3e5db15bf11f696b070c9b475f92b61 (patch) (unidiff) | |
tree | f37a834ddaffc9447c71a86c594a522fe97295b7 | |
parent | f1f48d6711b359499c7ab3b9102a25f21259df53 (diff) | |
download | opie-737b0b5ce3e5db15bf11f696b070c9b475f92b61.zip opie-737b0b5ce3e5db15bf11f696b070c9b475f92b61.tar.gz opie-737b0b5ce3e5db15bf11f696b070c9b475f92b61.tar.bz2 |
Slightly modified debug messages
-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 | |||
@@ -43,30 +43,26 @@ IRCMessage::IRCMessage(QString line) { | |||
43 | m_parameters << m_trailing; | 43 | m_parameters << m_trailing; |
44 | break; | 44 | break; |
45 | } else { | 45 | } else { |
46 | m_parameters << temp; | 46 | m_parameters << temp; |
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(); |
69 | int length = m_allParameters.length() - m_ctcpCommand.length() - 1; | 65 | int length = m_allParameters.length() - m_ctcpCommand.length() - 1; |
70 | length -= m_ctcpDestination.length() + 1; | 66 | length -= m_ctcpDestination.length() + 1; |
71 | if (length <= 0) { | 67 | if (length <= 0) { |
72 | m_allParameters = ""; | 68 | m_allParameters = ""; |
@@ -76,30 +72,34 @@ IRCMessage::IRCMessage(QString line) { | |||
76 | m_parameters << m_allParameters; | 72 | m_parameters << m_allParameters; |
77 | } | 73 | } |
78 | } | 74 | } |
79 | else { | 75 | else { |
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 { |
102 | QStringList params, retvalue; | 102 | QStringList params, retvalue; |
103 | params = QStringList::split(',', paramstring); | 103 | params = QStringList::split(',', paramstring); |
104 | QStringList::Iterator end = params.end(); | 104 | QStringList::Iterator end = params.end(); |
105 | 105 | ||