Hi,


As directed by Isomer, I am submitting my patch on this mailing list.  Although very simple, I believe it will be an effective way to direct users without an UnderNet account to the CService account webpage.


[Purpose]
- Display a more user-friendly error message to (potentially clueless newbie) unregistered users who attempt to join a channel that is set to use mode +r -- to help users better understand the situation.

So, rather than seeing:

"#channel:  Cannot join channel (+r)"

An unregistered user would now rather see:

"#channel:  Cannot join channel (+r):
  this channel requires a CService account -- you can obtain one from http://cservice.undernet.org/live/"


[ChangeLog]
- Modified m_join.c's m_join() routine to return a more user-friendly error message (
clearly pointing out the UnderNet CService accounts webpage) to unregistered users who attempt to join a channel set to use mode +r.


[Notes]
- This change looks like a mini-hack but it is working - I have tested it using the testcases outlined below.


[TestCases]
On Linux 2.6.11, using gcc v3.2.2, built the latest U2 development tree (u2_10_12_branch - ircu2.10 - 2007/01/20), and configured a dummy U2 IRC server to run locally.


1. 
- Using XChat 1.8.9 and nick "NumberSIX", connected to dummy server on local host.
- Created/joined test channel #test123.
- Set channel #test123 to use mode +r.
- Using a second instance of XChat 1.8.9 and nick "NumberSEX", connected to dummy server on local host.
- Tried to join test channel #test123.
PASSED (received new error message from new codepath introduced by this patch:  #test123 :Cannot join channel (+r): this channel requires a CService account -- you can obtain one from http://cservice.undernet.org/live/)

2.
After running testcase #1 above:
- Had "NumberSIX" change test channel #test123's mode to -r and set mode +i.
- Had "NumberSEX" try to join test channel #test123.
PASSED (received standard error message for INVITE-only channels through old codepath:  Cannot join #test123 (Channel is invite only)).

3.
After running both testcases #1 and #2 above:
- Had "NumberSIX" change test channel #test123's mode to -i.
- Had "NumberSIX" try to join test channel #test123.
PASSED (join succeeded).




Enjoy this patch,


--
Jeannot Langlois - Signature Jeannot Langlois
B. Sc.  Computer Science / B. Sc.  Informatique
Software Developer / Programmeur-Analyste
System/Network Administrator / Administrateur Système/Réseau

LINUX_LOGO

Vous recherchez ou voulez offrir un transport de/vers l'Abitibi-Témiscamingue (Québec)?
Cliquez sur la boîte ci-dessous...

Looking for or offering a ride to/from the Abitibi-Temiscamingue (Quebec) area?
Click on the box below...


Covoiturage Rouyn-Noranda









--- m_join.c    2006-02-04 19:50:22.000000000 -0500
+++ m_join.c    2007-01-21 00:35:26.000000000 -0500
@@ -238,7 +238,16 @@
       }
 
       /* Is there some reason the user may not join? */
-      if (err) {
+      if (err==ERR_NEEDREGGEDNICK)
+      {
+        send_reply(sptr, 
+                   SND_EXPLICIT | ERR_NEEDREGGEDNICK, 
+                   "%s :Cannot join channel (+r): this channel requires a 
CService account -- you can obtain one from %s", 
+                   name, 
+                   "http://cservice.undernet.org/live/";);
+        continue;
+      }
+      else if (err) {
         send_reply(sptr, err, chptr->chname);
         continue;
       }
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to