Mercurial > pidgin.yaz
changeset 4536:ba99d30afc14
[gaim-migrate @ 4815]
New idletracker
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Wed, 05 Feb 2003 23:50:05 +0000 |
parents | de9f45c815df |
children | 741a18f2fb23 |
files | src/Makefile.mingw src/idle.c |
diffstat | 2 files changed, 14 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Makefile.mingw Wed Feb 05 23:49:10 2003 +0000 +++ b/src/Makefile.mingw Wed Feb 05 23:50:05 2003 +0000 @@ -16,7 +16,7 @@ PERL_INCLUDE := $(PERL_LIB_DIR)/CORE ASPELL_TOP := ../../win32-dev/aspell-15 GTKSPELL_TOP := ../../win32-dev/gtkspell-2.0.3 -IDLETRACKER_TOP := $(GAIM_TOP)/src/win32/IdleTracker +IDLETRACK_TOP := $(GAIM_TOP)/src/win32/IdleTracker GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir MINGW_PLUS_DIR := $(GAIM_SRC)/win32/mingw_plus @@ -50,7 +50,7 @@ INCLUDE_PATHS = -I$(INCLUDE_DIR) \ -I$(INCLUDE_DIR)/win32 \ -I$(MINGW_PLUS_DIR) \ - -I$(IDLETRACKER_TOP) \ + -I$(IDLETRACK_TOP) \ -I$(GAIM_TOP) \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/gtk-2.0 \ @@ -66,7 +66,7 @@ LIB_PATHS = -L$(GTK_TOP)/lib \ -L$(GAIM_SRC) \ - -L$(IDLETRACKER_TOP) \ + -L$(IDLETRACK_TOP) \ -L$(PERL_LIB_DIR) \ -L$(ASPELL_TOP)/lib \ -L$(GTKSPELL_TOP)/gtkspell @@ -75,7 +75,7 @@ ## SOURCES, OBJECTS ## -DLL_C_SRC = about.c \ +DLL_C_SRC = about.c \ away.c \ browser.c \ buddy.c \ @@ -139,7 +139,7 @@ -lwinmm \ -lperl56 \ -laspell-15 \ - -lIdleTrac + -lidletrack @@ -168,8 +168,8 @@ install: cp $(GAIM_SRC)/gaim.exe $(GAIM_SRC)/gaim.dll $(GAIM_INSTALL_DIR) -$(GAIM_SRC)/win32/IdleTracker/IdleTrac.dll: - $(MAKE) -C $(GAIM_SRC)/win32/IdleTracker -f Makefile.mingw +$(IDLETRACK_TOP)/idletrack.dll: + $(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw # # BUILD DLL @@ -187,7 +187,7 @@ dlltool --dllname $(TARGET).dll --base-file $(TARGET).base \ --output-exp $(TARGET).exp --def $(TARGET).def -$(TARGET).dll: $(DLL_OBJECTS) $(GAIM_SRC)/win32/IdleTracker/IdleTrac.dll $(TARGET).exp +$(TARGET).dll: $(DLL_OBJECTS) $(IDLETRACK_TOP)/idletrack.dll $(TARGET).exp $(CC) -mdll $(LDFLAGS) -o $(TARGET).dll $(DLL_OBJECTS) -Wl,$(TARGET).exp $(LIB_PATHS) $(DLL_LIBS) rm -rf $(TARGET).exp $(TARGET).def $(TARGET).base @@ -206,7 +206,7 @@ ## clean: - $(MAKE) -C $(GAIM_SRC)/win32/IdleTracker -f Makefile.mingw clean + $(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw clean rm -rf *.o ./win32/*.o rm -rf $(TARGET).dll rm -rf $(TARGET).lib
--- a/src/idle.c Wed Feb 05 23:49:10 2003 +0000 +++ b/src/idle.c Wed Feb 05 23:50:05 2003 +0000 @@ -33,7 +33,7 @@ #include <X11/extensions/scrnsaver.h> #include <gdk/gdkx.h> #else -#include "IdleTracker.h" +#include "idletrack.h" #endif #endif /* USE_SCREENSAVER */ @@ -41,6 +41,7 @@ #include "gaim.h" #include "prpl.h" +#define IDLEMARK 600 /* 10 minutes! */ gint check_idle(gpointer data) { @@ -74,8 +75,7 @@ } else idle_time = 0; #else - /* IdleTracker monitors usage of all other apps by setting a hook function */ - idle_time = (GetTickCount() - IdleTrackerGetLastTickCount()) / 1000; + idle_time = (GetTickCount() - wgaim_get_lastactive()) / 1000; #endif } else #endif /* USE_SCREENSAVER */ @@ -119,12 +119,12 @@ return TRUE; } - if (idle_time > 600 && !gc->is_idle) { /* 10 minutes! */ + if (idle_time > IDLEMARK && !gc->is_idle) { debug_printf("setting %s idle %d seconds\n", gc->username, idle_time); serv_set_idle(gc, idle_time); gc->is_idle = 1; system_log(log_idle, gc, NULL, OPT_LOG_BUDDY_IDLE | OPT_LOG_MY_SIGNON); - } else if (idle_time < 600 && gc->is_idle) { + } else if (idle_time < IDLEMARK && gc->is_idle) { debug_printf("setting %s unidle\n", gc->username); serv_touch_idle(gc); system_log(log_unidle, gc, NULL, OPT_LOG_BUDDY_IDLE | OPT_LOG_MY_SIGNON);