Explorar o código

* Ported [2537] to 1.2.9

svn: 2620
Bryan Drewery %!s(int64=20) %!d(string=hai) anos
pai
achega
e904b180eb
Modificáronse 3 ficheiros con 6 adicións e 0 borrados
  1. 1 0
      doc/UPDATES
  2. 4 0
      src/cmds.c
  3. 1 0
      src/dcc.h

+ 1 - 0
doc/UPDATES

@@ -45,6 +45,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed botcmd using wrong user on remote bot after doing su'ing to another user. (#190)
 * Fixed botcmd -> su/quit causing remote bots to close random socket.
 * Fixed another cmd_whom bug which showed remote users from .botcmd. (#9)
+* Fixed returning from 'su' not returning user to correct channel. (ie, partyline)
 
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.

+ 4 - 0
src/cmds.c

@@ -2966,6 +2966,8 @@ static void cmd_su(int idx, char *par)
 	  free(dcc[idx].u.chat->away);
         dcc[idx].u.chat->away = strdup(dcc[idx].nick);
         dcc[idx].u.chat->su_nick = strdup(dcc[idx].nick);
+        dcc[idx].u.chat->su_channel = dcc[idx].u.chat->channel;
+
 	dcc[idx].user = u;
 	strcpy(dcc[idx].nick, par);
 	/* Display password prompt and turn off echo (send IAC WILL ECHO). */
@@ -2982,6 +2984,7 @@ static void cmd_su(int idx, char *par)
 	if (atr & USER_MASTER)
 	  dcc[idx].u.chat->con_flags = conmask;
         dcc[idx].u.chat->su_nick = strdup(dcc[idx].nick);
+        dcc[idx].u.chat->su_channel = dcc[idx].u.chat->channel;
 	dcc[idx].user = u;
 	strcpy(dcc[idx].nick, par);
 	dcc_chatter(idx);
@@ -4246,6 +4249,7 @@ static void cmd_quit(int idx, char *text)
 		free(dcc[idx].u.chat->su_nick);
 		dcc[idx].u.chat->su_nick = NULL;
 		dcc_chatter(idx);
+                dcc[idx].u.chat->channel = dcc[idx].u.chat->su_channel;
 
 		if (dcc[idx].u.chat->channel < GLOBAL_CHANS && dcc[idx].u.chat->channel >= 0) {
 			botnet_send_join_idx(idx);

+ 1 - 0
src/dcc.h

@@ -88,6 +88,7 @@ struct chat_info {
   int con_flags;                /* with console: what to show           */
   int strip_flags;              /* what codes to strip (b,r,u,c,a,g,*)  */
   int channel;                  /* 0=party line, -1=off                 */
+  int su_channel;
   char *away;                   /* non-NULL if user is away             */
   char *su_nick;
   char con_chan[81];            /* with console: what channel to view   */