Bug 92949

Summary: Kopete auto away on idle time does not work properly when running in Xvnc
Product: [Applications] kopete Reporter: Alkis Evlogimenos <alkis_e>
Component: generalAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ana, dominik.karall, howells, iwilcox, mail
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Alkis Evlogimenos 2004-11-09 04:27:23 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6) current gentoo compiler at the time of submission of this bug
OS:                Linux

I am running kde in an Xvnc session. When I disconnect the screensaver kicks in after 5 minutes but kopete never goes to auto-away. If I enable system events in windows and I leave a window open, I can see that my status goes to away 5 minutes into being idle but gets back to online 4-5 seconds after that. Then it nevers goes to away so I appear always online.
Comment 1 Richard Smith 2004-11-18 01:38:15 UTC
This is strange. The code we use for auto-away is actually taken from kscreensaver, so (assuming you use kscreensaver and not some other screensaver) they ought to either both work or neither work. Maybe kscreensaver has a fix we don't.
Comment 2 Chris Howells 2004-11-18 02:12:21 UTC
Kscreensaver had major changes done to it about a year ago, before the code was forked for Kopete. So this is very possible.

Just FYI, to enable screensaver support in kdm, I will at some stage abstract the screensaver code out of kdesktop and put it into a lib, which kopete would be able to use.
Comment 3 Matt Rogers 2005-10-11 06:19:53 UTC
*** Bug 113068 has been marked as a duplicate of this bug. ***
Comment 4 Dominik Karall 2005-10-17 03:07:13 UTC
Is anybody working on this bug? I can't believe that we are the only one who have this problem!?

I'm running kscreensaver and it works, but kopete doesn't auto away on idle time.
Comment 5 Matthias Granberry 2005-10-17 08:00:50 UTC
Which protocol?
Comment 6 Dominik Karall 2005-10-17 12:03:41 UTC
All. It's not protocol specific.
Comment 7 Dominik Karall 2005-10-17 12:58:15 UTC
You can read this bug
http://bugs.kde.org/show_bug.cgi?id=113068 (which is duplicated of this one)
for more infos.

hth
Comment 8 Hobbsee 2005-11-12 13:47:32 UTC
Same thing occurs in kde 3.5 release candidate 1, kubuntu binaires.
Comment 9 Hobbsee 2005-11-15 10:36:56 UTC
now looks to be fixed, in the latest version of kde 3.5 release candidate 1, kubuntu binaries 

(kopete 0.11)
Comment 10 Dominik Karall 2005-11-15 11:26:15 UTC
I can't confirm that with gentoo packages. It's still the same, when I start kscreensaver and leave my pc for a few minutes, my accounts switch to online status after about 5 seconds.
Comment 11 Isaac Wilcox 2005-12-02 14:14:28 UTC
Executive summary: The problem may be caused by XQueryPointer returning stale data.  You can patch around this (and bug 117513) by querying kdesktop::KScreensaverIface::isBlanked() over DCOP, but that solution wouldn't work for people who use non-KDE screensavers like xscreensaver.

Long version (get a cup of tea, cos this is long :) )...

So, I had a look into this.  I don't use Xvnc - my symptoms are those described in http://bugs.kde.org/show_bug.cgi?id=113068 (if set auto-away by explicitly locking the screen, I come back online within about 5/6 seconds without touching the machine).  I'm not entirely convinced that these two bugs are actually the same, but that bug has been marked a duplicate of this one, so I'll add my notes here.

I can reproduce the problem 100% reliably with the Debian 3.4.2-3 kopete binary.  I hit lock, come back a few minutes later, and see that I was marked online again a few seconds after I left.  So I build a debug version of kopete.  GDB was fairly useless as the interesting code (libkopete/kopeteaway.cpp) involves a QTimer firing every 4s, and debuggers really get in the way.  So I added a bunch of std::cerrs to try to explain why kopete thought I'd returned.

First, a little background on how the idle detection in kopeteaway.cpp works. 

When you go autoaway (by detecting KDE screensaver activation by a DCOP signal or by being idle for N seconds) a mouse x coordinate of -1 is recorded by setAutoAway().

