GNOME Bugzilla – Bug 613603
[patch]Empathy should allow users to toggle auto-away mode on/off
Last modified: 2010-10-10 18:02:42 UTC
"Empathy sets the users status to away if the user is idle for some time. This feature is currently not controllable. This patch will add an option to the preferences menu that will allow the user to toggle this auto-away behavior on or off (default stays on)." originally reported at: https://bugs.launchpad.net/ubuntu/+source/empathy/+bug/544242
Created attachment 156760 [details] [review] patch from the reporter himself (Christian Kampka )
Review of attachment 156760 [details] [review]: Thanks for your patch. I'm not convinced it's that useful tbh, especially now that we fixed bug #566832. What's your use case for this? Anyway, I reviewed your patch for you information. ::: src/empathy-preferences.c @@ +229,3 @@ preferences->checkbutton_autoconnect); + preferences_hookup_autoaway_button (preferences, You should just use preferences_hookup_toggle_button. @@ +827,3 @@ + gpointer user_data) +{ + empathy_idle_set_auto_away (empathy_idle_dup_singleton (), This is wrong. empathy-preferences just get/set gconf key. Other component should deal with configuration changes. ::: src/empathy.c @@ +657,3 @@ + empathy_conf_get_bool (empathy_conf_get (), + EMPATHY_PREFS_AUTOAWAY, &autoaway); + You should add here a hook to call set_auto_away when the gconf key is changed.
This has little to do with #566832. The patch adds an option to disable/enable auto away mode altogether. My use case for this is like this: Currently, empathy goes into away mode after about five minutes of idle time. Once that happens, the jabber server recognizes this and tries to redirect my messages to other resources which are eg. not away / have a lower priority (I think about adding this functionality to empathy client sided if it's something worth of having some day). This can lead to undesired results. As a matter of fact it can be simply wrong to go into away mode because couple of minutes inactivity doesn't really imply that I'm not at my desk. I think it should be up to the user whether empathy should auto idle or not. That said, I have reworked the patch, hopefully to your linking.
Created attachment 157450 [details] [review] reworked patch to make auto away mode optional
Review of attachment 157450 [details] [review]: ::: libempathy/empathy-idle.h @@ +63,3 @@ void empathy_idle_set_auto_away (EmpathyIdle *idle, gboolean auto_away); +void empathy_idle_set_auto_away_cb (EmpathyConf *conf, Callback should be in empathy.c. It doesn't make sense to expose callbacks publicly. ::: src/empathy-preferences.ui @@ +133,3 @@ </child> + <child> + <object class="GtkCheckButton" id="checkbutton_autoaway"> I won't add an option to the UI for this. We could *maybe* add UI in the future gnome-secret tool but for now user who cares about this should change the gconf key manually using gconf-editor.
Created attachment 157453 [details] [review] Patch v2 reworked I removed the UI components and moved the callback to empathy.c
Review of attachment 157453 [details] [review]: ::: src/empathy.c @@ +558,3 @@ + empathy_conf_get_bool (conf, key, &autoaway); + + empathy_idle_set_auto_away(empathy_idle_dup_singleton (), EmpathyIdle is leaked here. @@ +661,3 @@ + EMPATHY_PREFS_AUTOAWAY, + empathy_idle_set_auto_away_cb, + NULL); You could pass the "idle" object as user_data here so you wouldn't have to use idle_dup_singleton in the callback.
Created attachment 157473 [details] [review] fixed leaking EmpathyIdle
Merged; thanks! This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Personally, I vote for a GUI element for less knowledgeable users, but a configuration setting works for those of us who know how to use the command line and/or settings editors. That said, I just dist-upgraded from Ubuntu 10.04 to 10.10 and discovered that Empathy has converted to GSettings and its associated DConf, rather than GConf, so gconf-editor won't be able to manipulate this setting. A new tool, dconf-editor, can be used to manipulate settings for the (currently small number of) apps that have converted to GSettings. On Ubuntu 10.10, this tool was not installed by default, but was available via the dconf-tools package, but of course, this depends on your distribution.