Bug 224954 - Channel mode +q is not 'channel owner'
Summary: Channel mode +q is not 'channel owner'
Status: RESOLVED WORKSFORME
Alias: None
Product: konversation
Classification: Applications
Component: protocol (show other bugs)
Version: 1.2.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: argonel
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2010-01-31 05:33 UTC by Luke-Jr
Modified: 2018-10-27 04:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke-Jr 2010-01-31 05:33:26 UTC
+q is used by FreeNode for 'quieted'

The on-connect metadata thing signifies that it is NOT a user mode: PREFIX=(ov)@+

This should be used to at least suppress 'channel owner' interpretation, even if no reliable conversion can be determined.
Comment 1 argonel 2010-02-05 22:13:50 UTC
commit dede2dae6424482b1c499d17f68b65a4a02d316e
Author: eli mackenzie <argonel@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.
Comment 2 argonel 2010-02-06 11:55:51 UTC
commit dede2dae6424482b1c499d17f68b65a4a02d316e
Author: eli mackenzie <argonel@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.
Comment 3 Myriam Schweingruber 2013-04-14 09:06:03 UTC
Is this still valid for Konversation 1.4 or 1.5 RC1?
Comment 4 Andrew Crouthamel 2018-09-24 02:17:14 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-10-27 04:06:54 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!