Bladeren bron

* Ported [2536] to 1.2.8 (fixes #9)

svn: 2619
Bryan Drewery 20 jaren geleden
bovenliggende
commit
225078f329
2 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 1 0
      doc/UPDATES
  2. 2 2
      src/botnet.c

+ 1 - 0
doc/UPDATES

@@ -44,6 +44,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed a bug in the listen code, which caused a segfault in /ctcp chat (a few other places too) (#189)
 * Fixed a bug in the listen code, which caused a segfault in /ctcp chat (a few other places too) (#189)
 * Fixed botcmd using wrong user on remote bot after doing su'ing to another user. (#190)
 * 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 botcmd -> su/quit causing remote bots to close random socket.
+* Fixed another cmd_whom bug which showed remote users from .botcmd. (#9)
 
 
 1.2.8
 1.2.8
 * Fixed [bot]* cmds depending on case of botnicks.
 * Fixed [bot]* cmds depending on case of botnicks.

+ 2 - 2
src/botnet.c

@@ -415,7 +415,7 @@ void answer_local_whom(int idx, int chan)
   /* Find longest nick and botnick */
   /* Find longest nick and botnick */
   nicklen = botnicklen = 0;
   nicklen = botnicklen = 0;
   for (i = 0; i < dcc_total; i++) {
   for (i = 0; i < dcc_total; i++) {
-    if (dcc[i].type && dcc[i].type == &DCC_CHAT) {
+    if (dcc[i].type && dcc[i].simul == -1 && dcc[i].type == &DCC_CHAT) {
       if ((chan == (-1)) || ((chan >= 0) && (dcc[i].u.chat->channel == chan))) {
       if ((chan == (-1)) || ((chan >= 0) && (dcc[i].u.chat->channel == chan))) {
         t = strlen(dcc[i].nick); if(t > nicklen) nicklen = t;
         t = strlen(dcc[i].nick); if(t > nicklen) nicklen = t;
         t = strlen(conf.bot->nick); if(t > botnicklen) botnicklen = t;
         t = strlen(conf.bot->nick); if(t > botnicklen) botnicklen = t;
@@ -443,7 +443,7 @@ void answer_local_whom(int idx, int chan)
     egg_snprintf(format, sizeof format, "%%c%%-%us %%c %%s\n", nicklen);
     egg_snprintf(format, sizeof format, "%%c%%-%us %%c %%s\n", nicklen);
   }
   }
   for (i = 0; i < dcc_total; i++) {
   for (i = 0; i < dcc_total; i++) {
-    if (dcc[i].type && dcc[i].type == &DCC_CHAT) {
+    if (dcc[i].type && dcc[i].simul == -1 && dcc[i].type == &DCC_CHAT) {
       if ((chan == (-1)) || ((chan >= 0) && (dcc[i].u.chat->channel == chan))) {
       if ((chan == (-1)) || ((chan >= 0) && (dcc[i].u.chat->channel == chan))) {
 	c = geticon(i);
 	c = geticon(i);
 	if (c == '-')
 	if (c == '-')