Diffstat (limited to 'noncore/net/opieirc/ircmessage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmessage.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/noncore/net/opieirc/ircmessage.cpp b/noncore/net/opieirc/ircmessage.cpp index d19e9e6..1b7072e 100644 --- a/noncore/net/opieirc/ircmessage.cpp +++ b/noncore/net/opieirc/ircmessage.cpp | |||
@@ -54,2 +54,9 @@ IRCMessage::IRCMessage(QString line) { | |||
54 | m_ctcp = TRUE; | 54 | m_ctcp = TRUE; |
55 | if (m_command == "PRIVMSG") { | ||
56 | m_ctcpRequest = TRUE; | ||
57 | } | ||
58 | else { | ||
59 | m_ctcpRequest = FALSE; | ||
60 | } | ||
61 | |||
55 | /* Strip CTCP \001 characters */ | 62 | /* Strip CTCP \001 characters */ |
@@ -57,4 +64,3 @@ IRCMessage::IRCMessage(QString line) { | |||
57 | QTextIStream ctcpStream(&m_allParameters); | 64 | QTextIStream ctcpStream(&m_allParameters); |
58 | if (m_command == "PRIVMSG") | 65 | ctcpStream >> m_ctcpDestination; |
59 | ctcpStream >> m_ctcpDestination; | ||
60 | ctcpStream >> temp; | 66 | ctcpStream >> temp; |
@@ -63,7 +69,7 @@ IRCMessage::IRCMessage(QString line) { | |||
63 | int length = m_allParameters.length() - m_ctcpCommand.length() - 1; | 69 | int length = m_allParameters.length() - m_ctcpCommand.length() - 1; |
64 | if (m_command == "PRIVMSG") | 70 | length -= m_ctcpDestination.length() + 1; |
65 | length -= m_ctcpDestination.length() + 1; | ||
66 | if (length <= 0) { | 71 | if (length <= 0) { |
67 | m_allParameters = ""; | 72 | m_allParameters = ""; |
68 | } else { | 73 | } |
74 | else { | ||
69 | m_allParameters = m_allParameters.right(length); | 75 | m_allParameters = m_allParameters.right(length); |
@@ -71,3 +77,4 @@ IRCMessage::IRCMessage(QString line) { | |||
71 | } | 77 | } |
72 | } else { | 78 | } |
79 | else { | ||
73 | m_ctcp = FALSE; | 80 | m_ctcp = FALSE; |
@@ -146,2 +153,10 @@ bool IRCMessage::isCTCP() { | |||
146 | 153 | ||
154 | bool IRCMessage::isCTCPRequest() { | ||
155 | return m_ctcpRequest; | ||
156 | } | ||
157 | |||
158 | bool IRCMessage::isCTCPReply() { | ||
159 | return !m_ctcpRequest; | ||
160 | } | ||
161 | |||
147 | QString IRCMessage::trailing() { | 162 | QString IRCMessage::trailing() { |