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/ircchannelperson.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/ircchannelperson.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircchannelperson.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircchannelperson.cpp b/noncore/net/opieirc/ircchannelperson.cpp new file mode 100644 index 0000000..1e8ebe4 --- a/dev/null +++ b/noncore/net/opieirc/ircchannelperson.cpp @@ -0,0 +1,62 @@ +#include "ircperson.h" +#include "ircchannelperson.h" + +#include <qstring.h> +#include <qobject.h> + +IRCChannelPerson::IRCChannelPerson(IRCPerson *person) +{ + m_person = person; + m_flags = 0; +} + +IRCChannelPerson::~IRCChannelPerson() +{ + //if(m_person) + // delete m_person; +} + +QString IRCChannelPerson::setOp(const QString &nickname, bool set) +{ + if(set) { + m_flags |= PERSON_FLAG_OP; + return ( nickname + QObject::tr(" gives channel operator status to ") + nick()); + } + + m_flags &= 0xFFFF - PERSON_FLAG_OP; + return ( nickname + QObject::tr(" removes channel operator status from ") + nick()); +} + +QString IRCChannelPerson::setVoice(const QString &nickname, bool set) +{ + if(set) { + m_flags |= PERSON_FLAG_VOICE; + return ( nickname + QObject::tr(" gives voice to ") + nick() ); + } + + m_flags &= 0xFFFF - PERSON_FLAG_VOICE; + return ( nickname + QObject::tr(" removes voice from ") + nick()); +} + +QString IRCChannelPerson::nick() +{ + if(m_person) + return m_person->nick(); + + return QString::null; +} + +void IRCChannelPerson::setFlags(int flags) +{ + m_flags = flags; +} + +void IRCChannelPerson::setNick(const QString &nickname) +{ + m_person->setNick(nickname); +} + +const unsigned int IRCChannelPerson::flags() +{ + return m_flags; +} |