telepathy-gabble: vcard-manager: fix is_significant()

Will Thompson wjt at kemper.freedesktop.org
Thu Dec 6 09:37:24 PST 2012


Module: telepathy-gabble
Branch: master
Commit: f7baa0f159e36f0f859fecca4e2af726ac1a6553
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=f7baa0f159e36f0f859fecca4e2af726ac1a6553

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Mon Nov 26 17:08:29 2012 +0000

vcard-manager: fix is_significant()

gabble_vcard_manager_replace_is_significant() is meant to check whether
we're actually changing a value, but in fact it basically always claimed
we're not, because it forgot to make a note of whether it's seen the
relevant element.

By fixing this, we can remove a redundant check at the end of
gabble_vcard_manager_edit_info_apply().

---

 src/vcard-manager.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/vcard-manager.c b/src/vcard-manager.c
index e851212..31f86ed 100644
--- a/src/vcard-manager.c
+++ b/src/vcard-manager.c
@@ -992,6 +992,8 @@ gabble_vcard_manager_replace_is_significant (GabbleVCardManagerEditInfo *info,
       if (seen)
         return TRUE;
 
+      seen = TRUE;
+
       /* consider NULL and "" to be different representations for the
        * same thing */
       value = node->content;
@@ -1197,7 +1199,7 @@ gabble_vcard_manager_edit_info_apply (GabbleVCardManagerEditInfo *info,
         }
     }
 
-  if ((!maybe_changed) || wocky_node_equal (old_vcard, vcard_node))
+  if (!maybe_changed)
     {
       /* nothing actually happened, forget it */
       g_object_unref (msg);



More information about the telepathy-commits mailing list