From: daleharvey Date: Mon, 4 Sep 2006 17:54:25 +0000 (+0000) Subject: ignore transform messages X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1337884c599e4d2a118ff3f651de099cc6b0a711;p=inkscape.git ignore transform messages --- diff --git a/src/jabber_whiteboard/inkboard-node.cpp b/src/jabber_whiteboard/inkboard-node.cpp index 5f40e3808..a2919315f 100644 --- a/src/jabber_whiteboard/inkboard-node.cpp +++ b/src/jabber_whiteboard/inkboard-node.cpp @@ -66,7 +66,7 @@ InkboardDocument::changeConfigureText(Glib::ustring target, unsigned int version XML::Node *node = this->tracker->get(target); unsigned int elementVersion = this->tracker->getVersion(node); - if(node && version == (elementVersion + 1)) + if(node)// && version == (elementVersion + 1)) { this->tracker->incrementVersion(node); this->tracker->addHistory(node, "text", text); @@ -81,10 +81,13 @@ InkboardDocument::changeConfigure(Glib::ustring target, unsigned int version, XML::Node *node = this->tracker->get(target); unsigned int elementVersion = this->tracker->getVersion(node); - if(node && version == (elementVersion + 1)) + g_warning("got version %d",elementVersion); + + if(node && attribute != "transform")// && version == (elementVersion + 1)) { + //g_warning("adding history %s %s",attribute.c_str(),value.c_str()); this->tracker->incrementVersion(node); - this->tracker->addHistory(node, attribute, node->attribute(attribute.c_str())); + this->tracker->addHistory(node, attribute, value.c_str()); 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 b52b9bd44..498e31d0f 100644 --- a/src/jabber_whiteboard/inkboard-session.cpp +++ b/src/jabber_whiteboard/inkboard-session.cpp @@ -164,9 +164,11 @@ void InkboardSession::notifyAttributeChanged(Node &node, Glib::ustring value(new_value.pointer()); Glib::ustring attribute(g_quark_to_string(name)); - Configure change = this->doc->tracker->getLastHistory(element); + Glib::ustring change = this->doc->tracker->getLastHistory(element,attribute); - if(change.first == attribute && change.second == value) + 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()) diff --git a/src/jabber_whiteboard/keynode.cpp b/src/jabber_whiteboard/keynode.cpp index c60bd7827..60acf0ae9 100644 --- a/src/jabber_whiteboard/keynode.cpp +++ b/src/jabber_whiteboard/keynode.cpp @@ -124,15 +124,27 @@ void KeyNodeTable::addHistory(XML::Node *node, Glib::ustring attribute, Glib::us } } -Configure KeyNodeTable::getLastHistory(XML::Node *node) +Glib::ustring KeyNodeTable::getLastHistory(XML::Node *node, Glib::ustring att) { + std::list hist; + std::vector::iterator iter; for (iter = items.begin() ; iter != items.end() ; iter++) { if (node == iter->node) - break; + hist = iter->history; + } + + std::list::iterator it; + for(it = hist.end() ; it != hist.begin() ; it--) + { + if(it->first == att) + { + //g_warning("hist %s %s",it->first,it->second); + return it->second; + } } - return iter->history.back(); + return ""; } void KeyNodeTable::remove(XML::Node *node) diff --git a/src/jabber_whiteboard/keynode.h b/src/jabber_whiteboard/keynode.h index 9b8ae8394..64c820732 100644 --- a/src/jabber_whiteboard/keynode.h +++ b/src/jabber_whiteboard/keynode.h @@ -107,7 +107,7 @@ public: virtual void addHistory(XML::Node *node, Glib::ustring attribute, Glib::ustring value); - virtual Configure getLastHistory(XML::Node *node); + virtual Glib::ustring getLastHistory(XML::Node *node, Glib::ustring attribute); private: