Просмотр исходного кода

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

svn: 1976
Bryan Drewery 21 лет назад
Родитель
Сommit
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.
 * 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 bot's being tagged with op/login stats. (#22)
 
 1.2.2
 * 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)
 {
-  if (!u)
+  if (!u || u->bot)
     return;
 
   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)
 {
   /* 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, ' ');
 
     if (p)