소스 검색

Clear a bot's local list setting if it matches the global (#36)

This is due to the default (global) being added when adding to the list.
So if after removing from the list, it now matches the global, it should
do the inverse, and reset to match the global via being cleared.

This is mainly to aide in groups auto adding 'main' and auto removing
'main'
Bryan Drewery 14 년 전
부모
커밋
902563880c
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/set.c

+ 5 - 0
src/set.c

@@ -895,6 +895,11 @@ static char *var_rem_list(const char *botnick, variable_t *var, const char *elem
       strlcpy(ret, word, sizeof(ret));
   }
 
+  // If the data now matches the default global, just set to NULL
+  if (botnick && var->gdata && data && !strcmp(var->gdata, data)) {
+    data[0] = 0;
+  }
+
   if (num <= i && ret[0]) {
     var_set(var, botnick, data);
     if (botnick)