summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircmessage.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircmessage.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieirc/ircmessage.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/noncore/net/opieirc/ircmessage.cpp b/noncore/net/opieirc/ircmessage.cpp
index d823ad1..d0b2652 100644
--- a/noncore/net/opieirc/ircmessage.cpp
+++ b/noncore/net/opieirc/ircmessage.cpp
@@ -1,2 +1,5 @@
1#include <qtextstream.h> 1#include <qtextstream.h>
2#include <qstring.h>
3#include <qstringlist.h>
4
2#include "ircmessage.h" 5#include "ircmessage.h"
@@ -67,3 +70,3 @@ IRCMessage::IRCMessage(QString line) {
67 /* 70 /*
68 -- Uncomment to debug -- 71 //-- Uncomment to debug --
69 72
@@ -79,2 +82,3 @@ IRCMessage::IRCMessage(QString line) {
79 printf("CTCP param count is : '%i'\n", m_parameters.count()); 82 printf("CTCP param count is : '%i'\n", m_parameters.count());
83
80 */ 84 */
@@ -86,2 +90,27 @@ QString IRCMessage::param(int param) {
86 90
91QStringList IRCMessage::params(const QString &paramstring) const {
92 QStringList params, retvalue;
93 params = QStringList::split(',', paramstring);
94 QStringList::Iterator end = params.end();
95
96 for (QStringList::Iterator it = params.begin(); it != end; ++it) {
97 int pos = (*it).find(':');
98 if(pos < 0) {
99 if((*it).toInt() < m_parameters.count())
100 retvalue << m_parameters[(*it).toInt()];
101 }
102
103 else {
104 int start, end;
105 start = (*it).left(pos).toInt();
106 end = (*it).mid(pos+1).toInt();
107 for (int i=start;i<=end && i < m_parameters.count() ;++i) {
108 retvalue << m_parameters[i];
109 }
110 }
111 }
112
113 return retvalue;
114}
115
87QString IRCMessage::prefix() { 116QString IRCMessage::prefix() {