Răsfoiți Sursa

* Hubs will relay relevant userfile changes to localhubs for their child bots

Bryan Drewery 16 ani în urmă
părinte
comite
174b3caa0d
1 a modificat fișierele cu 4 adăugiri și 2 ștergeri
  1. 4 2
      src/mod/share.mod/share.c

+ 4 - 2
src/mod/share.mod/share.c

@@ -1179,11 +1179,13 @@ shareout_prot(struct userrec *u, const char *format, ...)
     s[2 + (l = 509)] = 0;
   va_end(va);
 
+  int localhub = nextbot(u->handle);
+
   for (int i = 0; i < dcc_total; i++) {
     if (dcc[i].type && (dcc[i].type->flags & DCT_BOT) && 
        (dcc[i].status & STAT_SHARE) && !(dcc[i].status & (STAT_GETTING | STAT_SENDING)) &&
-       /* only send to hubs and to the same user */
-       (dcc[i].hub || dcc[i].user == u)) {
+       /* only send to hubs, the bot itself, or the localhub in the chain */
+       (dcc[i].hub || dcc[i].user == u || (localhub != -1 && i == localhub))) {
       tputs(dcc[i].sock, s, l + 2);
     }
   }