summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc/ircservertab.cpp
Unidiff
Diffstat (limited to 'noncore/net/opieirc/ircservertab.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieirc/ircservertab.cpp97
1 files changed, 93 insertions, 4 deletions
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp
index 5aa447f..1d9520a 100644
--- a/noncore/net/opieirc/ircservertab.cpp
+++ b/noncore/net/opieirc/ircservertab.cpp
@@ -24,2 +24,3 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
24 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput))); 24 connect(m_session, SIGNAL(outputReady(IRCOutput)), this, SLOT(display(IRCOutput)));
25 connect(m_mainWindow, SIGNAL(updateScroll()), this, SLOT(scrolling()));
25 settingsChanged(); 26 settingsChanged();
@@ -27,2 +28,7 @@ IRCServerTab::IRCServerTab(IRCServer server, MainWindow *mainWindow, QWidget *pa
27 28
29void IRCServerTab::scrolling(){
30 m_textview->ensureVisible(0, m_textview->contentsHeight());
31}
32
33
28void IRCServerTab::appendText(QString text) { 34void IRCServerTab::appendText(QString text) {
@@ -66,2 +72,6 @@ IRCSession *IRCServerTab::session() {
66} 72}
73/*
74QString *IRCServerTab::mynick() {
75 return (*m_server->nick());
76} */
67 77
@@ -82,3 +92,4 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
82 92
83 if (command == "JOIN") { 93 //JOIN
94 if (command == "JOIN" || command == "J") {
84 QString channel; 95 QString channel;
@@ -90,3 +101,78 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
90 } 101 }
91 } else if (command == "ME") { 102 }
103
104 //KICK
105 else if (command == "KICK"){
106 QString nickname;
107 stream >> nickname;
108 if (nickname.length() > 0) {
109 if (line.length() > 7 + nickname.length()) {
110 QString text = line.right(line.length()-nickname.length()-7);
111 IRCPerson person;
112 person.setNick(nickname);
113 m_session->kick(((IRCChannelTab *)tab)->channel(), &person, text);
114 } else {
115 IRCPerson person;
116 person.setNick(nickname);
117 m_session->kick(((IRCChannelTab *)tab)->channel(), &person);
118 }
119 }
120 }
121
122 else if (command == "OP"){
123 QString nickname;
124 stream >> nickname;
125 if (nickname.length() > 0) {
126 if (line.length() > 7 + nickname.length()) {
127 QString text = line.right(line.length()-nickname.length()-7);
128 IRCPerson person;
129 person.setNick(nickname);
130 m_session->kick(((IRCChannelTab *)tab)->channel(), &person, text);
131 } else {
132 IRCPerson person;
133 person.setNick(nickname);
134 m_session->kick(((IRCChannelTab *)tab)->channel(), &person);
135 }
136 }
137 }
138
139 //SEND MODES
140 else if (command == "MODE"){
141 QString text = line.right(line.length()-6);
142 if (text.length() > 0) {
143 m_session->mode(text);
144 } else {
145 tab->appendText("<font color=\"" + m_errorColor + "\">/mode channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask]<br>/mode nickname {[+|-]|i|w|s|o}</font><br>");
146 }
147 }
148 //SEND RAW MESSAGE TO SERVER, COMPLETELY UNCHECKED - anything in the RFC...or really anything you want
149 else if (command == "RAW"){
150 QString text = line.right(line.length()-5);
151 if (text.length() > 0) {
152 m_session->raw(text);
153 }
154 }
155 else if (command == "SUSPEND"){
156 QString text = line.right(line.length()-9);
157 if (text.upper() == "ON") {
158 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable;
159 }
160 else if (text.upper() == "OFF"){
161 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable;
162 } else {
163 tab->appendText("<font color=\"" + m_errorColor + "\">Line: "+ line +"</font><br>Text: "+text);
164 }
165 }
166
167 else if (command == "QUIT"){
168 QString text = line.right(line.length()-6);
169 if (text.length() > 0) {
170 m_session->quit(text);
171 } else {
172 m_session->quit();
173 }
174 }
175
176 //SEND ACTION
177 else if (command == "ME") {
92 QString text = line.right(line.length()-4); 178 QString text = line.right(line.length()-4);
@@ -103,3 +189,5 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
103 } 189 }
104 } else if (command == "MSG") { 190 }
191 //SEND PRIVMSG
192 else if (command == "MSG") {
105 QString nickname; 193 QString nickname;
@@ -115,3 +203,4 @@ void IRCServerTab::executeCommand(IRCTab *tab, QString line) {
115 } 203 }
116 } else { 204 }
205 else {
117 tab->appendText("<font color=\"" + m_errorColor + "\">Unknown command</font><br>"); 206 tab->appendText("<font color=\"" + m_errorColor + "\">Unknown command</font><br>");