summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchannel.cpp6
-rw-r--r--noncore/net/opieirc/ircchannel.h1
-rw-r--r--noncore/net/opieirc/ircservereditor.cpp7
3 files changed, 12 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircchannel.cpp b/noncore/net/opieirc/ircchannel.cpp
index 5d81596..b9e377d 100644
--- a/noncore/net/opieirc/ircchannel.cpp
+++ b/noncore/net/opieirc/ircchannel.cpp
@@ -47,2 +47,8 @@ IRCChannelPerson *IRCChannel::getPerson(QString nickname) {
47} 47}
48 48
49bool IRCChannel::isValid(const QString &channel)
50{
51 return ( channel.startsWith("#") || channel.startsWith("&")
52 || channel.startsWith("+") || channel.startsWith("!"));
53}
54
diff --git a/noncore/net/opieirc/ircchannel.h b/noncore/net/opieirc/ircchannel.h
index a276f10..001f5bb 100644
--- a/noncore/net/opieirc/ircchannel.h
+++ b/noncore/net/opieirc/ircchannel.h
@@ -50,4 +50,5 @@ public:
50 QString channelname(); 50 QString channelname();
51 bool hasPeople(); 51 bool hasPeople();
52 static bool isValid(const QString &channel);
52protected: 53protected:
53 QList<IRCChannelPerson> m_people; 54 QList<IRCChannelPerson> m_people;
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp
index 1fda868..e5c9ab5 100644
--- a/noncore/net/opieirc/ircservereditor.cpp
+++ b/noncore/net/opieirc/ircservereditor.cpp
@@ -1,3 +1,4 @@
1#include "ircservereditor.h" 1#include "ircservereditor.h"
2#include "ircchannel.h"
2 3
3/* OPIE */ 4/* OPIE */
@@ -70,6 +71,8 @@ void IRCServerEditor::accept() {
70 for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { 71 for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) {
71 QString channelName = (*it).stripWhiteSpace(); 72 QString channelName = (*it).stripWhiteSpace();
72 if (!channelName.startsWith("#") && !channelName.startsWith("+")) { 73 if (!IRCChannel::isValid(channelName)) {
73 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 '+'")); 74 QMessageBox::critical(this, tr("Error"), tr("The channel list needs to contain a\ncomma "
75 "separated list of valid\n channel names (starting \n"
76 "with one of '#' '+' '&' '!'"));
74 return; 77 return;
75 } 78 }