Mercurial > hg > nnchat
comparison nnchat.c @ 265:b9c650db8a6a
Rename variable nnIgnoreList to setIgnoreList.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 03 Jun 2011 11:18:50 +0300 |
parents | 4c1c18a388d9 |
children | 5175ed15ffa4 |
comparison
equal
deleted
inserted
replaced
264:4c1c18a388d9 | 265:b9c650db8a6a |
---|---|
67 BOOL setPrvMode = FALSE; | 67 BOOL setPrvMode = FALSE; |
68 BOOL setIgnoreMode = FALSE; | 68 BOOL setIgnoreMode = FALSE; |
69 BOOL optDebug = FALSE; | 69 BOOL optDebug = FALSE; |
70 BOOL optLogEnable = FALSE; | 70 BOOL optLogEnable = FALSE; |
71 | 71 |
72 qlist_t *nnIgnoreList = NULL, | 72 qlist_t *setIgnoreList = NULL, |
73 *setIdleMessages = NULL; | 73 *setIdleMessages = NULL; |
74 nn_userhash_t *nnUsers = NULL; | 74 nn_userhash_t *nnUsers = NULL; |
75 char *setConfigFile = NULL, | 75 char *setConfigFile = NULL, |
76 *setBrowser = NULL; | 76 *setBrowser = NULL; |
77 cfgitem_t *cfg = NULL; | 77 cfgitem_t *cfg = NULL; |
435 } | 435 } |
436 | 436 |
437 | 437 |
438 BOOL checkIgnoreList(const char *name) | 438 BOOL checkIgnoreList(const char *name) |
439 { | 439 { |
440 qlist_t *node = nnIgnoreList; | 440 qlist_t *node = setIgnoreList; |
441 while (node != NULL) { | 441 while (node != NULL) { |
442 if (strcasecmp(name, (char *) node->data) == 0) | 442 if (strcasecmp(name, (char *) node->data) == 0) |
443 return TRUE; | 443 return TRUE; |
444 node = node->next; | 444 node = node->next; |
445 } | 445 } |
683 } | 683 } |
684 else if (!strncasecmp(buf, "/ignore", 7)) { | 684 else if (!strncasecmp(buf, "/ignore", 7)) { |
685 char *name = trimLeft(buf + 7); | 685 char *name = trimLeft(buf + 7); |
686 if (strlen(name) > 0) { | 686 if (strlen(name) > 0) { |
687 /* Add or remove someone to/from ignore */ | 687 /* Add or remove someone to/from ignore */ |
688 qlist_t *user = th_llist_find_func(nnIgnoreList, name, compareUsername); | 688 qlist_t *user = th_llist_find_func(setIgnoreList, name, compareUsername); |
689 if (user != NULL) { | 689 if (user != NULL) { |
690 printMsg("Removed user '%s' from ignore.\n", name); | 690 printMsg("Removed user '%s' from ignore.\n", name); |
691 th_llist_delete_node(&nnIgnoreList, user); | 691 th_llist_delete_node(&setIgnoreList, user); |
692 } else { | 692 } else { |
693 printMsg("Now ignoring '%s'.\n", name); | 693 printMsg("Now ignoring '%s'.\n", name); |
694 th_llist_append(&nnIgnoreList, th_strdup(name)); | 694 th_llist_append(&setIgnoreList, th_strdup(name)); |
695 } | 695 } |
696 } else { | 696 } else { |
697 /* Just list whomever is in ignore now */ | 697 /* Just list whomever is in ignore now */ |
698 qlist_t *user = nnIgnoreList; | 698 qlist_t *user = setIgnoreList; |
699 ssize_t nuser = th_llist_length(nnIgnoreList); | 699 ssize_t nuser = th_llist_length(setIgnoreList); |
700 printMsg("Users ignored (%d): ", nuser); | 700 printMsg("Users ignored (%d): ", nuser); |
701 while (user != NULL) { | 701 while (user != NULL) { |
702 if (user->data != NULL) { | 702 if (user->data != NULL) { |
703 printMsgC("'%s'", (char *) user->data); | 703 printMsgC("'%s'", (char *) user->data); |
704 if (--nuser > 0) | 704 if (--nuser > 0) |
1080 th_cfg_add_hexvalue(&tmpcfg, "color", &optUserColor, optUserColor); | 1080 th_cfg_add_hexvalue(&tmpcfg, "color", &optUserColor, optUserColor); |
1081 | 1081 |
1082 th_cfg_add_comment(&tmpcfg, "Default setting of ignore mode"); | 1082 th_cfg_add_comment(&tmpcfg, "Default setting of ignore mode"); |
1083 th_cfg_add_bool(&tmpcfg, "ignore", &setIgnoreMode, setIgnoreMode); | 1083 th_cfg_add_bool(&tmpcfg, "ignore", &setIgnoreMode, setIgnoreMode); |
1084 th_cfg_add_comment(&tmpcfg, "People to be ignored when ignore mode is enabled"); | 1084 th_cfg_add_comment(&tmpcfg, "People to be ignored when ignore mode is enabled"); |
1085 th_cfg_add_string_list(&tmpcfg, "ignore_list", &nnIgnoreList); | 1085 th_cfg_add_string_list(&tmpcfg, "ignore_list", &setIgnoreList); |
1086 | 1086 |
1087 th_cfg_add_comment(&tmpcfg, "Random messages for idle timeout protection. If none are set, plain '.' is used."); | 1087 th_cfg_add_comment(&tmpcfg, "Random messages for idle timeout protection. If none are set, plain '.' is used."); |
1088 th_cfg_add_string_list(&tmpcfg, "idle_messages", &setIdleMessages); | 1088 th_cfg_add_string_list(&tmpcfg, "idle_messages", &setIdleMessages); |
1089 | 1089 |
1090 th_cfg_add_section(&cfg, "general", tmpcfg); | 1090 th_cfg_add_section(&cfg, "general", tmpcfg); |