A QTimer fires every 4 seconds and checks whether your mouse and keyboard have changed since last time, and whether X's idle time counter has gone down (cos if you're idle it should only go up).  If either have changed, setActive() is called, which resets an idle timer internal to kopete, and the new mouse posn and idle timer values are recorded.  As a special case, if the last recorded mouse X coord was -1 then we know that value was recorded by setAutoAway() and we skip the call to setActive().  This means we get an "activity amnesty" on mouse movement of at least 4 seconds after going autoaway.

Background over.  The debug I added prints out timestamped info what kopete thinks changed, and thus why it thinks I've returned.  For reasons I'm not entirely sure about, adding debug made the problem hard to reproduce, but eventually I saw the got some output that captured my premature return from being autoaway.  Debug I captured (interspersed with comments) was:

> Thu Dec  1 18:29:56 2005.18223: Setting auto away.  d->mouse_x=-1 and
> d->autoaway = true.
> d->mouse_x: -1, d->mouse_y: 250, d->mouse_mask: 0

That was logged by setAutoAway() when I hit Ctrl-Alt-L.  Note the mouse mask of 0, apparently meaning no buttons or modifiers pressed at the point XQueryPointer() grabbed its data.

> Thu Dec  1 18:29:56 2005.161298: Timer timed out.  Let's examine activity...
> By the way...your autoaway settings are:
>  you are currently considered autoaway
>  autoawaying is enabled, you've been idle for 19 and your away timeout is
> 600

Logged at the beginning of the QTimer callback just for completeness.

> Thu Dec  1 18:29:56 2005.161468: I've decided you're not idle any
> more...so I'm setting you active

Logged when we enter "if (root_x != d->mouse_x || ...)".  Note that the QTimer went off almost immediately after I went autoaway.

> Reason is:
>  you moved the mouse
>  last recorded (x,y,mask): -1, 250, 0
>  current (x,y,mask): 459, 250, 12
>  your current idle time of 261 is less than the last idle time I recorded
>  for you (2425) plus two seconds (4425)
    
It's no surprise that I've not been idle very long, because the QTimer fired very soon after I hit Ctrl-Alt-L.  It appears that I moved the mouse, but the -1 is that amnesty thingy I described above.  But the mask has changed - it was 0 at the last grab and is now 12 (0b1100).  The two set bits are from /usr/include/X11/X.h - ControlMask and Mod1Mask are now set.  That's Ctrl-Alt, which I've still not let go of.  The mask is only ever recorded inside the QTimer callback, so it looks like the previous grab was done before I hit Ctrl-Alt-L.

> Actually, false alarm - looks like you only just went auto-away.  Ignoring
> it this once.
> Recorded new idle time of 261
> Recorded mouse (x,y,mask) of: 459, 250, 12

Code detects the amnesty case, doesn't set me active, and records the mouse/idle for comparison on the next timer callback.

> Thu Dec  1 18:30:00 2005.159921: Timer timed out.  Let's examine
> activity...
> By the way...your autoaway settings are:
>  you are currently considered autoaway
>  autoawaying is enabled, you've been idle for 23 and your away timeout
>  is 600
> Thu Dec  1 18:30:00 2005.160114: I've decided you're not idle any more...so
> I'm setting you active
> Reason is:
>  you moved the mouse
>  last recorded (x,y,mask): 459, 250, 12
>  current (x,y,mask): 459, 250, 0
> calling setActivity()

The timer fires again.  By now I've let go of Ctrl-Alt, so the mask has changed, so kopete thinks I'm active again.

So I'm being too slow on letting go of Ctrl-Alt(-L) and kopete is detecting the eventual release as activity.  Comparing data grabbed 4s ago with data grabbed now is inviting trouble if the grabs can happen at any time in relation to setAutoAway().  We could add more amnesty by resetting the idle detection QTimer to zero when we call setAutoAway(), giving slow buggers like me 4s to let go of Ctrl-Alt.  *BUT* see bug 117513 - the real solution is to delegate activity detection after a screen lock to the screensaver itself.  Problem then is that it still breaks for people who use xscreensaver or other non-KDE screensavers that don't support the DCOP call.  Personally I think if we can support the KDE screensaver users without making things any worse for the non-KDE screensaver users, we should do it.  So see bug 117513 for my proposed fix.

