-rw-r--r-- | noncore/net/opieirc/ircservertab.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opieirc/ircsession.cpp | 3 | ||||
-rw-r--r-- | noncore/net/opieirc/ircsession.h | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp index bddc37e..62a06e8 100644 --- a/noncore/net/opieirc/ircservertab.cpp +++ b/noncore/net/opieirc/ircservertab.cpp | |||
@@ -1,113 +1,113 @@ | |||
1 | #include <qtextstream.h> | 1 | #include <qtextstream.h> |
2 | #include <qwhatsthis.h> | 2 | #include <qwhatsthis.h> |
3 | 3 | ||
4 | #include "ircservertab.h" | 4 | #include "ircservertab.h" |
5 | #include "ircmessageparser.h" | 5 | #include "ircmessageparser.h" |
6 | #include "ircchannelperson.h" | 6 | #include "ircchannelperson.h" |
7 | 7 | ||
8 | 8 | ||
9 | bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) { | 9 | bool IRCServerTab::containsPing( const QString& text, IRCServerTab* tab ) { |
10 | return (text.contains(IRCMessageParser::tr("Received a CTCP PING from "))) || | 10 | return (text.contains(IRCMessageParser::tr("Received a CTCP PING from "))) || |
11 | (text.find("ping") != -1 && text.find( tab->server()->nick() != -1)); | 11 | (text.find("ping") != -1 && text.find( tab->server()->nick() != -1)); |
12 | } | 12 | } |
13 | 13 | ||
14 | 14 | ||
15 | IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { | 15 | IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *parent, const char *name, WFlags f) : IRCTab(parent, name, f) { |
16 | m_server = server; | 16 | m_server = server; |
17 | m_session = new IRCSession(&m_server); | 17 | m_session = new IRCSession(this, &m_server); |
18 | m_mainWindow = mainWindow; | 18 | m_mainWindow = mainWindow; |
19 | m_close = FALSE; | 19 | m_close = FALSE; |
20 | m_lines = 0; | 20 | m_lines = 0; |
21 | m_description->setText(tr("Connecting to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); | 21 | m_description->setText(tr("Connecting to")+" <b>" + server.hostname() + ":" + QString::number(server.port()) + "</b>"); |
22 | m_textview = new QTextView(this); | 22 | m_textview = new QTextView(this); |
23 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); | 23 | m_textview->setHScrollBarMode(QScrollView::AlwaysOff); |
24 | m_textview->setVScrollBarMode(QScrollView::AlwaysOn); | 24 | m_textview->setVScrollBarMode(QScrollView::AlwaysOn); |
25 | m_textview->setTextFormat(RichText); | 25 | m_textview->setTextFormat(RichText); |
26 | QWhatsThis::add(m_textview, tr("Server messages")); | 26 | QWhatsThis::add(m_textview, tr("Server messages")); |
27 | m_layout->add(m_textview); | 27 | m_layout->add(m_textview); |
28 | m_field = new IRCHistoryLineEdit(this); | 28 | m_field = new IRCHistoryLineEdit(this); |
29 | connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab())); | 29 | connect(m_field, SIGNAL(nextTab()), this, SIGNAL(nextTab())); |
30 | connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab())); | 30 | connect(m_field, SIGNAL(prevTab()), this, SIGNAL(prevTab())); |
31 | connect(m_field, SIGNAL(closeTab()), this, SIGNAL(closeTab())); | 31 | connect(m_field, SIGNAL(closeTab()), this, SIGNAL(closeTab())); |
32 | connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus())); | 32 | connect(this, SIGNAL(editFocus()), m_field, SLOT(setEditFocus())); |
33 | 33 | ||
34 | QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help")); | 34 | QWhatsThis::add(m_field, tr("Type commands here. A list of available commands can be found inside the OpieIRC help")); |
35 | m_layout->add(m_field); | 35 | m_layout->add(m_field); |
36 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); | 36 | connect(m_field, SIGNAL(returnPressed()), this, SLOT(processCommand())); |
37 | connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); | 37 | connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); |
38 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); | 38 | connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling())); |
39 | connect(m_session, SIGNAL(updateChannels()), this, SLOT(slotUpdateChannels())); | 39 | connect(m_session, SIGNAL(updateChannels()), this, SLOT(slotUpdateChannels())); |
40 | settingsChanged(); | 40 | settingsChanged(); |
41 | 41 | ||
42 | m_field->setFocus(); | 42 | m_field->setFocus(); |
43 | m_field->setActiveWindow(); | 43 | m_field->setActiveWindow(); |
44 | 44 | ||
45 | } | 45 | } |
46 | 46 | ||
47 | void IRCServerTab::scrolling(){ | 47 | void IRCServerTab::scrolling(){ |
48 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 48 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
49 | } | 49 | } |
50 | 50 | ||
51 | 51 | ||
52 | void IRCServerTab::appendText(QString text) { | 52 | void IRCServerTab::appendText(QString text) { |
53 | /* not using append because it creates layout problems */ | 53 | /* not using append because it creates layout problems */ |
54 | QString txt = m_textview->text() + IRCTab::appendTimestamp( text ); | 54 | QString txt = m_textview->text() + IRCTab::appendTimestamp( text ); |
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | if (m_maxLines > 0 && m_lines >= m_maxLines) { | 58 | if (m_maxLines > 0 && m_lines >= m_maxLines) { |
59 | int firstBreak = txt.find('\n'); | 59 | int firstBreak = txt.find('\n'); |
60 | if (firstBreak != -1) { | 60 | if (firstBreak != -1) { |
61 | txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); | 61 | txt = "<qt bgcolor=\"" + m_backgroundColor + "\"/>" + txt.right(txt.length() - (firstBreak + 1)); |
62 | } | 62 | } |
63 | } else { | 63 | } else { |
64 | m_lines++; | 64 | m_lines++; |
65 | } | 65 | } |
66 | m_textview->setText(txt); | 66 | m_textview->setText(txt); |
67 | m_textview->ensureVisible(0, m_textview->contentsHeight()); | 67 | m_textview->ensureVisible(0, m_textview->contentsHeight()); |
68 | emit changed(this); | 68 | emit changed(this); |
69 | } | 69 | } |
70 | 70 | ||
71 | IRCServerTab::~IRCServerTab() { | 71 | IRCServerTab::~IRCServerTab() { |
72 | delete m_session; | 72 | delete m_session; |
73 | } | 73 | } |
74 | 74 | ||
75 | void IRCServerTab::removeChannelTab(IRCChannelTab *tab) { | 75 | void IRCServerTab::removeChannelTab(IRCChannelTab *tab) { |
76 | m_channelTabs.remove(tab); | 76 | m_channelTabs.remove(tab); |
77 | } | 77 | } |
78 | 78 | ||
79 | void IRCServerTab::removeQueryTab(IRCQueryTab *tab) { | 79 | void IRCServerTab::removeQueryTab(IRCQueryTab *tab) { |
80 | m_queryTabs.remove(tab); | 80 | m_queryTabs.remove(tab); |
81 | } | 81 | } |
82 | 82 | ||
83 | void IRCServerTab::addQueryTab(IRCQueryTab *tab) { | 83 | void IRCServerTab::addQueryTab(IRCQueryTab *tab) { |
84 | m_queryTabs.append(tab); | 84 | m_queryTabs.append(tab); |
85 | } | 85 | } |
86 | 86 | ||
87 | QString IRCServerTab::title() { | 87 | QString IRCServerTab::title() { |
88 | return "Server"; | 88 | return "Server"; |
89 | } | 89 | } |
90 | 90 | ||
91 | IRCSession *IRCServerTab::session() { | 91 | IRCSession *IRCServerTab::session() { |
92 | return m_session; | 92 | return m_session; |
93 | } | 93 | } |
94 | /* | 94 | /* |
95 | QString *IRCServerTab::mynick() { | 95 | QString *IRCServerTab::mynick() { |
96 | return (*m_server->nick()); | 96 | return (*m_server->nick()); |
97 | } */ | 97 | } */ |
98 | 98 | ||
99 | IRCServer *IRCServerTab::server() { | 99 | IRCServer *IRCServerTab::server() { |
100 | return &m_server; | 100 | return &m_server; |
101 | } | 101 | } |
102 | 102 | ||
103 | void IRCServerTab::settingsChanged() { | 103 | void IRCServerTab::settingsChanged() { |
104 | m_textview->setText("<qt bgcolor=\"" + m_backgroundColor + "\"/>"); | 104 | m_textview->setText("<qt bgcolor=\"" + m_backgroundColor + "\"/>"); |
105 | m_lines = 0; | 105 | m_lines = 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | void IRCServerTab::executeCommand(IRCTab *tab, QString line) { | 108 | void IRCServerTab::executeCommand(IRCTab *tab, QString line) { |
109 | QTextIStream stream(&line); | 109 | QTextIStream stream(&line); |
110 | QString command; | 110 | QString command; |
111 | stream >> command; | 111 | stream >> command; |
112 | command = command.upper().right(command.length()-1); | 112 | command = command.upper().right(command.length()-1); |
113 | 113 | ||
diff --git a/noncore/net/opieirc/ircsession.cpp b/noncore/net/opieirc/ircsession.cpp index 80a327a..fd8ba72 100644 --- a/noncore/net/opieirc/ircsession.cpp +++ b/noncore/net/opieirc/ircsession.cpp | |||
@@ -1,106 +1,107 @@ | |||
1 | 1 | ||
2 | #include "ircsession.h" | 2 | #include "ircsession.h" |
3 | #include "ircmessageparser.h" | 3 | #include "ircmessageparser.h" |
4 | #include "ircchannelperson.h" | 4 | #include "ircchannelperson.h" |
5 | #include "ircversion.h" | 5 | #include "ircversion.h" |
6 | 6 | ||
7 | IRCSession::IRCSession(IRCServer *server) { | 7 | IRCSession::IRCSession(QWidget *parent, IRCServer *server) { |
8 | m_server = server; | 8 | m_server = server; |
9 | m_connection = new IRCConnection(m_server); | 9 | m_connection = new IRCConnection(m_server); |
10 | m_parser = new IRCMessageParser(this); | 10 | m_parser = new IRCMessageParser(this); |
11 | m_parent = parent; | ||
11 | connect(m_connection, SIGNAL(messageArrived(IRCMessage*)), this, SLOT(handleMessage(IRCMessage*))); | 12 | connect(m_connection, SIGNAL(messageArrived(IRCMessage*)), this, SLOT(handleMessage(IRCMessage*))); |
12 | connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); | 13 | connect(m_parser, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); |
13 | connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); | 14 | connect(m_connection, SIGNAL(outputReady(IRCOutput)), this, SIGNAL(outputReady(IRCOutput))); |
14 | } | 15 | } |
15 | 16 | ||
16 | IRCSession::~IRCSession() { | 17 | IRCSession::~IRCSession() { |
17 | /* We want this to get deleted automatically */ | 18 | /* We want this to get deleted automatically */ |
18 | m_channels.setAutoDelete(TRUE); | 19 | m_channels.setAutoDelete(TRUE); |
19 | m_people.setAutoDelete(TRUE); | 20 | m_people.setAutoDelete(TRUE); |
20 | 21 | ||
21 | delete m_parser; | 22 | delete m_parser; |
22 | delete m_connection; | 23 | delete m_connection; |
23 | } | 24 | } |
24 | 25 | ||
25 | void IRCSession::beginSession() { | 26 | void IRCSession::beginSession() { |
26 | m_connection->doConnect(); | 27 | m_connection->doConnect(); |
27 | } | 28 | } |
28 | 29 | ||
29 | void IRCSession::join(QString channelname) { | 30 | void IRCSession::join(QString channelname) { |
30 | m_connection->sendLine("JOIN " + channelname); | 31 | m_connection->sendLine("JOIN " + channelname); |
31 | } | 32 | } |
32 | 33 | ||
33 | void IRCSession::quit(){ | 34 | void IRCSession::quit(){ |
34 | m_connection->sendLine("QUIT :[OI] I'm too good to need a reason"); | 35 | m_connection->sendLine("QUIT :[OI] I'm too good to need a reason"); |
35 | } | 36 | } |
36 | 37 | ||
37 | void IRCSession::quit(QString message){ | 38 | void IRCSession::quit(QString message){ |
38 | m_connection->sendLine("QUIT :" + message); | 39 | m_connection->sendLine("QUIT :" + message); |
39 | } | 40 | } |
40 | 41 | ||
41 | void IRCSession::topic(IRCChannel *channel, QString message){ | 42 | void IRCSession::topic(IRCChannel *channel, QString message){ |
42 | m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message); | 43 | m_connection->sendLine("TOPIC :" + channel->channelname() + " " + message); |
43 | } | 44 | } |
44 | 45 | ||
45 | void IRCSession::mode(IRCChannel *channel, QString message){ | 46 | void IRCSession::mode(IRCChannel *channel, QString message){ |
46 | m_connection->sendLine("MODE " + channel->channelname() + " " + message); | 47 | m_connection->sendLine("MODE " + channel->channelname() + " " + message); |
47 | } | 48 | } |
48 | 49 | ||
49 | void IRCSession::mode(IRCPerson *person, QString message){ | 50 | void IRCSession::mode(IRCPerson *person, QString message){ |
50 | m_connection->sendLine("MODE " + person->nick() + " " + message); | 51 | m_connection->sendLine("MODE " + person->nick() + " " + message); |
51 | } | 52 | } |
52 | 53 | ||
53 | void IRCSession::mode(QString message){ | 54 | void IRCSession::mode(QString message){ |
54 | m_connection->sendLine("MODE " + message); | 55 | m_connection->sendLine("MODE " + message); |
55 | } | 56 | } |
56 | 57 | ||
57 | void IRCSession::raw(QString message){ | 58 | void IRCSession::raw(QString message){ |
58 | m_connection->sendLine(message); | 59 | m_connection->sendLine(message); |
59 | } | 60 | } |
60 | 61 | ||
61 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person) { | 62 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person) { |
62 | m_connection->sendLine("KICK " + channel->channelname() + " " + person->nick() +" :0wn3d - no reason"); | 63 | m_connection->sendLine("KICK " + channel->channelname() + " " + person->nick() +" :0wn3d - no reason"); |
63 | } | 64 | } |
64 | 65 | ||
65 | void IRCSession::op(IRCChannel *channel, IRCPerson *person) { | 66 | void IRCSession::op(IRCChannel *channel, IRCPerson *person) { |
66 | m_connection->sendLine("MODE " + channel->channelname() + " +ooo " + person->nick()); | 67 | m_connection->sendLine("MODE " + channel->channelname() + " +ooo " + person->nick()); |
67 | } | 68 | } |
68 | 69 | ||
69 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) { | 70 | void IRCSession::kick(IRCChannel *channel, IRCPerson *person, QString message) { |
70 | m_connection->sendLine("KICK " + channel->channelname() + " " + person->nick() +" :" + message); | 71 | m_connection->sendLine("KICK " + channel->channelname() + " " + person->nick() +" :" + message); |
71 | } | 72 | } |
72 | 73 | ||
73 | void IRCSession::sendMessage(IRCPerson *person, QString message) { | 74 | void IRCSession::sendMessage(IRCPerson *person, QString message) { |
74 | m_connection->sendLine("PRIVMSG " + person->nick() + " :" + message); | 75 | m_connection->sendLine("PRIVMSG " + person->nick() + " :" + message); |
75 | } | 76 | } |
76 | 77 | ||
77 | void IRCSession::sendMessage(IRCChannel *channel, QString message) { | 78 | void IRCSession::sendMessage(IRCChannel *channel, QString message) { |
78 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :" + message); | 79 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :" + message); |
79 | } | 80 | } |
80 | 81 | ||
81 | void IRCSession::sendAction(IRCChannel *channel, QString message) { | 82 | void IRCSession::sendAction(IRCChannel *channel, QString message) { |
82 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :\001ACTION " + message + "\001"); | 83 | m_connection->sendLine("PRIVMSG " + channel->channelname() + " :\001ACTION " + message + "\001"); |
83 | } | 84 | } |
84 | 85 | ||
85 | void IRCSession::sendAction(IRCPerson *person, QString message) { | 86 | void IRCSession::sendAction(IRCPerson *person, QString message) { |
86 | m_connection->sendLine("PRIVMSG " + person->nick() + " :\001ACTION " + message + "\001"); | 87 | m_connection->sendLine("PRIVMSG " + person->nick() + " :\001ACTION " + message + "\001"); |
87 | } | 88 | } |
88 | 89 | ||
89 | bool IRCSession::isSessionActive() { | 90 | bool IRCSession::isSessionActive() { |
90 | return m_connection->isConnected(); | 91 | return m_connection->isConnected(); |
91 | } | 92 | } |
92 | 93 | ||
93 | bool IRCSession::isLoggedIn() { | 94 | bool IRCSession::isLoggedIn() { |
94 | return m_connection->isLoggedIn(); | 95 | return m_connection->isLoggedIn(); |
95 | } | 96 | } |
96 | 97 | ||
97 | void IRCSession::endSession() { | 98 | void IRCSession::endSession() { |
98 | if (m_connection->isLoggedIn()) | 99 | if (m_connection->isLoggedIn()) |
99 | quit(APP_VERSION); | 100 | quit(APP_VERSION); |
100 | else | 101 | else |
101 | m_connection->close(); | 102 | m_connection->close(); |
102 | } | 103 | } |
103 | 104 | ||
104 | void IRCSession::part(IRCChannel *channel) { | 105 | void IRCSession::part(IRCChannel *channel) { |
105 | m_connection->sendLine("PART " + channel->channelname() + " :" + APP_VERSION); | 106 | m_connection->sendLine("PART " + channel->channelname() + " :" + APP_VERSION); |
106 | } | 107 | } |
diff --git a/noncore/net/opieirc/ircsession.h b/noncore/net/opieirc/ircsession.h index 3859b68..7c91893 100644 --- a/noncore/net/opieirc/ircsession.h +++ b/noncore/net/opieirc/ircsession.h | |||
@@ -1,95 +1,96 @@ | |||
1 | /* | 1 | /* |
2 | OpieIRC - An embedded IRC client | 2 | OpieIRC - An embedded IRC client |
3 | Copyright (C) 2002 Wenzel Jakob | 3 | Copyright (C) 2002 Wenzel Jakob |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | 18 | ||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef __IRCSESSION_H | 21 | #ifndef __IRCSESSION_H |
22 | #define __IRCSESSION_H | 22 | #define __IRCSESSION_H |
23 | 23 | ||
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qlist.h> | 25 | #include <qlist.h> |
26 | #include "ircserver.h" | 26 | #include "ircserver.h" |
27 | #include "ircconnection.h" | 27 | #include "ircconnection.h" |
28 | #include "ircmessage.h" | 28 | #include "ircmessage.h" |
29 | #include "ircchannel.h" | 29 | #include "ircchannel.h" |
30 | #include "ircoutput.h" | 30 | #include "ircoutput.h" |
31 | 31 | ||
32 | class IRCMessageParser; | 32 | class IRCMessageParser; |
33 | 33 | ||
34 | /* The IRCSession stores all information relating to the connection | 34 | /* The IRCSession stores all information relating to the connection |
35 | to one IRC server. IRCSession makes it possible to run multiple | 35 | to one IRC server. IRCSession makes it possible to run multiple |
36 | IRC server connections from within the same program */ | 36 | IRC server connections from within the same program */ |
37 | 37 | ||
38 | class IRCSession : public QObject { | 38 | class IRCSession : public QObject { |
39 | friend class IRCMessageParser; | 39 | friend class IRCMessageParser; |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | public: | 41 | public: |
42 | IRCSession(IRCServer *server); | 42 | IRCSession(QWidget *parent, IRCServer *server); |
43 | ~IRCSession(); | 43 | ~IRCSession(); |
44 | 44 | ||
45 | void join(QString channel); | 45 | void join(QString channel); |
46 | void quit(QString message); | 46 | void quit(QString message); |
47 | void quit(); | 47 | void quit(); |
48 | void raw(QString message); | 48 | void raw(QString message); |
49 | void topic(IRCChannel *channel, QString message); | 49 | void topic(IRCChannel *channel, QString message); |
50 | void mode(IRCChannel *channel, QString message); | 50 | void mode(IRCChannel *channel, QString message); |
51 | void mode(IRCPerson *person, QString message); | 51 | void mode(IRCPerson *person, QString message); |
52 | void mode(QString message); | 52 | void mode(QString message); |
53 | void part(IRCChannel *channel); | 53 | void part(IRCChannel *channel); |
54 | void op(IRCChannel *channel, IRCPerson *person); | 54 | void op(IRCChannel *channel, IRCPerson *person); |
55 | void kick(IRCChannel *channel, IRCPerson *person); | 55 | void kick(IRCChannel *channel, IRCPerson *person); |
56 | void kick(IRCChannel *channel, IRCPerson *person, QString message); | 56 | void kick(IRCChannel *channel, IRCPerson *person, QString message); |
57 | void beginSession(); | 57 | void beginSession(); |
58 | bool isSessionActive(); | 58 | bool isSessionActive(); |
59 | void endSession(); | 59 | void endSession(); |
60 | bool isLoggedIn(); | 60 | bool isLoggedIn(); |
61 | void sendMessage(IRCPerson *person, QString message); | 61 | void sendMessage(IRCPerson *person, QString message); |
62 | void sendMessage(IRCChannel *channel, QString message); | 62 | void sendMessage(IRCChannel *channel, QString message); |
63 | void sendAction(IRCPerson *person, QString message); | 63 | void sendAction(IRCPerson *person, QString message); |
64 | void sendAction(IRCChannel *channel, QString message); | 64 | void sendAction(IRCChannel *channel, QString message); |
65 | void updateNickname(const QString &oldNickname, const QString &newNickname); | 65 | void updateNickname(const QString &oldNickname, const QString &newNickname); |
66 | void setValidUsermodes(const QString &modes); | 66 | void setValidUsermodes(const QString &modes); |
67 | void setValidChannelmodes(const QString &modes); | 67 | void setValidChannelmodes(const QString &modes); |
68 | void whois(const QString &nickname); | 68 | void whois(const QString &nickname); |
69 | void sendCTCPPing(const QString &nickname); | 69 | void sendCTCPPing(const QString &nickname); |
70 | void sendCTCPRequest(const QString &nickname, const QString &type, const QString &args); | 70 | void sendCTCPRequest(const QString &nickname, const QString &type, const QString &args); |
71 | void sendCTCPReply(const QString &nickname, const QString &type, const QString &args); | 71 | void sendCTCPReply(const QString &nickname, const QString &type, const QString &args); |
72 | IRCChannel *getChannel(QString channelname); | 72 | IRCChannel *getChannel(QString channelname); |
73 | IRCPerson *getPerson(QString nickname); | 73 | IRCPerson *getPerson(QString nickname); |
74 | protected: | 74 | protected: |
75 | void addPerson(IRCPerson *person); | 75 | void addPerson(IRCPerson *person); |
76 | void addChannel(IRCChannel *channel); | 76 | void addChannel(IRCChannel *channel); |
77 | void removeChannel(IRCChannel *channel); | 77 | void removeChannel(IRCChannel *channel); |
78 | void removePerson(IRCPerson *person); | 78 | void removePerson(IRCPerson *person); |
79 | void getChannelsByPerson(IRCPerson *person, QList<IRCChannel> &channels); | 79 | void getChannelsByPerson(IRCPerson *person, QList<IRCChannel> &channels); |
80 | protected slots: | 80 | protected slots: |
81 | void handleMessage(IRCMessage *message); | 81 | void handleMessage(IRCMessage *message); |
82 | signals: | 82 | signals: |
83 | void outputReady(IRCOutput output); | 83 | void outputReady(IRCOutput output); |
84 | void updateChannels(); | 84 | void updateChannels(); |
85 | protected: | 85 | protected: |
86 | IRCServer *m_server; | 86 | IRCServer *m_server; |
87 | IRCConnection *m_connection; | 87 | IRCConnection *m_connection; |
88 | IRCMessageParser *m_parser; | 88 | IRCMessageParser *m_parser; |
89 | QList<IRCChannel> m_channels; | 89 | QList<IRCChannel> m_channels; |
90 | QList<IRCPerson> m_people; | 90 | QList<IRCPerson> m_people; |
91 | QString m_validUsermodes; | 91 | QString m_validUsermodes; |
92 | QString m_validChannelmodes; | 92 | QString m_validChannelmodes; |
93 | QWidget *m_parent; | ||
93 | }; | 94 | }; |
94 | 95 | ||
95 | #endif /* __IRCSESSION_H */ | 96 | #endif /* __IRCSESSION_H */ |