Bug 98647 - do not highlight short channel names like #6 or #x
Summary: do not highlight short channel names like #6 or #x
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-05 22:22 UTC by Stanislav Karchebny
Modified: 2010-07-01 15:58 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 Stanislav Karchebny 2005-02-05 22:22:37 UTC
Version:           0.16 #2075 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.4 
OS:                Linux

as these channel names are uncommon and are usually not meant as channel names at all, maybe limit length to up to two characters (#ab #66 as examples).

highlighting them is a bit misleading, since such channels are less possible to exist and joining them by typing their names is quick too.
Comment 1 Ismail Donmez 2005-02-05 23:44:04 UTC
CVS commit by cartman: 

Omit single character channel names when building channel links
BUG:98647


  M +6 -7      common.cpp   1.32


--- kdeextragear-2/konversation/konversation/common.cpp  #1.31:1.32
@@ -51,5 +51,5 @@ QString tagURLs(const QString& text, con
   if(filteredLine.contains("#"))
     {
-      QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]+");
+      QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]{2,}");
 
       while((pos = chanExp.search(filteredLine, pos)) >= 0)


Comment 2 Ismail Donmez 2010-07-01 15:58:31 UTC
commit 928daff0e138bdc792463bcea526a7b7b425fb13
Author: İsmail Dönmez <ismail@kde.org>
Date:   Sat Feb 5 22:44:01 2005 +0000

    Omit single character channel names when building channel links
    BUG:98647
    
    svn path=/trunk/kdeextragear-2/konversation/; revision=386565

diff --git a/konversation/common.cpp b/konversation/common.cpp
index 80b1d79..08dfb4d 100644
--- a/konversation/common.cpp
+++ b/konversation/common.cpp
@@ -50,17 +50,16 @@ QString tagURLs(const QString& text, const QString& fromNick)
 
   if(filteredLine.contains("#"))
     {
-      QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]+");
+      QRegExp chanExp("(?:^|\\s)#[^\\s\\x0007,]{2,}");
 
       while((pos = chanExp.search(filteredLine, pos)) >= 0)
       {
           urlLen = chanExp.matchedLength();
-          QString href = filteredLine.mid( pos, urlLen );
-          QString link = "#" + href.stripWhiteSpace();
-
-          link = "<font color=\"#"+linkColor+"\"><a href=\""+link+"\">"+href+"</a></font>";
-          filteredLine.replace( pos, urlLen, link );
-          pos += link.length()-1;
+	  QString href = filteredLine.mid( pos, urlLen );
+	  QString link = "#" + href.stripWhiteSpace();
+	  link = "<font color=\"#"+linkColor+"\"><a href=\""+link+"\">"+href+"</a></font>";
+	  filteredLine.replace( pos, urlLen, link );
+	  pos += link.length()-1;
       }
     }