# HG changeset patch # User Mikael Berthe # Date 1163615020 -3600 # Node ID 41f9a2a4c1de0548cf15aacde7bee59f7b331f50 # Parent 4d3c488447466cadb1722db91cd84c7e9af7c743 Only update server private storage data if they've changed We do not want to call send_storage_bookmarks() and send_storage_rosternotes() when the data haven't been updated. diff -r 4d3c48844746 -r 41f9a2a4c1de mcabber/src/jabglue.c --- a/mcabber/src/jabglue.c Wed Nov 15 00:04:57 2006 +0100 +++ b/mcabber/src/jabglue.c Wed Nov 15 19:23:40 2006 +0100 @@ -1182,6 +1182,7 @@ const char *nick, const char *passwd, int autojoin) { xmlnode x; + bool changed = FALSE; if (!roomid) return; @@ -1208,6 +1209,7 @@ // We've found a bookmark for this room. Let's hide it and we'll // create a new one. xmlnode_hide(x); + changed = TRUE; break; } } @@ -1223,8 +1225,12 @@ xmlnode_insert_cdata(xmlnode_insert_tag(x, "nick"), nick, -1); if (passwd) xmlnode_insert_cdata(xmlnode_insert_tag(x, "password"), passwd, -1); + changed = TRUE; } + if (!changed) + return; + if (online) send_storage_bookmarks(); else @@ -1275,6 +1281,7 @@ void jb_set_storage_rosternotes(const char *barejid, const char *note) { xmlnode x; + bool changed = FALSE; if (!barejid) return; @@ -1301,6 +1308,7 @@ // We've found a note for this jid. Let's hide it and we'll // create a new one. xmlnode_hide(x); + changed = TRUE; break; } } @@ -1311,8 +1319,12 @@ x = xmlnode_insert_tag(rosternotes, "note"); xmlnode_put_attrib(x, "jid", barejid); xmlnode_insert_cdata(x, note, -1); + changed = TRUE; } + if (!changed) + return; + if (online) send_storage_rosternotes(); else