Bug 113327 - Channel modes not reset when disconnected
Summary: Channel modes not reset when disconnected
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-26 00:30 UTC by Michael Kreitzer
Modified: 2006-01-11 05:49 UTC (History)
0 users

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 Michael Kreitzer 2005-09-26 00:30:22 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Compiled From Sources
Compiler:          gcc version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8) 
OS:                Linux

I've only tested this on EFNet. If I am in a channel by myself and I change the modes from the default, and I get thrown off the network and reconnect the modes do not reset. I.E. if I set mode +s, and the default modes are +tn, when I rejoin konvi still thinks the modes are +stn even tho they are +tn because I when I got disconnected the channel was removed and recreated when I reconnected. I have to manually type /mode #channel +s to get the mode back.
Comment 1 argonel 2006-01-11 05:49:28 UTC
SVN commit 496715 by argonel:

clear modes on rejoin

BUG:113327


 M  +30 -0     channel.cpp  
 M  +1 -0      channel.h  
 M  +3 -0      inputfilter.cpp  


--- trunk/extragear/network/konversation/src/channel.cpp #496714:496715
@@ -1671,6 +1671,36 @@
     updateModeWidgets(mode,plus,parameter);
 }
 
+void Channel::clearModeList()
+{
+    m_modeList.clear();
+    modeT->setOn(0);
+    modeT->setDown(0);
+
+    modeN->setOn(0);
+    modeN->setDown(0);
+
+    modeS->setOn(0);
+    modeS->setDown(0);
+
+    modeI->setOn(0);
+    modeI->setDown(0);
+
+    modeP->setOn(0);
+    modeP->setDown(0);
+
+    modeM->setOn(0);
+    modeM->setDown(0);
+
+    modeK->setOn(0);
+    modeK->setDown(0);
+
+    modeL->setOn(0);
+    modeL->setDown(0);
+    limit->clear();
+    emit modesChanged();
+}
+
 void Channel::updateModeWidgets(char mode, bool plus, const QString &parameter)
 {
     ModeButton* widget=0;
--- trunk/extragear/network/konversation/src/channel.h #496714:496715
@@ -118,6 +118,7 @@
         void setTopic(const QString& nickname,const QString& topic);
         void setTopicAuthor(const QString& author);
 
+        void clearModeList();
         /** get the list of modes that this channel has - e.g. {+l,+s,-m}
          *  @return All the modes that this channel has
          */
--- trunk/extragear/network/konversation/src/inputfilter.cpp #496714:496715
@@ -467,6 +467,7 @@
             */
             // Join the channel
             server->joinChannel(channelName, sourceHostmask);
+            server->getChannelByName(channelName)->clearModeList();
             // Request modes for the channel
             server->queue("MODE "+channelName);
             // Upon JOIN we're going to receive some NAMES input from the server which
@@ -694,6 +695,8 @@
                 // This is the string the user will see
                 QString modesAre(QString::null);
                 QString message = i18n("Channel modes: ") + modeString;
+                kdDebug() << "channel: " << parameterList[1] << endl;
+                //server->getChannelByName(parameterList[1])->clearModeList();
 
                 for(unsigned int index=0;index<modeString.length();index++)
                 {