From 0969df7ce116eda5bad2924ee01172b19a6e1b49 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 13 Nov 2006 17:52:08 +0000 Subject: [PATCH] store annotation on server only if it has changed --- src/vcard.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vcard.py b/src/vcard.py index fc8eabbf3..75b1cddc9 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -95,9 +95,12 @@ class VcardWindow: gobject.source_remove(self.update_progressbar_timeout_id) del gajim.interface.instances[self.account]['infos'][self.contact.jid] buffer = self.xml.get_widget('textview_annotation').get_buffer() - gajim.connections[self.account].annotations[self.contact.jid] = \ - buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter()) - gajim.connections[self.account].store_annotations() + annotation = buffer.get_text(buffer.get_start_iter(), + buffer.get_end_iter()) + connection = gajim.connections[self.account] + if annotation != connection.annotations[self.contact.jid]: + connection.annotations[self.contact.jid] = annotation + connection.store_annotations() def on_vcard_information_window_key_press_event(self, widget, event):