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 594145 - should enable accounts after import
should enable accounts after import
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Accounts
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
: 627659 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-09-04 14:55 UTC by Sebastien Bacher
Modified: 2010-11-08 09:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (4.57 KB, patch)
2010-10-06 14:56 UTC, Vitaly Minko
reviewed Details | Review
updated patch (5.14 KB, patch)
2010-10-11 13:14 UTC, Vitaly Minko
committed Details | Review

Description Sebastien Bacher 2009-09-04 14:55:15 UTC
Using empathy 2.27.91, the account imported from pidgin are not automatically enabled which is confusing, could the import enable accounts too?
Comment 1 Guillaume Desmottes 2009-09-08 13:16:03 UTC
The importer is supposed to enable accounts that were enabled in Pidgin. Were these accounts enabled in Pidgin when you imported them?
Comment 2 Cosimo Cecchi 2009-09-08 13:27:45 UTC
No, we don't have code for fetching that setting from Pidgin, confirming the bug.
Comment 3 Sebastien Bacher 2009-09-08 13:46:22 UTC
the accounts are enabled in pidgin yes
Comment 4 Vitaly Minko 2010-10-06 14:56:19 UTC
Created attachment 171829 [details] [review]
proposed fix
Comment 5 Guillaume Desmottes 2010-10-07 13:17:31 UTC
Review of attachment 171829 [details] [review]:

Thanks a lot for your patch. I inlined some comments.
You should really learn to use git, it would make your life much easier. :)

::: empathy-2.32.0.1/src/empathy-import-pidgin.c
@@ +95,3 @@
 #define PIDGIN_ACCOUNT_TAG_SETTINGS "settings"
+#define PIDGIN_SETTING_PROP_UI "ui"
+#define PIDGIN_SETTING_PROP_NAME "name"

What are these settings exactly?

@@ +195,3 @@
+  tag_ui = (gchar *) xmlGetProp (settings, (xmlChar *) PIDGIN_SETTING_PROP_UI);
+
+  if (tag_ui && !tp_strdiff (tag_ui, "gtk-gaim"))

why gtk-gaim?

@@ +203,3 @@
+          type = (gchar *) xmlGetProp (setting,
+              (xmlChar *) PIDGIN_SETTING_PROP_TYPE);
+          if (!tp_strdiff (name, "auto-login") && !tp_strdiff (type, "bool"))

Please add some comments explaining the logic.
Comment 6 Vitaly Minko 2010-10-11 13:14:54 UTC
Created attachment 172096 [details] [review]
updated patch
Comment 7 Vitaly Minko 2010-10-11 13:15:23 UTC
>What are these settings exactly?

Pidgin stores the required parameter separately from the general settings:
        <settings>
            <setting name='check-mail' type='bool'>0</setting>
            <setting name='buddy_icon_timestamp' type='int'>0</setting>
            etc ...
        </settings>
        <settings ui='gtk-gaim'>
            <setting name='auto-login' type='bool'>1</setting>
        </settings>
PIDGIN_SETTING_PROP_UI is the name of the property indicating that this tag is UI settings.
PIDGIN_SETTING_PROP_NAME is the name of the 'name' property of the 'setting' tag. BTW, there was a minor issue in the original code where this value was mixed up with the name of the 'name' tag, which is not the same thing.

>why gtk-gaim?
No idea why, but this value is still valid for the latest version (2.7.3).

>Please add some comments explaining the logic.
I've updated the patch.
Comment 8 Guillaume Desmottes 2010-10-11 13:54:01 UTC
Looks great, I merged your patch to master. Thanks a lot!

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 9 Guillaume Desmottes 2010-11-08 09:32:17 UTC
*** Bug 627659 has been marked as a duplicate of this bug. ***