activated new fakehost protocol
[srvx.git] / src / proto-p10.c
index 1e4702726fd9fcfe080c4f9a21beb34588056f24..e5c190a5f79b3b66843a9141d7b5d747fa00b2ca 100644 (file)
 #define TOK_EOB_ACK             "EA"
 #define TOK_ERROR               "Y"
 #define TOK_FAKEHOST            "FA"
-#define TOK_FAKEHOST2           "FA2"
+#define TOK_FAKEHOST2           "NFH"
 #define TOK_GET                 "GET"
 #define TOK_GLINE               "GL"
 #define TOK_HASH                "HASH"
@@ -507,11 +507,11 @@ irc_fakehost(struct userNode *user, const char *host, const char *ident, int for
 {
     /* SRVX added the possibility for FAKE IDENTS
      * but this is currently *NOT* supported by our IRCu
+     *
+     * edit 24.11.11: 
+     *  NFH (P10_FAKEHOST2) is now supported by our IRCu (git-65-21592a4)
      */
-    int useNewFakehost = 0;
-     
-    if(useNewFakehost) putsock("%s " P10_FAKEHOST2 " %s %s %s%s", self->numeric, user->numeric, ident, host, force ? " FORCE" : "");
-    else putsock("%s " P10_FAKEHOST " %s %s", self->numeric, user->numeric, host);
+    putsock("%s " P10_FAKEHOST2 " %s %s %s%s", self->numeric, user->numeric, ident, host, force ? " FORCE" : "");
 }
 
 void 
@@ -1489,7 +1489,7 @@ static CMD_FUNC(cmd_clearmode)
 static CMD_FUNC(cmd_topic)
 {
     struct chanNode *cn;
-    unsigned long chan_ts, topic_ts;
+    unsigned long topic_ts;
 
     if (argc < 3)
         return 0;
@@ -1499,10 +1499,8 @@ static CMD_FUNC(cmd_topic)
     }
     if (argc >= 5) {
         /* Looks like an Asuka style topic burst. */
-        chan_ts = atoi(argv[2]);
         topic_ts = atoi(argv[3]);
     } else {
-        chan_ts = cn->timestamp;
         topic_ts = now;
     }
     SetChannelTopic(cn, GetUserH(origin), argv[argc-1], 0);
@@ -1777,11 +1775,9 @@ static CMD_FUNC(cmd_relay)
              } else {
                 devnull[0] = 0;
              }
-             /*
              if(!HANDLE_FLAGGED(hi, AUTOHIDE)) {
                 sprintf(tmp,"%s LA %s 0 %s\n",argv[3],hi->handle,devnull);
-             } else */ 
-             if(getfakehost(argv[4])) {
+             } else if(getfakehost(argv[4])) {
                 sprintf(tmp,"%s LA %s %s %s\n",argv[3],hi->handle,getfakehost(argv[4]),devnull);
              } else {
                 extern const char *hidden_host_suffix;
@@ -2242,7 +2238,6 @@ AddLocalUser(const char *nick, const char *ident, const char *hostname, const ch
 {
     char numeric[COMBO_NUMERIC_LEN+1];
     int local_num = get_local_numeric();
-    unsigned long timestamp = now;
     struct userNode *old_user = GetUserH(nick);
 
     if (!modes)
@@ -2250,7 +2245,6 @@ AddLocalUser(const char *nick, const char *ident, const char *hostname, const ch
     if (old_user) {
         if (IsLocal(old_user))
             return old_user;
-        timestamp = old_user->timestamp - 1;
     }
     if (local_num == -1) {
         log_module(MAIN_LOG, LOG_ERROR, "Unable to allocate numnick for service %s", nick);