From 34542c57b775e41cbd8f835850f818f72f8e7ebe Mon Sep 17 00:00:00 2001 From: daleharvey Date: Mon, 4 Sep 2006 20:43:47 +0000 Subject: [PATCH] work on whiteboard --- src/jabber_whiteboard/inkboard-node.cpp | 9 ++++----- src/jabber_whiteboard/inkboard-session.cpp | 11 ++++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/jabber_whiteboard/inkboard-node.cpp b/src/jabber_whiteboard/inkboard-node.cpp index a2919315f..343b6c4c1 100644 --- a/src/jabber_whiteboard/inkboard-node.cpp +++ b/src/jabber_whiteboard/inkboard-node.cpp @@ -81,14 +81,13 @@ InkboardDocument::changeConfigure(Glib::ustring target, unsigned int version, XML::Node *node = this->tracker->get(target); unsigned int elementVersion = this->tracker->getVersion(node); - g_warning("got version %d",elementVersion); - - if(node && attribute != "transform")// && version == (elementVersion + 1)) + if(node)// && version == (elementVersion + 1)) { - //g_warning("adding history %s %s",attribute.c_str(),value.c_str()); this->tracker->incrementVersion(node); this->tracker->addHistory(node, attribute, value.c_str()); - node->setAttribute(attribute.c_str(),value.c_str()); + + if(attribute != "transform") + node->setAttribute(attribute.c_str(),value.c_str()); } } diff --git a/src/jabber_whiteboard/inkboard-session.cpp b/src/jabber_whiteboard/inkboard-session.cpp index 498e31d0f..76307e37b 100644 --- a/src/jabber_whiteboard/inkboard-session.cpp +++ b/src/jabber_whiteboard/inkboard-session.cpp @@ -140,6 +140,13 @@ void InkboardSession::notifyContentChanged(Node &node, { XML::Node *element = (XML::Node *)&node; + Glib::ustring value(new_content.pointer()); + + Glib::ustring change = this->doc->tracker->getLastHistory(element,"text"); + + if(change.size() > 0 && change == value) + return; + if(new_content.pointer()) { unsigned int version = this->doc->tracker->incrementVersion(element); @@ -166,12 +173,10 @@ void InkboardSession::notifyAttributeChanged(Node &node, Glib::ustring change = this->doc->tracker->getLastHistory(element,attribute); - g_warning("change %s %s to %s",attribute.c_str(), change.c_str(), value.c_str()); - if(change.size() > 0 && change == value) return; - if(name && new_value.pointer()) + if(attribute.size() > 0 && value.size() > 0) { unsigned int version = this->doc->tracker->incrementVersion(element); -- 2.30.2