The Unknown BloggerRamblings of sorts
About this Entry
Posted by: hgchew

Visit hgchew's Xanga Site

Original: 2/23/2006 8:29 PM
Views: 31
Comments: 0
eProps: 0

Read Comments
Post a Comment
Back to Your Xanga Site



Thursday, February 23, 2006

hybserv path to prefix nick on collision

 
--- hybserv-1.9.1/src/nickserv.c        2006-02-23 21:18:20.000000000 +1030
+++ hybserv-1.9.1/src/nickserv.c.ori    2006-02-23 15:52:54.000000000 +1030
@@ -1383,14 +1383,17 @@
 
 {
   struct Luser *lptr = NULL;
-  char newnick[NICKLEN + 10];
+#if defined SVSNICK || defined FORCENICK
+  char newnick[NICKLEN + 1];
   long nicknum;
   int base;
   int i;
   int j;
+#else
   char **av;
   char sendstr[MAXLINE + 1];
   struct NickInfo *nptr = NULL;
+#endif
 
   if (!SafeConnect)
     return;
@@ -1431,7 +1434,7 @@
   ircsprintf(sendstr, "NICK %s 1 1 +i %s %s %s %lu :%s\r\n", lptr->nick,
       "enforced", Me.name, Me.name, 0xffffffffUL, "Nickname Enforcement");
 
-#else
+#elif !defined SVSNICK && !defined FORCENICK
 
   ircsprintf(sendstr, "NICK %s 1 %ld +i %s %s %s :%s\r\n",
       lptr->nick, (long) (lptr->nick_ts - 1), "enforced", Me.name,
@@ -1441,22 +1444,17 @@
 
   /* nope, we won't use ghosted nicknames, instead we'll force nick change
    * on remote nickname using SVSNICK or FORCENICK */
-
-#if defined SVSNICK || defined FORCENICK
-  if (ircncmp(lptr->nick, SVSNICK_PREFIX, strlen(SVSNICK_PREFIX))) {
 #ifdef SVSNICK
 
-    ircsprintf(newnick, "%s%s", SVSNICK_PREFIX, lptr->nick);
-    toserv(":%s SVSNICK %s %s\r\n", Me.name, lptr->nick, newnick);
+  ircsprintf(newnick, "%s%ld", SVSNICK_PREFIX, nicknum);
+  toserv(":%s SVSNICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
 #elif defined FORCENICK
 
-    ircsprintf(newnick, "%s%s", FORCENICK_PREFIX, lptr->nick);
-    toserv(":%s FORCENICK %s %s\r\n", Me.name, lptr->nick, newnick);
+  ircsprintf(newnick, "%s%ld", FORCENICK_PREFIX, nicknum);
+  toserv(":%s FORCENICK %s %s\r\n", Me.name, lptr->nick, newnick);
 
-#endif
-  } else {
-#endif
+#else
 
   /* Sending a server kill will be quieter than an oper
    * kill since most clients are -k */
@@ -1481,8 +1479,6 @@
       nptr->flags &= ~(NS_COLLIDE | NS_NUMERIC);
       nptr->flags |= NS_RELEASE;
     }
-#if defined SVSNICK || defined FORCENICK
-  }
 #endif
 } /* collide() */
 
 Posted 2/23/2006 8:29 PM - 31 Views - 0 eProps - 0 comments

Give eProps or Post a Comment

Choose Identity
(?)
 
Give eProps (?)
Post a Comment
Add Link | Preview HTML comment help 


Back to hgchew's Xanga Site!
Note: your comment will appear in hgchew's local time zone:
GMT +09:30 (Australia Central Standard - Darwin, Adelaide)
KoreanJapaneseAnime
What Happened in Bali,
Thousand Years of Love,
All about Eve,
Sand Glass, (The Hourglass)
Bodigadeu,
All In,
Propose,
Love Letter,
My Love Patzzi,
Stairway to Heaven,
Sweet 18
Trick,
Pretty Girls,
Asunaro Hakusho,
Maria,
Seija no Koushin,
101st Marriage Proposal,
Shopping Hero,
My Little Chef,
With Love,
Forbidden Love,
Heaven's Coin,
Food Fight,
Mukodono,
News no Onna,
Konna Koi no Hanashi,
Love & Fight,
Love Generation
Elfen Lied,
Emma,
Air,
Initial D,
Naruto,
Prince of Tennis,
Tenshi no Konamaiki,
Yawara
Site Meter