One thing that I've not given thought to is why the Debian binaries allow me to reproduce this 100% of the time, yet binaries with debug dumping are quite hard to spot the bug in.
Comment 12 Isaac Wilcox 2006-01-29 18:48:02 UTC
I've added a patch to bug 117513 that might fix this:
  http://bugs.kde.org/attachment.cgi?id=14445&action=view
Comment 13 Dominik Karall 2006-02-03 13:34:05 UTC
Works for me in KDE 3.5.1!
thx!
Comment 14 Matt Rogers 2006-02-19 06:44:18 UTC
SVN commit 511207 by mattr:

Apply the patch from bug 117513 to fix several auto away issues with the code
that does this.

Patch by Issac Wilcox. Thanks so much for the patch!

BUG: 120989
BUG: 92949
BUG: 117513



 M  +3 -0      kopete/kopeteiface.cpp  
 M  +74 -15    libkopete/kopeteaway.cpp  
 M  +11 -3     libkopete/kopeteaway.h  


--- branches/kopete/0.12/kopete/kopete/kopeteiface.cpp #511206:511207
@@ -48,6 +48,9 @@
 		disconnectDCOPSignal("kdesktop", "KScreensaverIface",
 			"KDE_start_screensaver()", "setAutoAway()");
 	}
+	// FIXME: AFAICT, this never seems to fire.
+	connectDCOPSignal("kdesktop", "KScreensaverIface",
+		"KDE_stop_screensaver()", "setActive()", false);
 }
 
 QStringList KopeteIface::contacts()
--- branches/kopete/0.12/kopete/libkopete/kopeteaway.cpp #511206:511207
@@ -32,6 +32,7 @@
 #include <kconfig.h>
 #include <qtimer.h>
 #include <kapplication.h>
+#include <dcopref.h>
 
 #include <klocale.h>
 #include <kglobal.h>
@@ -122,10 +123,19 @@
 #ifdef Q_WS_X11
 	d->xIdleTime = 0;
 #endif
+	kdDebug(14010) << k_funcinfo << "Idle detection methods:" << endl;
+	kdDebug(14010) << k_funcinfo << "\tKScreensaverIface::isBlanked()" << endl;
+#ifdef Q_WS_X11
+	kdDebug(14010) << k_funcinfo << "\tX11 XQueryPointer()" << endl;
+#endif
 	if (d->useXidle)
-		kdDebug(14010) << "using X11 Xidle extension" << endl;
-	if(d->useMit)
-		kdDebug(14010) << "using X11 MIT Screensaver extension" << endl;
+	{
+		kdDebug(14010) << k_funcinfo << "\tX11 Xidle extension" << endl;
+	}
+	if (d->useMit)
+	{
+		kdDebug(14010) << k_funcinfo << "\tX11 MIT Screensaver extension" << endl;
+	}
 
 
 	load();
@@ -165,7 +175,7 @@
 	d->timer->start(4000);
 
 	//init the time and other
-	setActivity();
+	setActive();
 }
 
 Kopete::Away::~Away()
@@ -264,6 +274,42 @@
 
 void Kopete::Away::slotTimerTimeout()
 {
+	// Time to check whether we're active or autoaway.  We basically have two
+	// bits of info to go on - KDE's screensaver status
+	// (KScreenSaverIface::isBlanked()) and the X11 activity detection.
+	//
+	// Note that isBlanked() is a slight of a misnomer.  It returns true if we're:
+	//  - using a non-locking screensaver, which is running, or
+	//  - using a locking screensaver which is still locked, regardless of
+	//    whether the user is trying to unlock it right now
+	// Either way, it's only worth checking for activity if the screensaver
+	// isn't blanked/locked, because activity while blanked is impossible and
+	// activity while locked never matters (if there is any, it's probably just
+	// the cleaner wiping the keyboard :).
+
+	DCOPRef screenSaver("kdesktop", "KScreensaverIface");
+	DCOPReply isBlanked = screenSaver.call("isBlanked");
+	if (!(isBlanked.isValid() && isBlanked.type == "bool" && ((bool)isBlanked)))
+	{
+		// DCOP failed, or returned something odd, or the screensaver is
+		// inactive, so check for activity the X11 way.  It's only worth
+		// checking for autoaway if there's no activity, and because
+		// Screensaver blanking/locking implies autoAway activation (see
+		// KopeteIface::KopeteIface()), only worth checking autoAway when the
+		// screensaver isn't running.
+		if (isActivity())
+		{
+			setActive();
+		}
+		else if (!d->autoaway && d->useAutoAway && idleTime() > d->awayTimeout)
+		{
+			setAutoAway();
+		}
+	}
+}
+
+bool Kopete::Away::isActivity()
+{
 	// Copyright (c) 1999 Martin R. Jones <mjones@kde.org>
 	//
 	// KDE screensaver engine
@@ -271,6 +317,8 @@
 	// This module is a heavily modified xautolock.
 	// In fact as of KDE 2.0 this code is practically unrecognisable as xautolock.
 
+	bool activity = false;
+
 #ifdef Q_WS_X11
 	Display *dsp = qt_xdisplay();
 	Window           dummy_w;
@@ -305,9 +353,9 @@
 			}
 		}
 	}
