After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 613603 - [patch]Empathy should allow users to toggle auto-away mode on/off
[patch]Empathy should allow users to toggle auto-away mode on/off
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
2.29.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2010-03-22 15:48 UTC by Omer Akram
Modified: 2010-10-10 18:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch from the reporter himself (Christian Kampka ) (6.16 KB, patch)
2010-03-22 15:49 UTC, Omer Akram
reviewed Details | Review
reworked patch to make auto away mode optional (6.33 KB, patch)
2010-03-30 07:57 UTC, Christian Kampka
reviewed Details | Review
Patch v2 reworked (2.77 KB, patch)
2010-03-30 09:39 UTC, Christian Kampka
reviewed Details | Review
fixed leaking EmpathyIdle (2.77 KB, patch)
2010-03-30 12:09 UTC, Christian Kampka
none Details | Review

Description Omer Akram 2010-03-22 15:48:53 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
Comment 1 Omer Akram 2010-03-22 15:49:57 UTC
Created attachment 156760 [details] [review]
patch from the reporter himself (Christian Kampka )
Comment 2 Guillaume Desmottes 2010-03-23 08:22:23 UTC
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.
Comment 3 Christian Kampka 2010-03-30 07:56:47 UTC
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.
Comment 4 Christian Kampka 2010-03-30 07:57:26 UTC
Created attachment 157450 [details] [review]
reworked patch to make auto away mode optional
Comment 5 Guillaume Desmottes 2010-03-30 08:50:47 UTC
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.
Comment 6 Christian Kampka 2010-03-30 09:39:16 UTC
Created attachment 157453 [details] [review]
Patch v2 reworked

I removed the UI components and moved the callback to empathy.c
Comment 7 Guillaume Desmottes 2010-03-30 09:49:06 UTC
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.
Comment 8 Christian Kampka 2010-03-30 12:09:11 UTC
Created attachment 157473 [details] [review]
fixed leaking EmpathyIdle
Comment 9 Guillaume Desmottes 2010-03-30 12:24:24 UTC
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.
Comment 10 rlange 2010-10-10 18:02:42 UTC
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.