Bug 157163 - Join command fails to join channel when a tab for the channel already exists
Summary: Join command fails to join channel when a tab for the channel already exists
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-04 21:23 UTC by Bernd Buschinski
Modified: 2010-07-01 16:19 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 Bernd Buschinski 2008-02-04 21:23:39 UTC
Version:           svn (using KDE 3.5.8)
Installed from:    Gentoo Packages
Compiler:          gcc-4.2.2 
OS:                Linux

In current svn version has a nice feature which switches the view to the joined channel if I am already on it, so far so good :)

The problem is that there are special cases when this prevents a user from joining a channel.

- join a channel #test
- set channelmode +i
- disconnect from the network
  (the channel windows will stay open)
- connect to the network again
- konversation cant join the channel because of +i

now the problem:
if someone else set the channelmode -i
and you type /join #test

it doesnt join, it just switches to the channel view.

But if you now close the channelview/channeltab and type again /join #test
it works fine
Comment 1 Eike Hein 2008-02-04 21:28:15 UTC
Alternate description: The code that attempts to bring forward an existing tab when trying to /join a channel needs to check whether the channel is actually considered joined, and if not, needs to cause a join to happen along with raising the tab. The existence of a tab is unreliable as proof of the client actually attending a channel.

Renamed for clarity.
Comment 2 Eike Hein 2008-03-20 18:00:40 UTC
SVN commit 788096 by hein:

Fix /join failing to join a channel when a tab is already present (but
the channel is unjoined, i.e. due to a temporary +i mode at the time of
a reconnect cycle) ever since the raise-on-repeated-/join mechanic was
introduced.
BUG:157163


 M  +6 -1      outputfilter.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=788096
Comment 3 Eike Hein 2010-07-01 16:19:21 UTC
commit 3269f61df0f3c5c36cb2ba84b707a10889c7e8e0
Author: Eike Hein <hein@kde.org>
Date:   Thu Mar 20 17:00:12 2008 +0000

    Fix /join failing to join a channel when a tab is already present (but
    the channel is unjoined, i.e. due to a temporary +i mode at the time of
    a reconnect cycle) ever since the raise-on-repeated-/join mechanic was
    introduced.
    BUG:157163
    
    svn path=/branches/extragear/kde3/network/konversation/; revision=788096

diff --git a/src/outputfilter.cpp b/src/outputfilter.cpp
index 57d0616..381c10e 100644
--- a/src/outputfilter.cpp
+++ b/src/outputfilter.cpp
@@ -365,12 +365,17 @@ namespace Konversation
         }
         else
         {
-            if(!isAChannel(channelName))
+            if (!isAChannel(channelName))
                 channelName = "#" + channelName.stripWhiteSpace();
 
             Channel* channel = m_server->getChannelByName(channelName);
+
             if (channel)
             {
+                // Note that this relies on the channels-flush-nicklists-on-disconnect behavior.
+                if (!channel->numberOfNicks())
+                    result.toServer = "JOIN " + channelName;
+
                 if (Preferences::bringToFront())
                     emit showView (channel);
             }