-#endif
+
 	// =================================================================================
-#ifdef Q_WS_X11
+
 	Time xIdleTime = 0; // millisecs since last input event
 
 	#ifdef HasXidle
@@ -332,10 +380,19 @@
 
 	// =================================================================================
 
-	if (root_x != d->mouse_x || root_y != d->mouse_y || mask != d->mouse_mask || xIdleTime < d->xIdleTime+2000)
+	// Only check idle time if we have some way of measuring it, otherwise if
+	// we've neither Mit nor Xidle it'll still be zero and we'll always appear active.
+	// FIXME: what problem does the 2000ms fudge solve?
+	if (root_x != d->mouse_x || root_y != d->mouse_y || mask != d->mouse_mask
+		|| ((d->useXidle || d->useMit) && xIdleTime < d->xIdleTime + 2000))
 	{
-		if(d->mouse_x!=-1) //we just gone autoaway, not activity this time
-			setActivity();
+		// -1 => just gone autoaway, ignore apparent activity this time round
+		// anything else => genuine activity
+		// See setAutoAway().
+		if (d->mouse_x != -1)
+		{
+			activity = true;
+		}
 		d->mouse_x = root_x;
 		d->mouse_y = root_y;
 		d->mouse_mask = mask;
@@ -344,13 +401,10 @@
 #endif // Q_WS_X11
 	// =================================================================================
 
-	if(!d->autoaway && d->useAutoAway && idleTime() > d->awayTimeout)
-	{
-		setAutoAway();
-	}
+	return activity;
 }
 
