]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/hash.c
allow auto-oper on LOC too
[irc/evilnet/x3.git] / src / hash.c
index defbf84afd356a27771536d4ffe0102c7baf3a17..c45e5a387ae4be1e242843d0d0ad6e15e00e0266 100644 (file)
@@ -5,7 +5,7 @@
  *
  * x3 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -197,6 +197,40 @@ NickChange(struct userNode* user, const char *new_nick, int no_announce)
     free(old_nick);
 }
 
+void
+SVSNickChange(struct userNode* user, const char *new_nick)
+{
+    char *old_nick;
+    unsigned int nn;
+
+    /* don't do anything if there's no change */
+    old_nick = user->nick;
+    if (!strncmp(new_nick, old_nick, NICKLEN))
+        return;
+
+    /* remove old entry from clients dictionary */
+    dict_remove(clients, old_nick);
+#if !defined(WITH_PROTOCOL_P10)
+    /* Remove from uplink's clients dict */
+    dict_remove(user->uplink->users, old_nick);
+#endif
+    /* and reinsert */
+    user->nick = strdup(new_nick);
+    dict_insert(clients, user->nick, user);
+#if !defined(WITH_PROTOCOL_P10)
+    dict_insert(user->uplink->users, user->nick, user);
+#endif
+
+    /* Make callbacks for nick changes.  Do this with new nick in
+     * place because that is slightly more useful.
+     */
+    for (nn=0; nn<ncf2_used; nn++)
+        ncf2_list[nn](user, old_nick);
+    user->timestamp = now;
+
+    free(old_nick);
+}
+
 struct userNode *
 GetUserH(const char *nick)
 {
@@ -219,7 +253,8 @@ call_account_func(struct userNode *user, const char *stamp)
 {
     /* We've received an account stamp for a user; notify
        NickServ, which registers the sole account_func
-       right now.
+       right now.  TODO: This is a bug. This needs to register 
+       a proper list not just kill with each call!! -Rubin
 
        P10 Protocol violation if (user->modes & FLAGS_STAMPED) here.
     */
@@ -713,7 +748,7 @@ ChannelUserKicked(struct userNode* kicker, struct userNode* victim, struct chanN
     unsigned int n;
     struct modeNode *mn;
 
-    if (!victim || !channel || IsService(victim) || !GetUserMode(channel, victim))
+    if (!victim || !channel || !GetUserMode(channel, victim))
         return;
 
     /* Update the kicker's idle time (kicker may be null if it was a server) */