[Konversation-devel] [Bug 98701] nick password not registering in some cases (described)
ismail donmez ( cartman )
ismail at kde.org
Thu Jul 1 16:01:48 CEST 2010
https://bugs.kde.org/show_bug.cgi?id=98701
--- Comment #2 from ismail ( cartman ) donmez <ismail kde org> 2010-07-01 16:01:39 ---
commit a7354a00bddf8b57704f1ac73a7e03119374fb69
Author: İsmail Dönmez <ismail at kde.org>
Date: Wed Mar 30 16:24:49 2005 +0000
React to nickserv messages asking for identify. Currently identifies
*twice*
at startup. Will fix it.
BUG:98701
svn path=/trunk/kdeextragear-2/konversation/; revision=401953
diff --git a/konversation/inputfilter.cpp b/konversation/inputfilter.cpp
index 7632066..976d01d 100644
--- a/konversation/inputfilter.cpp
+++ b/konversation/inputfilter.cpp
@@ -336,7 +336,7 @@ void InputFilter::parseClientCommand(const QString &prefix,
const QString &comma
}
else if(command=="notice")
{
- if(!isIgnore(prefix,Ignore::Notice))
+ if(!isIgnore(prefix,Ignore::Notice))
{
// Channel notice?
if(isAChannel(parameterList[0]))
@@ -380,15 +380,20 @@ void InputFilter::parseClientCommand(const QString
&prefix, const QString &comma
// No, so it was a normal notice
else
{
- if(trailing.lower() == "password accepted - you are now
recognized"
- || trailing.lower() == "you have already identified")
+
+ if(trailing.startsWith("If this is your nick")) // Nickserv
+ {
+ // Identify command if specified
+ server->registerWithServices();
+ }
+ else if(trailing.lower() == "password accepted - you are now
recognized"
+ || trailing.lower() == "you have already identified")
{
- NickInfoPtr nickInfo =
server->getNickInfo(server->getNickname());
- Q_ASSERT(nickInfo);
- if(nickInfo)
- nickInfo->setIdentified(true);
+ NickInfoPtr nickInfo =
server->getNickInfo(server->getNickname());
+ if(nickInfo)
+ nickInfo->setIdentified(true);
}
- server->appendMessageToFrontmost(i18n("Notice"),
i18n("-%1- %2").arg(sourceNick).arg(trailing));
+ server->appendMessageToFrontmost(i18n("Notice"), i18n("-%1-
%2").arg(sourceNick).arg(trailing));
}
}
}
diff --git a/konversation/server.cpp b/konversation/server.cpp
index 9f6ccbe..8aa007e 100644
--- a/konversation/server.cpp
+++ b/konversation/server.cpp
@@ -745,21 +745,27 @@ void Server::connectionEstablished(const QString&
ownHost)
m_serverISON = new ServerISON(this);
// get first notify very early
startNotifyTimer(1000);
- // register with services
- if(!botPassword.isEmpty() && !bot.isEmpty())
- queue("PRIVMSG "+bot+" :identify "+botPassword);
+ // Register with services
+ registerWithServices();
// get own ip by userhost
requestUserhost(nickname);
-
- if(rejoinChannels) {
- rejoinChannels = false;
- autoRejoinChannels();
- }
+
+ if(rejoinChannels)
+ {
+ rejoinChannels = false;
+ autoRejoinChannels();
+ }
}
else
kdDebug() << "alreadyConnected==true! How did that happen?" << endl;
}
+void Server::registerWithServices()
+{
+ if(!botPassword.isEmpty() && !bot.isEmpty())
+ queue("PRIVMSG "+bot+" :identify "+botPassword);
+}
+
void Server::gotOwnResolvedHostByWelcome(KResolverResults res)
{
if ( res.error() == KResolver::NoError && !res.isEmpty() ) {
@@ -2427,6 +2433,7 @@ void Server::renameNickInfo(NickInfoPtr nickInfo, const
QString& newname)
// Get existing lowercase nickname and rename nickname in the NickInfo
object.
QString lcNickname = nickInfo->getNickname().lower();
nickInfo->setNickname(newname);
+ nickInfo->setIdentified(false);
QString lcNewname = newname.lower();
// Rename the key in m_allNicks list.
m_allNicks.remove(lcNickname);
@@ -2755,7 +2762,7 @@ QString Server::parseWildcards(const QString& toParse,
while ((found = toParse.find('%',index)) != -1) {
out.append(toParse.mid(index,found-index)); // append part before the %
index = found + 1; // skip the part before, including %
- if (index >= toParse.length())
+ if (index >= (int)toParse.length())
break; // % was the last char (not valid)
toExpand = toParse.at(index++);
if (toExpand == 's') {
diff --git a/konversation/server.h b/konversation/server.h
index d7adc12..6984cc0 100644
--- a/konversation/server.h
+++ b/konversation/server.h
@@ -333,6 +333,8 @@ class Server : public QObject
void setAllowedChannelModes(const QString& modes) { m_allowedChannelModes
= modes; }
QString allowedChannelModes() const { return m_allowedChannelModes; }
+
+ void registerWithServices();
signals:
void nicknameChanged(const QString&);
@@ -416,7 +418,7 @@ class Server : public QObject
void showSSLDialog();
void sendToAllChannels(const QString& text);
void notifyTimeout();
-
+
protected slots:
void preShellCommandExited(KProcess*);
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Konversation-devel
mailing list