-void Kopete::Away::setActivity()
+void Kopete::Away::setActive()
 {
 //	kdDebug(14010) << k_funcinfo << "Found activity on desktop, resetting away timer" << endl;
 	d->idleTime.start();
@@ -381,7 +435,12 @@
 
 void Kopete::Away::setAutoAway()
 {
-	d->mouse_x=-1; //do not go availiable automaticaly after
+	// A value of -1 in mouse_x indicates to checkActivity() that next time it
+	// fires it should ignore any apparent idle/mouse/keyboard changes.
+	// I think the point of this is that if you manually start the screensaver
+	// then there'll unavoidably be some residual mouse/keyboard activity
+	// that should be ignored.
+	d->mouse_x = -1;
 
 //	kdDebug(14010) << k_funcinfo << "Going AutoAway!" << endl;
 	d->autoaway = true;
--- branches/kopete/0.12/kopete/libkopete/kopeteaway.h #511206:511207
@@ -139,6 +139,14 @@
 	 */
 	void save();
 
+	/**
+	 * @brief Check for activity using X11 methods
+	 * @return true if activity was detected, otherwise false
+	 *
+	 * Attempt to detect activity using a variety of X11 methods.
+	 */
+	bool isActivity();
+
 	//Away( const Away &rhs );
 	//Away &operator=( const Away &rhs );
 	static Away *instance;
@@ -150,14 +158,14 @@
 
 public slots:
 	/**
-	 * @brief Set the activity
+	 * @brief Mark the user active
 	 *
-	 * Plugins can set the activity if they discover activity by another way than the mouse or the keyboard
+	 * Plugins can mark the user active if they discover activity by another way than the mouse or the keyboard
 	 * (example, the motion auto away plugin)
 	 * this will reset the @ref idleTime to 0, and set all protocols to available (online) if the state was
 	 * set automatically to away because of idleness, and if they was previously online
 	 */
-	void setActivity();
+	void setActive();
 
 	/**
 	 * Use this method if you want to go in the autoaway mode.
Comment 15 Matt Rogers 2006-02-19 16:36:37 UTC
SVN commit 511336 by mattr:

backport patches for bugs 120989, 92949, and 117513
Should be in KDE 3.5.2 and the upcoming 0.12 release.

CCBUG: 120989, 92949, 117513



 M  +3 -0      kopete/kopeteiface.cpp  
 M  +74 -15    libkopete/kopeteaway.cpp  
 M  +11 -3     libkopete/kopeteaway.h  


--- branches/KDE/3.5/kdenetwork/kopete/kopete/kopeteiface.cpp #511335:511336
@@ -48,6 +48,9 @@
 		disconnectDCOPSignal("kdesktop", "KScreensaverIface",
 			"KDE_start_screensaver()", "setAutoAway()");
 	}
+	// FIXME: AFAICT, this never seems to fire.
+	connectDCOPSignal("kdesktop", "KScreensaverIface",
+		"KDE_stop_screensaver()", "setActive()", false);
 }
 
 QStringList KopeteIface::contacts()
--- branches/KDE/3.5/kdenetwork/kopete/libkopete/kopeteaway.cpp #511335:511336
@@ -32,6 +32,7 @@
 #include <kconfig.h>
 #include <qtimer.h>
 #include <kapplication.h>
+#include <dcopref.h>
 
 #include <klocale.h>
 #include <kglobal.h>
@@ -122,10 +123,19 @@
 #ifdef Q_WS_X11
 	d->xIdleTime = 0;
 #endif
+	kdDebug(14010) << k_funcinfo << "Idle detection methods:" << endl;
+	kdDebug(14010) << k_funcinfo << "\tKScreensaverIface::isBlanked()" << endl;
+#ifdef Q_WS_X11
+	kdDebug(14010) << k_funcinfo << "\tX11 XQueryPointer()" << endl;
+#endif
 	if (d->useXidle)
-		kdDebug(14010) << "using X11 Xidle extension" << endl;
-	if(d->useMit)
-		kdDebug(14010) << "using X11 MIT Screensaver extension" << endl;
+	{
+		kdDebug(14010) << k_funcinfo << "\tX11 Xidle extension" << endl;
+	}
+	if (d->useMit)
+	{
+		kdDebug(14010) << k_funcinfo << "\tX11 MIT Screensaver extension" << endl;
+	}
 
 
 	load();
@@ -165,7 +175,7 @@
 	d->timer->start(4000);
 
 	//init the time and other
-	setActivity();
+	setActive();
 }
 
 Kopete::Away::~Away()
@@ -264,6 +274,42 @@
 
 void Kopete::Away::slotTimerTimeout()
 {
+	// Time to check whether we're active or autoaway.  We basically have two
+	// bits of info to go on - KDE's screensaver status
+	// (KScreenSaverIface::isBlanked()) and the X11 activity detection.
+	//
+	// Note that isBlanked() is a slight of a misnomer.  It returns true if we're:
+	//  - using a non-locking screensaver, which is running, or
+	//  - using a locking screensaver which is still locked, regardless of
+	//    whether the user is trying to unlock it right now
+	// Either way, it's only worth checking for activity if the screensaver
+	// isn't blanked/locked, because activity while blanked is impossible and
+	// activity while locked never matters (if there is any, it's probably just
+	// the cleaner wiping the keyboard :).
+
+	DCOPRef screenSaver("kdesktop", "KScreensaverIface");
+	DCOPReply isBlanked = screenSaver.call("isBlanked");
+	if (!(isBlanked.isValid() && isBlanked.type == "bool" && ((bool)isBlanked)))
+	{
+		// DCOP failed, or returned something odd, or the screensaver is
+		// inactive, so check for activity the X11 way.  It's only worth
+		// checking for autoaway if there's no activity, and because
+		// Screensaver blanking/locking implies autoAway activation (see
+		// KopeteIface::KopeteIface()), only worth checking autoAway when the
+		// screensaver isn't running.
+		if (isActivity())
+		{
+			setActive();
+		}
+		else if (!d->autoaway && d->useAutoAway && idleTime() > d->awayTimeout)
+		{
+			setAutoAway();
+		}
+	}
+}
+
+bool Kopete::Away::isActivity()
+{
 	// Copyright (c) 1999 Martin R. Jones <mjones@kde.org>
 	//
 	// KDE screensaver engine
@@ -271,6 +317,8 @@
 	// This module is a heavily modified xautolock.
 	// In fact as of KDE 2.0 this code is practically unrecognisable as xautolock.
 
+	bool activity = false;
+
 #ifdef Q_WS_X11
 	Display *dsp = qt_xdisplay();
 	Window           dummy_w;
@@ -305,9 +353,9 @@
 			}
 		}
 	}
-#endif
+
 	// =================================================================================
-#ifdef Q_WS_X11
+
 	Time xIdleTime = 0; // millisecs since last input event
 
 	#ifdef HasXidle
@@ -332,10 +380,19 @@
 
 	// =================================================================================
 
-	if (root_x != d->mouse_x || root_y != d->mouse_y || mask != d->mouse_mask || xIdleTime < d->xIdleTime+2000)
+	// Only check idle time if we have some way of measuring it, otherwise if
+	// we've neither Mit nor Xidle it'll still be zero and we'll always appear active.
+	// FIXME: what problem does the 2000ms fudge solve?
+	if (root_x != d->mouse_x || root_y != d->mouse_y || mask != d->mouse_mask
+		|| ((d->useXidle || d->useMit) && xIdleTime < d->xIdleTime + 2000))
 	{
-		if(d->mouse_x!=-1) //we just gone autoaway, not activity this time
-			setActivity();
+		// -1 => just gone autoaway, ignore apparent activity this time round
+		// anything else => genuine activity
+		// See setAutoAway().
+		if (d->mouse_x != -1)
+		{
+			activity = true;
+		}
 		d->mouse_x = root_x;
 		d->mouse_y = root_y;
 		d->mouse_mask = mask;
@@ -344,13 +401,10 @@
 #endif // Q_WS_X11
 	// =================================================================================
 
-	if(!d->autoaway && d->useAutoAway && idleTime() > d->awayTimeout)
-	{
-		setAutoAway();
-	}
+	return activity;
 }
 
-void Kopete::Away::setActivity()
+void Kopete::Away::setActive()
 {
 //	kdDebug(14010) << k_funcinfo << "Found activity on desktop, resetting away timer" << endl;
 	d->idleTime.start();
@@ -381,7 +435,12 @@
 
 void Kopete::Away::setAutoAway()
 {
-	d->mouse_x=-1; //do not go availiable automaticaly after
+	// A value of -1 in mouse_x indicates to checkActivity() that next time it
+	// fires it should ignore any apparent idle/mouse/keyboard changes.
+	// I think the point of this is that if you manually start the screensaver
+	// then there'll unavoidably be some residual mouse/keyboard activity
+	// that should be ignored.
+	d->mouse_x = -1;
 
 //	kdDebug(14010) << k_funcinfo << "Going AutoAway!" << endl;
 	d->autoaway = true;
--- branches/KDE/3.5/kdenetwork/kopete/libkopete/kopeteaway.h #511335:511336
@@ -139,6 +139,14 @@
 	 */
 	void save();
 
+	/**
+	 * @brief Check for activity using X11 methods
+	 * @return true if activity was detected, otherwise false
+	 *
+	 * Attempt to detect activity using a variety of X11 methods.
+	 */
+	bool isActivity();
+
 	//Away( const Away &rhs );
 	//Away &operator=( const Away &rhs );
 	static Away *instance;
@@ -150,14 +158,14 @@
 
 public slots:
 	/**
-	 * @brief Set the activity
+	 * @brief Mark the user active
 	 *
-	 * Plugins can set the activity if they discover activity by another way than the mouse or the keyboard
+	 * Plugins can mark the user active if they discover activity by another way than the mouse or the keyboard
 	 * (example, the motion auto away plugin)
 	 * this will reset the @ref idleTime to 0, and set all protocols to available (online) if the state was
 	 * set automatically to away because of idleness, and if they was previously online
 	 */
-	void setActivity();
+	void setActive();
 
 	/**
 	 * Use this method if you want to go in the autoaway mode.