=== modified file 'data/empathy.schemas.in'
--- data/empathy.schemas.in	2010-03-12 16:47:09 +0000
+++ data/empathy.schemas.in	2010-03-22 15:17:15 +0000
@@ -522,6 +522,20 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/empathy/autoaway</key>
+      <applyto>/apps/empathy/autoaway</applyto>
+      <owner>empathy</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>Empathy should auto-away when idle</short>
+        <long>
+        Whether Empathy should go into away mode automatically if user is idle.
+        </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/empathy/import_asked</key>
       <applyto>/apps/empathy/import_asked</applyto>
       <owner>empathy</owner>

=== modified file 'libempathy-gtk/empathy-conf.h'
--- libempathy-gtk/empathy-conf.h	2010-03-12 16:47:09 +0000
+++ libempathy-gtk/empathy-conf.h	2010-03-22 15:17:15 +0000
@@ -81,6 +81,7 @@
 #define EMPATHY_PREFS_HINTS_CLOSE_MAIN_WINDOW      EMPATHY_PREFS_PATH "/hints/close_main_window"
 #define EMPATHY_PREFS_USE_CONN                     EMPATHY_PREFS_PATH "/use_conn"
 #define EMPATHY_PREFS_AUTOCONNECT                  EMPATHY_PREFS_PATH "/autoconnect"
+#define EMPATHY_PREFS_AUTOAWAY                     EMPATHY_PREFS_PATH "/autoaway"
 #define EMPATHY_PREFS_IMPORT_ASKED                 EMPATHY_PREFS_PATH "/import_asked"
 #define EMPATHY_PREFS_BUTTERFLY_LOGS_MIGRATED      EMPATHY_PREFS_PATH "/butterfly_logs_migrated"
 #define EMPATHY_PREFS_FILE_TRANSFER_DEFAULT_FOLDER EMPATHY_PREFS_PATH "/file_transfer/default_folder"

=== modified file 'src/empathy-preferences.c'
--- src/empathy-preferences.c	2009-10-20 15:01:11 +0000
+++ src/empathy-preferences.c	2010-03-22 15:17:15 +0000
@@ -56,6 +56,7 @@
 	GtkWidget *combobox_chat_theme;
 	GtkWidget *checkbutton_separate_chat_windows;
 	GtkWidget *checkbutton_autoconnect;
+	GtkWidget *checkbutton_autoaway;
 
 	GtkWidget *checkbutton_sounds_enabled;
 	GtkWidget *checkbutton_sounds_disabled_away;
@@ -115,7 +116,11 @@
 static void     preferences_response_cb                  (GtkWidget              *widget,
 							  gint                    response,
 							  EmpathyPreferences      *preferences);
-
+static void     preferences_hookup_autoaway_button       (EmpathyPreferences      *preferences,
+							  const gchar            *key,
+							  GtkWidget              *widget);
+static void     preferences_autoaway_button_cb           (GtkWidget              *button,
+							  gpointer                user_data);
 enum {
 	COL_LANG_ENABLED,
 	COL_LANG_CODE,
@@ -223,6 +228,10 @@
 					  EMPATHY_PREFS_AUTOCONNECT,
 					  preferences->checkbutton_autoconnect);
 
+	preferences_hookup_autoaway_button (preferences,
+					    EMPATHY_PREFS_AUTOAWAY,
+					    preferences->checkbutton_autoaway);
+
 	preferences_hookup_toggle_button (preferences,
 					  EMPATHY_PREFS_LOCATION_PUBLISH,
 					  preferences->checkbutton_location_publish);
@@ -798,6 +807,29 @@
 	}
 }
 
+static void
+preferences_hookup_autoaway_button (EmpathyPreferences *preferences,
+				    const gchar       *key,
+				    GtkWidget         *widget)
+{
+
+	g_signal_connect (widget,
+			  "toggled",
+			  G_CALLBACK (preferences_autoaway_button_cb),
+			  NULL);
+
+	preferences_hookup_toggle_button(preferences, key, widget);
+
+}
+
+static void
+preferences_autoaway_button_cb (GtkWidget *button,
+			 gpointer user_data)
+{
+	empathy_idle_set_auto_away (empathy_idle_dup_singleton (),
+					gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)));	
+}
+
 #if 0
 static void
 preferences_hookup_radio_button (EmpathyPreferences *preferences,
@@ -1140,6 +1172,7 @@
 		"combobox_chat_theme", &preferences->combobox_chat_theme,
 		"checkbutton_separate_chat_windows", &preferences->checkbutton_separate_chat_windows,
 		"checkbutton_autoconnect", &preferences->checkbutton_autoconnect,
+		"checkbutton_autoaway", &preferences->checkbutton_autoaway,
 		"checkbutton_notifications_enabled", &preferences->checkbutton_notifications_enabled,
 		"checkbutton_notifications_disabled_away", &preferences->checkbutton_notifications_disabled_away,
 		"checkbutton_notifications_focus", &preferences->checkbutton_notifications_focus,

=== modified file 'src/empathy-preferences.ui'
--- src/empathy-preferences.ui	2010-01-01 15:06:58 +0000
+++ src/empathy-preferences.ui	2010-03-22 15:17:15 +0000
@@ -131,6 +131,20 @@
                                 <property name="position">1</property>
                               </packing>
                             </child>
+                            <child>
+                              <object class="GtkCheckButton" id="checkbutton_autoaway">
+                                <property name="label" translatable="yes">Change status when idle</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="use_underline">True</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                              </object>
+                              <packing>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
                           </object>
                         </child>
                       </object>

=== modified file 'src/empathy.c'
--- src/empathy.c	2010-03-04 17:09:07 +0000
+++ src/empathy.c	2010-03-22 15:17:15 +0000
@@ -584,7 +584,7 @@
   GError *error = NULL;
   UniqueApp *unique_app;
   gboolean chatroom_manager_ready;
-
+  gboolean autoaway = TRUE;
 #ifdef ENABLE_DEBUG
   TpDebugSender *debug_sender;
 #endif /* ENABLE_TPL */
@@ -653,7 +653,11 @@
 
   /* Setting up Idle */
   idle = empathy_idle_dup_singleton ();
-  empathy_idle_set_auto_away (idle, TRUE);
+
+  empathy_conf_get_bool (empathy_conf_get (),
+      EMPATHY_PREFS_AUTOAWAY, &autoaway);
+
+  empathy_idle_set_auto_away (idle, autoaway);
 
   /* Setting up Connectivity */
   connectivity = empathy_connectivity_dup_singleton ();

