Mercurial > hg > nnchat
comparison main.c @ 620:a1abf812785f
Rename a function.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 27 May 2014 07:25:59 +0300 |
parents | 7d1aac6b27af |
children | 29b8ff5b625b |
comparison
equal
deleted
inserted
replaced
619:f930003dfa1e | 620:a1abf812785f |
---|---|
383 } | 383 } |
384 | 384 |
385 return 0; | 385 return 0; |
386 } | 386 } |
387 | 387 |
388 | |
388 void printMsgFile(nn_window_t *win, int flags, const char *stamp, const char *msg) | 389 void printMsgFile(nn_window_t *win, int flags, const char *stamp, const char *msg) |
389 { | 390 { |
390 if (win != NULL && win->logFile != NULL) | 391 if (win != NULL && win->logFile != NULL) |
391 { | 392 { |
392 if (flags & LOG_STAMP) printFile(win->logFile, stamp); | 393 if (flags & LOG_STAMP) printFile(win->logFile, stamp); |
557 (void) ctx; | 558 (void) ctx; |
558 printMsgConst(NULL, LOG_STAMP | LOG_WINDOW | LOG_FILE, msg); | 559 printMsgConst(NULL, LOG_STAMP | LOG_WINDOW | LOG_FILE, msg); |
559 } | 560 } |
560 | 561 |
561 | 562 |
562 BOOL checkNameList(qlist_t *list, const char *name) | 563 BOOL nn_check_name_list(qlist_t *list, const char *name) |
563 { | 564 { |
564 qlist_t *node; | 565 qlist_t *node; |
565 | 566 |
566 for (node = list; node != NULL; node = node->next) | 567 for (node = list; node != NULL; node = node->next) |
567 { | 568 { |
612 | 613 |
613 /* Check if the username is on our ignore list and | 614 /* Check if the username is on our ignore list and |
614 * that it is not our OWN username! | 615 * that it is not our OWN username! |
615 */ | 616 */ |
616 isMine = strcmp(name, optUserName) == 0; | 617 isMine = strcmp(name, optUserName) == 0; |
617 isIgnored = setIgnoreMode && !isMine && checkNameList(setIgnoreList, name); | 618 isIgnored = setIgnoreMode && !isMine && nn_check_name_list(setIgnoreList, name); |
618 | 619 |
619 // Is it a special control message? | 620 // Is it a special control message? |
620 if (*msg == '/') | 621 if (*msg == '/') |
621 { | 622 { |
622 // Ignore room join/leave messages | 623 // Ignore room join/leave messages |
641 in_msg = tmp + 2; | 642 in_msg = tmp + 2; |
642 else | 643 else |
643 in_msg = ""; | 644 in_msg = ""; |
644 *tmp = 0; | 645 *tmp = 0; |
645 | 646 |
646 if (!optOnlyFriendPrv || !checkNameList(setFriendList, in_name)) | 647 if (!optOnlyFriendPrv || !nn_check_name_list(setFriendList, in_name)) |
647 { | 648 { |
648 isIgnored = setIgnoreMode && checkNameList(setIgnoreList, in_name); | 649 isIgnored = setIgnoreMode && nn_check_name_list(setIgnoreList, in_name); |
649 win = nnwin_find(in_name); | 650 win = nnwin_find(in_name); |
650 | 651 |
651 if (win != NULL) | 652 if (win != NULL) |
652 { | 653 { |
653 printMsgF(win, isIgnored ? LOG_FILE : (LOG_FILE | LOG_WINDOW), | 654 printMsgF(win, isIgnored ? LOG_FILE : (LOG_FILE | LOG_WINDOW), |
688 colorNick = 14; | 689 colorNick = 14; |
689 colorText = 0; | 690 colorText = 0; |
690 } | 691 } |
691 else | 692 else |
692 { | 693 { |
693 if (checkNameList(setFriendList, name)) | 694 if (nn_check_name_list(setFriendList, name)) |
694 { | 695 { |
695 colorNick = 11; | 696 colorNick = 11; |
696 colorText = 0; | 697 colorText = 0; |
697 } | 698 } |
698 else | 699 else |