diff -urdBN emech-2.8.1/src/combot.c emech-2.8.1-topic/src/combot.c --- emech-2.8.1/src/combot.c Mon Apr 2 04:26:12 2001 +++ emech-2.8.1-topic/src/combot.c Thu Apr 5 18:44:28 2001 @@ -739,6 +739,7 @@ #endif /* MULTI */ char *temp,*chantemp; int x; + int trvar; ltime = localtime(&now); x = 0; @@ -766,6 +767,16 @@ parse_avoice(Chan); if (Chan->avoice) x++; + + trvar = get_int_varc(Chan,SETTR_VAR); + if (trvar && ((now - Chan->last_topic) >= (trvar * 60))) + { + if (Chan->topic) + { + send_to_server("TOPIC %s :%s",Chan->name,Chan->topic); + Chan->last_topic = now; + } + } #ifdef LINKING if (!Chan->bot_is_op && Chan->active == CH_ACTIVE) needop(Chan->name); diff -urdBNU 1 emech-2.8.1/src/defines.h emech-2.8.1-topic/src/defines.h --- emech-2.8.1/src/defines.h Mon Apr 2 04:26:12 2001 +++ emech-2.8.1-topic/src/defines.h Thu Apr 5 18:27:27 2001 @@ -120,2 +120,3 @@ SETMAL_VAR, + SETTR_VAR, SETBANMODES_VAR, diff -urdBNU 1 emech-2.8.1/src/global.h emech-2.8.1-topic/src/global.h --- emech-2.8.1/src/global.h Mon Apr 2 09:03:52 2001 +++ emech-2.8.1-topic/src/global.h Thu Apr 5 18:41:54 2001 @@ -189,2 +189,3 @@ { /* MAL */ INT_VAR, 90, NULL, 0, 100 }, +{ /* TR */ INT_VAR, 0, NULL, 0, 1500 }, { /* BANMODES */ INT_VAR+GLOBAL_VAR, 4, NULL, 1, 10 }, @@ -238,2 +239,3 @@ { "MAL", "Mass action level (Max userlevel that mass functions won't affect)" }, +{ "TR", "Topic refresh delay in minutes (0 turns it off)" }, { "BANMODES", "Number of MODE -b that can be done at a time" }, diff -urdBNU 1 emech-2.8.1/src/structs.h emech-2.8.1-topic/src/structs.h --- emech-2.8.1/src/structs.h Mon Apr 2 04:26:12 2001 +++ emech-2.8.1-topic/src/structs.h Thu Apr 5 18:23:01 2001 @@ -170,2 +170,3 @@ time_t last_needop; /* last time we asked for ops */ + time_t last_topic; /* last time the topic got refreshed */