;;; erc-autoaway.el --- Provides autoaway for ERC
-;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Jorgen Schaefer <forcer@forcix.cx>
;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; A test for (erc-server-process-alive) is not necessary, because
;; this function is called from `erc-timer-hook', which is called
;; whenever the server sends something to the client.
- (when (and erc-auto-set-away
+ (when (and erc-server-connected
+ erc-auto-set-away
(not erc-autoaway-caused-away)
(erc-autoaway-some-open-server-buffer))
(let ((idle-time (erc-time-diff erc-autoaway-last-sent-time