1
0
Эх сурвалжийг харах

* Fixed a bug in cmd_quit (was not returning from cmd_su correctly)
* Fixed a second log display in core_binds.c for "dcc"


svn: 742

Bryan Drewery 22 жил өмнө
parent
commit
2adfd23623
2 өөрчлөгдсөн 10 нэмэгдсэн , 7 устгасан
  1. 7 7
      src/cmds.c
  2. 3 0
      src/core_binds.c

+ 7 - 7
src/cmds.c

@@ -3980,32 +3980,32 @@ static void cmd_quit(struct userrec *u, int idx, char *text)
 		check_bind_chpt(conf.bot->nick, dcc[idx].nick, dcc[idx].sock, dcc[idx].u.chat->channel);
 	}
 	check_bind_chof(dcc[idx].nick, idx);
-	dprintf(idx, "*** See you later cowboy!\n\n");
+	dprintf(idx, "*** Ja Mata\n");
 	flush_lines(idx, dcc[idx].u.chat);
 	putlog(LOG_MISC, "*", "DCC connection closed (%s!%s)", dcc[idx].nick, dcc[idx].host);
 	if (dcc[idx].u.chat->channel >= 0) {
 		chanout_but(-1, dcc[idx].u.chat->channel, "*** %s left the party line%s%s\n", dcc[idx].nick, text[0] ? ": " : ".", text);
-		if (dcc[idx].u.chat->channel < 100000) {
+		if (dcc[idx].u.chat->channel < GLOBAL_CHANS) {
 			botnet_send_part_idx(idx, text);
 		}
 	}
 
 	if (dcc[idx].u.chat->su_nick) {
 		dcc[idx].user = get_user_by_handle(userlist, dcc[idx].u.chat->su_nick);
+		strcpy(dcc[idx].nick, dcc[idx].u.chat->su_nick);
 		dcc[idx].type = &DCC_CHAT;
 		dprintf(idx, "Returning to real nick %s!\n", dcc[idx].u.chat->su_nick);
 		free(dcc[idx].u.chat->su_nick);
 		dcc[idx].u.chat->su_nick = NULL;
 		dcc_chatter(idx);
-		if (dcc[idx].u.chat->channel < 100000 && dcc[idx].u.chat->channel >= 0) {
+
+		if (dcc[idx].u.chat->channel < GLOBAL_CHANS && dcc[idx].u.chat->channel >= 0) {
 			botnet_send_join_idx(idx, -1);
 		}
-	}
-	else if ((dcc[idx].sock != STDOUT) || backgrd) {
+	} else if ((dcc[idx].sock != STDOUT) || backgrd) {
 		killsock(dcc[idx].sock);
 		lostdcc(idx);
-	}
-	else {
+	} else {
 		dprintf(DP_STDOUT, "\n### SIMULATION RESET\n\n");
 		dcc_chatter(idx);
 	}

+ 3 - 0
src/core_binds.c

@@ -99,9 +99,12 @@ void check_bind_dcc(const char *cmd, int idx, const char *text)
   putlog(LOG_DEBUG, "*", "%s RETURNED: %d", cmd, x);
   if (x == -1)
     dprintf(idx, "What?  You need '%shelp'\n", dcc_prefix);
+
+  /* I doubt we'll want this.. 
   else if (x & BIND_RET_LOG) {
      putlog(LOG_CMDS, "*", "#%s# %s %s", dcc[idx].nick, cmd, text);
   }
+  */
 }
 
 void check_bind_bot(const char *nick, const char *code, const char *param)