소스 검색

* Fixed bot's being tagged with op/login stats. (#22)

svn: 1976
Bryan Drewery 21 년 전
부모
커밋
6897583cd5
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      doc/UPDATES
  2. 2 2
      src/userent.c

+ 1 - 0
doc/UPDATES

@@ -62,6 +62,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Users can no longer whois PERM OWNERS unless they are themselves one.
 * Users can no longer whois PERM OWNERS unless they are themselves one.
 * Fixed cmd_boot to allow users to boot users they can whois. (Users with lower flags)
 * Fixed cmd_boot to allow users to boot users they can whois. (Users with lower flags)
 * Fixed a file descriptor leak in the 'last' checking.
 * Fixed a file descriptor leak in the 'last' checking.
+* Fixed bot's being tagged with op/login stats. (#22)
 
 
 1.2.2
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 2 - 2
src/userent.c

@@ -404,7 +404,7 @@ struct user_entry_type USERENTRY_OS = {
 
 
 void stats_add(struct userrec *u, int login, int op)
 void stats_add(struct userrec *u, int login, int op)
 {
 {
-  if (!u)
+  if (!u || u->bot)
     return;
     return;
 
 
   char *s = (char *) get_user(&USERENTRY_STATS, u), s2[50] = "";
   char *s = (char *) get_user(&USERENTRY_STATS, u), s2[50] = "";
@@ -432,7 +432,7 @@ void stats_add(struct userrec *u, int login, int op)
 static void stats_display(int idx, struct user_entry *e, struct userrec *u)
 static void stats_display(int idx, struct user_entry *e, struct userrec *u)
 {
 {
   /* format: logincount opcount */
   /* format: logincount opcount */
-  if (dcc[idx].user && (dcc[idx].user->flags & USER_OWNER)) {
+  if (!u->bot && dcc[idx].user && (dcc[idx].user->flags & USER_OWNER)) {
     char *p = strchr(e->u.string, ' ');
     char *p = strchr(e->u.string, ' ');
 
 
     if (p)
     if (p)