[Konversation-devel] [Bug 139591] mode q assumed to represent channel owner privileges

Eli MacKenzie argonel at gmail.com
Fri Feb 5 22:13:52 CET 2010


https://bugs.kde.org/show_bug.cgi?id=139591





--- Comment #5 from Eli MacKenzie <argonel gmail com>  2010-02-05 22:13:48 ---
commit dede2dae6424482b1c499d17f68b65a4a02d316e
Author: eli mackenzie <argonel at gmail.com>
Date:   Fri Feb 5 15:30:45 2010 -0500

    Change display of +q (et al) modes when they're not prefix modes.

    Non-prefix modes that are advertized by the 005 numeric as having a list
    will be displayed like bans, except for e and I, as we're in string freeze
for
    1.2.2. Servers that don't give a 005 will continue to have their messages
    displayed incorrectly. If you're aware of such a server, let us know.

    CCBUG:139591,224954

diff --git a/src/commit.h b/src/commit.h
index 8405969..19d0e77 100644
--- a/src/commit.h
+++ b/src/commit.h
@@ -1,4 +1,4 @@
 // This COMMIT number is added to version string to be used as "patch level"
 #ifndef COMMIT
-#define COMMIT 4016
+#define COMMIT 4017
 #endif
diff --git a/src/irc/channel.cpp b/src/irc/channel.cpp
index 6855dbb..9809970 100644
--- a/src/irc/channel.cpp
+++ b/src/irc/channel.cpp
@@ -1692,6 +1692,15 @@ void Channel::updateMode(const QString& sourceNick, char
mode, bool plus, const

     bool fromMe=false;
     bool toMe=false;
+    bool banTypeThang = m_server->banAddressListModes().contains(QChar(mode));
+
+    // HACK to avoid changing strings for 1.2.2, we pretend any TYPE A mode is
a
+    // ban except for e and I, as we have support for those
+    if (banTypeThang)
+    {
+        if (mode != 'b' && mode != 'e' && mode != 'I')
+            mode = 'b';
+    }

     // remember if this nick had any type of op.
     bool wasAnyOp=false;
diff --git a/src/irc/inputfilter.cpp b/src/irc/inputfilter.cpp
index a5a9368..65d4b19 100644
--- a/src/irc/inputfilter.cpp
+++ b/src/irc/inputfilter.cpp
@@ -903,6 +903,7 @@ void InputFilter::parseServerCommand(const QString &prefix,
const QString &comma
                         {
                             if(!value.isEmpty())
                             {
+                                server->setChanModes(value);
                                 QString allowed =
server->allowedChannelModes();
                                 QString newModes = value.remove(',');
                                 if(!allowed.isEmpty()) //attempt to merge the
two
diff --git a/src/irc/server.cpp b/src/irc/server.cpp
index 14758be..4ebc139 100644
--- a/src/irc/server.cpp
+++ b/src/irc/server.cpp
@@ -97,6 +97,7 @@ Server::Server(QObject* parent, ConnectionSettings& settings)
: QObject(parent)
     // TODO fold these into a QMAP, and these need to be reset to RFC values
if this server object is reused.
     m_serverNickPrefixModes = "ovh";
     m_serverNickPrefixes = "@+%";
+    m_banAddressListModes = "b"; // {RFC-1459, draft-brocklesby-irc-isupport}
-> pick one
     m_channelPrefixes = "#&";
     m_modesCount = 3;
     m_showSSLConfirmation = true;
@@ -473,6 +474,12 @@ void Server::setPrefixes(const QString &modes, const
QString& prefixes)
     m_serverNickPrefixes = prefixes;
 }

+void Server::setChanModes(QString modes)
+{
+    QStringList abcd = modes.split(",");
+    m_banAddressListModes = abcd.value(0);
+}
+
 // return a nickname without possible mode character at the beginning
 void Server::mangleNicknameWithModes(QString& nickname,bool& isAdmin,bool&
isOwner,
 bool& isOp,bool& isHalfop,bool& hasVoice)
diff --git a/src/irc/server.h b/src/irc/server.h
index f3d73b1..2d1d542 100644
--- a/src/irc/server.h
+++ b/src/irc/server.h
@@ -131,6 +131,9 @@ void resetNickSelection();
         int getModesCount();

         // extended user modes support
+        void setChanModes(QString);                 //grab modes types from
RPL_ISUPPORT CHANMODES
+        QString banAddressListModes() { return m_banAddressListModes; }     //
aka "TYPE A" modes
http://tools.ietf.org/html/draft-brocklesby-irc-isupport-03#section-3.3
+
         void setPrefixes(const QString &modes, const QString& prefixes);
         void mangleNicknameWithModes(QString &nickname,bool& isAdmin,bool&
isOwner,bool &isOp,
             bool& isHalfop,bool &hasVoice);
@@ -679,6 +682,9 @@ void resetNickSelection();
         // TODO roll these into a QMap.
         QString m_serverNickPrefixes;               // Prefixes used by the
server to indicate a mode
         QString m_serverNickPrefixModes;            // if supplied: modes
related to those prefixes
+
+        QString m_banAddressListModes;              // "TYPE A" modes from
RPL_ISUPPORT CHANMODES=A,B,C,D
+
         QString m_channelPrefixes;                  // prefixes that indicate
channel names. defaults to RFC1459 "#&"
         int m_modesCount;                           // Maximum number of
channel modes with parameter allowed per MODE command.

-- 
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