Reed Loden wrote:
On Sun, 21 Jan 2007 01:24:56 -0500
Jeannot Langlois <[EMAIL PROTECTED]> wrote:
  
*[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.
    

I would much rather see this patch as a change to the numeric replies
in ircd/s_err.c. For example, take a look at QuakeNet's asuka
(https://svn.quakenet.org/svn/quakenet/asuka/branches/paultrusts/patches/asuka-friendly_errors.patch).
Notice how they just modify the replies in ircd/s_err.c instead of
modifying ircd/m_join.c. This achieves the same effect without adding a
hack to m_join.c. :)

Thanks for the contribution!
~reed

Sure.

Here is an alternate patch that modifies s_err.c instead.  Re-ran all testcases.


Updated patch text follows:



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 s_err.c's response string so the ERR_NEEDREGGEDNICK error now uses 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]
- N/A.


[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/21), 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
jeannot12 AT linuxmail DOT org
icq : 1-5-2-6-2-8-9-1
msn : jeannot12 AT hotmail DOT com

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









--- s_err.c     2006-06-08 22:12:25.000000000 -0400
+++ s_err.c     2007-01-21 16:47:34.000000000 -0500
@@ -986,7 +986,7 @@
 /* 476 */
   { ERR_BADCHANMASK, "%s :Bad Channel Mask", "476" },
 /* 477 */
-  { ERR_NEEDREGGEDNICK, "%s :Cannot join channel (+r)", "477" },
+  { ERR_NEEDREGGEDNICK, "%s :Cannot join channel (+r):  this channel requires 
a CService account -- you can obtain one from 
http://cservice.undernet.org/live/";, "477" },
 /* 478 */
   { ERR_BANLISTFULL, "%s %s :Channel ban/ignore list is full", "478" },
 /* 479 */
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to