summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircsession.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opieirc/ircsession.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircsession.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp
index 1cc1ee2..6404d71 100644
--- a/noncore/net/opieirc/ircsession.cpp
+++ b/noncore/net/opieirc/ircsession.cpp
@@ -15,96 +15,100 @@ IRCSession::~IRCSession() {
/* We want this to get deleted automatically */
m_channels.setAutoDelete(TRUE);
m_people.setAutoDelete(TRUE);
delete m_parser;
delete m_connection;
}
void IRCSession::beginSession() {
m_connection->doConnect();
}
void IRCSession::join(QString channelname) {
m_connection->sendLine("JOIN "+channelname);
}
void IRCSession::quit(){
m_connection->sendLine("QUIT :[OI] I'm too good to need a reason");
}
void IRCSession::quit(QString message){
m_connection->sendLine("QUIT :" + message);
}
void IRCSession::topic(IRCChannel *channel, QString message){
m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message);
}
void IRCSession::mode(IRCChannel *channel, QString message){
m_connection->sendLine("MODE " + channel->channelname() + " " + message);
}
void IRCSession::mode(IRCPerson *person, QString message){
m_connection->sendLine("MODE " + person->nick() + " " + message);
}
void IRCSession::mode(QString message){
m_connection->sendLine("MODE " + message);
}
void IRCSession::raw(QString message){
m_connection->sendLine(message);
}
void IRCSession::kick(IRCChannel *channel, IRCPerson *person) {
m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :0wn3d - no reason");
}
+void IRCSession::op(IRCChannel *channel, IRCPerson *person) {
+ m_connection->sendLine("MODE "+ channel->channelname() + " +ooo " + person->nick());
+}
+
void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) {
m_connection->sendLine("KICK "+ channel->channelname() + " " + person->nick() +" :" + message);
}
void IRCSession::sendMessage(IRCPerson *person, QString message) {
m_connection->sendLine("PRIVMSG " + person->nick() + " :" + message);
}
void IRCSession::sendMessage(IRCChannel *channel, QString message) {
m_connection->sendLine("PRIVMSG " + channel->channelname() + " :" + message);
}
void IRCSession::sendAction(IRCChannel *channel, QString message) {
m_connection->sendLine("PRIVMSG " + channel->channelname() + " :\001ACTION " + message + "\001");
}
void IRCSession::sendAction(IRCPerson *person, QString message) {
m_connection->sendLine("PRIVMSG " + person->nick() + " :\001ACTION " + message + "\001");
}
bool IRCSession::isSessionActive() {
return m_connection->isConnected();
}
void IRCSession::endSession() {
if (m_connection->isLoggedIn())
m_connection->sendLine("QUIT :" APP_VERSION);
else
m_connection->close();
}
void IRCSession::part(IRCChannel *channel) {
m_connection->sendLine("PART " + channel->channelname() + " :" + APP_VERSION);
}
IRCChannel *IRCSession::getChannel(QString channelname) {
QListIterator<IRCChannel> it(m_channels);
for (; it.current(); ++it) {
if (it.current()->channelname() == channelname) {
return it.current();
}
}
return 0;
}
IRCPerson *IRCSession::getPerson(QString nickname) {
QListIterator<IRCPerson> it(m_people);