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

* Remove obsolete code botshouldjoin()

Bryan Drewery 14 жил өмнө
parent
commit
e88a064ec3

+ 0 - 62
src/chanprog.c

@@ -776,68 +776,6 @@ int isowner(char *name)
   }
 }
 
-/* this method is slow, but is only called when sharing and adding/removing chans */
-
-int 
-botshouldjoin(struct userrec *u, struct chanset_t *chan)
-{
-  /* just return 1 for now */
-  return 1;
-/*
-  char *chans = NULL;
-  struct userrec *u = NULL;
- 
-  u = get_user_by_handle(userlist, bot);
-  if (!u)
-    return;
-  chans = get_user(&USERENTRY_CHANS, u);
-*/
-}
-/* future use ?
-void
-chans_addbot(const char *bot, struct chanset_t *chan)
-{
-  char *chans = NULL;
-  struct userrec *u = NULL;
- 
-  u = get_user_by_handle(userlist, bot);
-  if (!u)
-    return;
-  chans = get_user(&USERENTRY_CHANS, u);
-  if (!botshouldjoin(u, chan)) {		
-    size_t size;
-    char *buf = NULL;
-   
-    size = strlen(chans) + strlen(chan->dname) + 2;
-    buf = (char *) my_calloc(1, size);
-    simple_snprintf(buf, size, "%s %s", chans, chan->dname);
-    set_user(&USERENTRY_CHANS, u, buf);
-    free(buf);
-  }
-}
-
-void 
-chans_delbot(const char *bot, struct chanset_t *chan)
-{
-  char *chans = NULL;
-  struct userrec *u = NULL;
- 
-  u = get_user_by_handle(userlist, bot);
-  if (!u)
-    return;
- 
-  if (botshouldjoin(u, chan)) {			
-    char *chans = NULL, *buf = NULL;
-    size_t size;
-
-    chans = get_user(&USERENTRY_CHANS, u);
-    size = strlen(chans) - strlen(chan->dname) + 2;
-
-    
-  }
-}
-*/
-
 bool bot_shouldjoin(struct userrec* u, struct flag_record* fr, struct chanset_t* chan, bool ignore_inactive)
 {
   // If restarting, keep this channel.

+ 0 - 1
src/chanprog.h

@@ -23,7 +23,6 @@ void rmspace(char *s);
 void set_chanlist(const char *host, struct userrec *rec);
 void clear_chanlist(void);
 void clear_chanlist_member(const char *nick);
-int botshouldjoin(struct userrec *u, struct chanset_t *);
 bool bot_shouldjoin(struct userrec* , struct flag_record *, struct chanset_t *, bool = 0);
 bool shouldjoin(struct chanset_t *);
 char *samechans(const char *, const char *);

+ 1 - 9
src/mod/channels.mod/userchan.c

@@ -701,9 +701,6 @@ static void write_chan(bd::Stream& stream, int idx, struct chanset_t* chan)
   putlog(LOG_DEBUG, "*", "writing channel %s to userfile..", chan->dname);
 
   bool force_inactive = 0;
-  /* if a bot should explicitly NOT join, just set it +inactive ... */
-  if (idx >= 0 && !botshouldjoin(dcc[idx].user, chan))
-    force_inactive = 1;
 
   stream << bd::String::printf("+ channel add %s { ", chan->dname);
   if (chan != chanset_default)
@@ -826,12 +823,7 @@ void write_chans_compat(bd::Stream& stream, int idx)
     putlog(LOG_DEBUG, "*", "writing channel %s to userfile..", chan->dname);
     get_mode_protect(chan, w, sizeof(w));
 
-    /* if a bot should explicitly NOT join, just set it +inactive ... */
-    if (idx >= 0 && !botshouldjoin(dcc[idx].user, chan))
-      inactive = '+';
-    /* ... otherwise give the bot the *actual* setting */
-    else
-      inactive = PLSMNS(channel_inactive(chan));
+    inactive = PLSMNS(channel_inactive(chan));
 
     stream << bd::String::printf("\
 + channel add %s { chanmode { %s } addedby %s addedts %li \

+ 0 - 1
src/tandem.h

@@ -14,7 +14,6 @@ typedef struct tand_t_struct {
   time_t buildts;
   int localhub;
   struct userrec* u;
-  char *not_chans;
   char commit[10];
   char bot[HANDLEN + 1];
   char version[151];