Jelajahi Sumber

Fix HQ user not getting color

Bryan Drewery 11 tahun lalu
induk
melakukan
cd48b314f3
3 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/chanprog.cc
  3. 2 2
      src/misc.cc

+ 1 - 0
doc/UPDATES

@@ -5,6 +5,7 @@ maint
   * Fix ptrace detection on Linux
   * Fix broken startup with GCC from ports on FreeBSD.
   * Fix simulated terminal mode (-nt) defaulting to all console flags.
+  * Fix simulated terminal mode (-nt) not having color supported.
 
 1.4.5
   * Remove ahbl as it now positively identifies all hosts as abusive

+ 1 - 1
src/chanprog.cc

@@ -699,7 +699,7 @@ void setup_HQ(int n) {
     dcc[n].timeval = now;
     dcc[n].u.chat->con_flags = conmask;
     dcc[n].u.chat->strip_flags = STRIP_ALL;
-    dcc[n].status = STAT_ECHO;
+    dcc[n].status = STAT_ECHO|STAT_COLOR;
     strlcpy(dcc[n].nick, STR("HQ"), sizeof(dcc[n].nick));
     strlcpy(dcc[n].host, STR("llama@console"), sizeof(dcc[n].host));
     dcc[n].user = get_user_by_handle(userlist, dcc[n].nick);

+ 2 - 2
src/misc.cc

@@ -1288,8 +1288,8 @@ coloridx(int idx)
     if (dcc[idx].irc || dcc[idx].bot) {
       return 0;
     } else if ((dcc[idx].status & STAT_COLOR) && (dcc[idx].type && dcc[idx].type != &DCC_RELAYING)) {
-      /* telnet probably wants ANSI, even though it might be a relay from an mIRC client; fuck`em */
-      if (dcc[idx].status & STAT_TELNET)
+      /* telnet probably wants ANSI, even though it might be a relay from an mIRC client */
+      if (dcc[idx].status & STAT_TELNET || dcc[idx].sock == STDOUT)
         return 1;
       /* non-telnet is probably a /dcc-chat, most irc clients support mIRC codes... */
       else