Index: src/core/log-away.c
===================================================================
--- src/core/log-away.c	(revision 4057)
+++ src/core/log-away.c	(working copy)
@@ -90,7 +90,7 @@
 
 static void sig_away_changed(SERVER_REC *server)
 {
-	if (server->usermode_away)
+	if (server->usermode_away && server->awaylog)
 		awaylog_open();
 	else
                 awaylog_close();
Index: src/core/server-rec.h
===================================================================
--- src/core/server-rec.h	(revision 4057)
+++ src/core/server-rec.h	(working copy)
@@ -35,6 +35,7 @@
 char *last_invite; /* channel where you were last invited */
 unsigned int server_operator:1;
 unsigned int usermode_away:1;
+unsigned int awaylog:1; /* log messages while away */
 unsigned int banned:1; /* not allowed to connect to this server */
 unsigned int dns_error:1; /* DNS said the host doesn't exist */
 
Index: src/core/server-connect-rec.h
===================================================================
--- src/core/server-connect-rec.h	(revision 4057)
+++ src/core/server-connect-rec.h	(working copy)
@@ -40,3 +40,4 @@
 unsigned int no_connect:1; /* don't connect() at all, it's done by plugin */
 char *channels;
 char *away_reason;
+unsigned int awaylog;
Index: src/core/chat-commands.c
===================================================================
--- src/core/chat-commands.c	(revision 4057)
+++ src/core/chat-commands.c	(working copy)
@@ -211,6 +211,7 @@
 		server_reconnect_destroy(recon);
 
 		conn->away_reason = g_strdup(oldconn->away_reason);
+		conn->awaylog = oldconn->awaylog;
 		conn->channels = g_strdup(oldconn->channels);
 	}
 
Index: src/irc/core/irc-commands.c
===================================================================
--- src/irc/core/irc-commands.c	(revision 4057)
+++ src/irc/core/irc-commands.c	(working copy)
@@ -540,7 +540,7 @@
 	}
 }
 
-/* SYNTAX: AWAY [-one | -all] [<reason>] */
+/* SYNTAX: AWAY [-one | -all] [-nolog | -log] [<reason>] */
 static void cmd_away(const char *data, IRC_SERVER_REC *server)
 {
 	GHashTable *optlist;
@@ -552,6 +552,23 @@
 	if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
 			    PARAM_FLAG_GETREST, "away", &optlist, &reason)) return;
 
+	
+	if (g_hash_table_lookup(optlist, "nolog") != NULL && 
+			g_hash_table_lookup(optlist, "log") != NULL) {
+		/* TODO: 
+		 * print an error message 
+		 * I can't find any way to do this, so if you got an idea,
+		 * please insert it here ;-)
+		 * 
+		 */
+		return;
+	}
+
+	if (g_hash_table_lookup(optlist, "nolog") != NULL)
+		  server->awaylog = 0;
+	if (g_hash_table_lookup(optlist, "log") != NULL)
+		  server->awaylog = 1;
+
 	if (g_hash_table_lookup(optlist, "one") != NULL)
 		server_send_away(server, reason);
 	else
@@ -1073,7 +1090,7 @@
 	command_set_options("connect", "+ircnet");
 	command_set_options("topic", "delete");
 	command_set_options("list", "yes");
-	command_set_options("away", "one all");
+	command_set_options("away", "one all log nolog");
 	command_set_options("whois", "yes");
 }

