author | skyhusker <skyhusker> | 2005-01-26 22:45:53 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-01-26 22:45:53 (UTC) |
commit | f85af28663814f3262f5ecfcd20a4b4f67c23067 (patch) (side-by-side diff) | |
tree | 994bd8c5a9f361ca7eff8ef9fb404f89f6f90f78 /noncore/net/opieirc/ircconnection.cpp | |
parent | cbaf2c1c6eb42bc8a283a40fe922603a44c29304 (diff) | |
download | opie-f85af28663814f3262f5ecfcd20a4b4f67c23067.zip opie-f85af28663814f3262f5ecfcd20a4b4f67c23067.tar.gz opie-f85af28663814f3262f5ecfcd20a4b4f67c23067.tar.bz2 |
* Created new class for IRCChannelPerson.
* Added whois, ping and version entries to channel popup menu.
* Fixed action on CTCP PING reply (was interpreted as a request).
Diffstat (limited to 'noncore/net/opieirc/ircconnection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircconnection.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircconnection.cpp b/noncore/net/opieirc/ircconnection.cpp index 2325cca..88e63f7 100644 --- a/noncore/net/opieirc/ircconnection.cpp +++ b/noncore/net/opieirc/ircconnection.cpp @@ -1,4 +1,8 @@ #include <unistd.h> #include <string.h> + +#include <qstringlist.h> +#include <qdatetime.h> + #include "ircconnection.h" @@ -29,6 +33,21 @@ void IRCConnection::sendLine(QString line) { } -void IRCConnection::sendCTCP(QString nick, QString line) { - sendLine("NOTICE " + nick + " :\001"+line+"\001"); +void IRCConnection::sendCTCPReply(const QString &nickname, const QString &type, const QString &args) { + sendLine("NOTICE " + nickname + " :\001" + type + " " + args + "\001"); +} + +void IRCConnection::sendCTCPRequest(const QString &nickname, const QString &type, const QString &args) { + sendLine("PRIVMSG " + nickname + " :\001" + type + " " + args + "\001"); +} + +void IRCConnection::sendCTCPPing(const QString &nickname) { + QDateTime tm; + tm.setTime_t(0); + QString strtime = QString::number(tm.secsTo(QDateTime::currentDateTime())); + sendCTCPRequest(nickname, "PING", strtime); +} + +void IRCConnection::whois(const QString &nickname) { + sendLine("WHOIS " + nickname); } @@ -101,2 +120,3 @@ void IRCConnection::close() { } } + |