-rw-r--r-- | noncore/net/opieirc/ircconnection.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opieirc/ircmessageparser.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opieirc/ircservereditor.cpp | 4 | ||||
-rw-r--r-- | noncore/net/opieirc/ircservertab.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/noncore/net/opieirc/ircconnection.cpp b/noncore/net/opieirc/ircconnection.cpp index 5eb0cf2..2325cca 100644 --- a/noncore/net/opieirc/ircconnection.cpp +++ b/noncore/net/opieirc/ircconnection.cpp | |||
@@ -55,25 +55,25 @@ void IRCConnection::login() { | |||
55 | sendLine(loginString); | 55 | sendLine(loginString); |
56 | } | 56 | } |
57 | 57 | ||
58 | /* Called when data arrives on the socket */ | 58 | /* Called when data arrives on the socket */ |
59 | void IRCConnection::dataReady() { | 59 | void IRCConnection::dataReady() { |
60 | while(m_socket->canReadLine()) { | 60 | while(m_socket->canReadLine()) { |
61 | IRCMessage message(m_socket->readLine()); | 61 | IRCMessage message(m_socket->readLine()); |
62 | if (!m_loggedIn && message.isNumerical() && message.commandNumber() == 1) { | 62 | if (!m_loggedIn && message.isNumerical() && message.commandNumber() == 1) { |
63 | /* Now autojoin all channels specified inside the server profile */ | 63 | /* Now autojoin all channels specified inside the server profile */ |
64 | QStringList channels = QStringList::split(QChar(','), m_server->channels()); | 64 | QStringList channels = QStringList::split(QChar(','), m_server->channels()); |
65 | for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { | 65 | for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { |
66 | QString channelName = (*it).stripWhiteSpace(); | 66 | QString channelName = (*it).stripWhiteSpace(); |
67 | if (channelName.startsWith("#")) { | 67 | if (channelName.startsWith("#") || channelName.startsWith("+")) { |
68 | sendLine("JOIN "+ channelName); | 68 | sendLine("JOIN "+ channelName); |
69 | } | 69 | } |
70 | } | 70 | } |
71 | m_loggedIn = TRUE; | 71 | m_loggedIn = TRUE; |
72 | emit outputReady(IRCOutput(OUTPUT_CLIENTMESSAGE, tr("Successfully logged in."))); | 72 | emit outputReady(IRCOutput(OUTPUT_CLIENTMESSAGE, tr("Successfully logged in."))); |
73 | } | 73 | } |
74 | emit messageArrived(&message); | 74 | emit messageArrived(&message); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | /* Called if any type of socket error occurs */ | 78 | /* Called if any type of socket error occurs */ |
79 | void IRCConnection::error(int num) { | 79 | void IRCConnection::error(int num) { |
diff --git a/noncore/net/opieirc/ircmessageparser.cpp b/noncore/net/opieirc/ircmessageparser.cpp index 2b77414..a95c64e 100644 --- a/noncore/net/opieirc/ircmessageparser.cpp +++ b/noncore/net/opieirc/ircmessageparser.cpp | |||
@@ -174,25 +174,25 @@ void IRCMessageParser::parseLiteralPrivMsg(IRCMessage *message) { | |||
174 | if (m_session->m_server->nick() == message->param(0)) { | 174 | if (m_session->m_server->nick() == message->param(0)) { |
175 | /* IRC Query message detected, verify sender and display it */ | 175 | /* IRC Query message detected, verify sender and display it */ |
176 | IRCPerson mask(message->prefix()); | 176 | IRCPerson mask(message->prefix()); |
177 | IRCPerson *person = m_session->getPerson(mask.nick()); | 177 | IRCPerson *person = m_session->getPerson(mask.nick()); |
178 | if (!person) { | 178 | if (!person) { |
179 | /* Person not yet known, create and add to the current session */ | 179 | /* Person not yet known, create and add to the current session */ |
180 | person = new IRCPerson(message->prefix()); | 180 | person = new IRCPerson(message->prefix()); |
181 | m_session->addPerson(person); | 181 | m_session->addPerson(person); |
182 | } | 182 | } |
183 | IRCOutput output(OUTPUT_QUERYPRIVMSG, message->param(1)); | 183 | IRCOutput output(OUTPUT_QUERYPRIVMSG, message->param(1)); |
184 | output.addParam(person); | 184 | output.addParam(person); |
185 | emit outputReady(output); | 185 | emit outputReady(output); |
186 | } else if (message->param(0).at(0) == '#') { | 186 | } else if (message->param(0).at(0) == '#' || message->param(0).at(0) == '+') { |
187 | /* IRC Channel message detected, verify sender, channel and display it */ | 187 | /* IRC Channel message detected, verify sender, channel and display it */ |
188 | IRCChannel *channel = m_session->getChannel(message->param(0).lower()); | 188 | IRCChannel *channel = m_session->getChannel(message->param(0).lower()); |
189 | if (channel) { | 189 | if (channel) { |
190 | IRCPerson mask(message->prefix()); | 190 | IRCPerson mask(message->prefix()); |
191 | IRCChannelPerson *person = channel->getPerson(mask.nick()); | 191 | IRCChannelPerson *person = channel->getPerson(mask.nick()); |
192 | if (person) { | 192 | if (person) { |
193 | IRCOutput output(OUTPUT_CHANPRIVMSG, message->param(1)); | 193 | IRCOutput output(OUTPUT_CHANPRIVMSG, message->param(1)); |
194 | output.addParam(channel); | 194 | output.addParam(channel); |
195 | output.addParam(person); | 195 | output.addParam(person); |
196 | emit outputReady(output); | 196 | emit outputReady(output); |
197 | } else { | 197 | } else { |
198 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown sender"))); | 198 | emit outputReady(IRCOutput(OUTPUT_ERROR, tr("Channel message with unknown sender"))); |
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp index 5e916ae..f976c84 100644 --- a/noncore/net/opieirc/ircservereditor.cpp +++ b/noncore/net/opieirc/ircservereditor.cpp | |||
@@ -45,26 +45,26 @@ void IRCServerEditor::accept() { | |||
45 | QMessageBox::critical(this, tr("Error"), tr("Host name required")); | 45 | QMessageBox::critical(this, tr("Error"), tr("Host name required")); |
46 | else if (m_port->text().toInt()<=0) | 46 | else if (m_port->text().toInt()<=0) |
47 | QMessageBox::critical(this, tr("Error"), tr("Port required")); | 47 | QMessageBox::critical(this, tr("Error"), tr("Port required")); |
48 | else if (m_nickname->text().length()==0) | 48 | else if (m_nickname->text().length()==0) |
49 | QMessageBox::critical(this, tr("Error"), tr("Nickname required")); | 49 | QMessageBox::critical(this, tr("Error"), tr("Nickname required")); |
50 | else if (m_realname->text().length()==0) | 50 | else if (m_realname->text().length()==0) |
51 | QMessageBox::critical(this, tr("Error"), tr("Realname required")); | 51 | QMessageBox::critical(this, tr("Error"), tr("Realname required")); |
52 | else { | 52 | else { |
53 | /* Now verify whether the channel list has a valid format */ | 53 | /* Now verify whether the channel list has a valid format */ |
54 | QStringList channels = QStringList::split(QChar(','), m_channels->text()); | 54 | QStringList channels = QStringList::split(QChar(','), m_channels->text()); |
55 | for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { | 55 | for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { |
56 | QString channelName = (*it).stripWhiteSpace(); | 56 | QString channelName = (*it).stripWhiteSpace(); |
57 | if (!channelName.startsWith("#")) { | 57 | if (!channelName.startsWith("#") && !channelName.startsWith("+")) { |
58 | QMessageBox::critical(this, tr("Error"), tr("The channel list needs to contain a\ncomma separated list of channel\n names which start with '#'")); | 58 | QMessageBox::critical(this, tr("Error"), tr("The channel list needs to contain a\ncomma separated list of channel\n names which start with either '#' or '+'")); |
59 | return; | 59 | return; |
60 | } | 60 | } |
61 | } | 61 | } |
62 | QDialog::accept(); | 62 | QDialog::accept(); |
63 | } | 63 | } |
64 | } | 64 | } |
65 | 65 | ||
66 | IRCServer IRCServerEditor::getServer() { | 66 | IRCServer IRCServerEditor::getServer() { |
67 | IRCServer server; | 67 | IRCServer server; |
68 | server.setName(m_name->text()); | 68 | server.setName(m_name->text()); |
69 | server.setHostname(m_hostname->text()); | 69 | server.setHostname(m_hostname->text()); |
70 | server.setPort(m_port->text().toInt()); | 70 | server.setPort(m_port->text().toInt()); |
diff --git a/noncore/net/opieirc/ircservertab.cpp b/noncore/net/opieirc/ircservertab.cpp index aea58a3..d16c05f 100644 --- a/noncore/net/opieirc/ircservertab.cpp +++ b/noncore/net/opieirc/ircservertab.cpp | |||
@@ -59,25 +59,25 @@ void IRCServerTab::settingsChanged() { | |||
59 | m_textview->setText("<qt bgcolor=\"" + m_backgroundColor + "\"/>"); | 59 | m_textview->setText("<qt bgcolor=\"" + m_backgroundColor + "\"/>"); |
60 | } | 60 | } |
61 | 61 | ||
62 | void IRCServerTab::executeCommand(IRCTab *tab, QString line) { | 62 | void IRCServerTab::executeCommand(IRCTab *tab, QString line) { |
63 | QTextIStream stream(&line); | 63 | QTextIStream stream(&line); |
64 | QString command; | 64 | QString command; |
65 | stream >> command; | 65 | stream >> command; |
66 | command = command.upper().right(command.length()-1); | 66 | command = command.upper().right(command.length()-1); |
67 | 67 | ||
68 | if (command == "JOIN") { | 68 | if (command == "JOIN") { |
69 | QString channel; | 69 | QString channel; |
70 | stream >> channel; | 70 | stream >> channel; |
71 | if (channel.length() > 0 && channel.startsWith("#")) { | 71 | if (channel.length() > 0 && (channel.startsWith("#") || channel.startsWith("+"))) { |
72 | m_session->join(channel); | 72 | m_session->join(channel); |
73 | } else { | 73 | } else { |
74 | tab->appendText("<font color=\"" + m_errorColor + "\">Unknown channel format!</font><br>"); | 74 | tab->appendText("<font color=\"" + m_errorColor + "\">Unknown channel format!</font><br>"); |
75 | } | 75 | } |
76 | } else if (command == "ME") { | 76 | } else if (command == "ME") { |
77 | QString text = line.right(line.length()-4); | 77 | QString text = line.right(line.length()-4); |
78 | if (text.length() > 0) { | 78 | if (text.length() > 0) { |
79 | if (tab->isA("IRCChannelTab")) { | 79 | if (tab->isA("IRCChannelTab")) { |
80 | tab->appendText("<font color=\"" + m_selfColor + "\">*" + IRCOutput::toHTML(m_server.nick()) + " " + IRCOutput::toHTML(text) + "</font><br>"); | 80 | tab->appendText("<font color=\"" + m_selfColor + "\">*" + IRCOutput::toHTML(m_server.nick()) + " " + IRCOutput::toHTML(text) + "</font><br>"); |
81 | m_session->sendAction(((IRCChannelTab *)tab)->channel(), text); | 81 | m_session->sendAction(((IRCChannelTab *)tab)->channel(), text); |
82 | } else if (tab->isA("IRCQueryTab")) { | 82 | } else if (tab->isA("IRCQueryTab")) { |
83 | tab->appendText("<font color=\"" + m_selfColor + "\">*" + IRCOutput::toHTML(m_server.nick()) + " " + IRCOutput::toHTML(text) + "</font><br>"); | 83 | tab->appendText("<font color=\"" + m_selfColor + "\">*" + IRCOutput::toHTML(m_server.nick()) + " " + IRCOutput::toHTML(text) + "</font><br>"); |