diff options
author | David Robillard <d@drobilla.net> | 2016-07-29 22:20:01 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-07-29 22:20:01 -0400 |
commit | d035a293b7e4555597bcf5940e8a98f278a2143e (patch) | |
tree | 3bc0443934f0c7bb8efdccf90d114d4ab8a2063c /src/server | |
parent | 50a6edb088ead6d8f6287aeca55e4d704add61a2 (diff) | |
download | ingen-d035a293b7e4555597bcf5940e8a98f278a2143e.tar.gz ingen-d035a293b7e4555597bcf5940e8a98f278a2143e.tar.bz2 ingen-d035a293b7e4555597bcf5940e8a98f278a2143e.zip |
Use more terse patch:Put for canvas positions
Fix the semantics of PUT events for existing objects to match the
documentation.
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/EventWriter.cpp | 9 | ||||
-rw-r--r-- | src/server/events/Delta.cpp | 12 |
2 files changed, 5 insertions, 16 deletions
diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp index 1f225d6e..9732f04c 100644 --- a/src/server/EventWriter.cpp +++ b/src/server/EventWriter.cpp @@ -126,15 +126,10 @@ EventWriter::set_property(const Raul::URI& uri, const Raul::URI& predicate, const Atom& value) { - Resource::Properties remove{ - { predicate, _engine.world()->uris().patch_wildcard.urid }}; - - Resource::Properties add{{ predicate, value }}; - _engine.enqueue_event( new Events::Delta(_engine, _respondee, _request_id, now(), - Events::Delta::Type::SET, Resource::Graph::DEFAULT, - uri, add, remove)); + Events::Delta::Type::PUT, Resource::Graph::DEFAULT, + uri, {{predicate, value}}, {})); } void diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 0ef63d64..641525e1 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -298,15 +298,9 @@ Delta::pre_process() } // Remove all added properties if this is a put or set - if (_object) { - if (_type == Type::PUT) { - for (const auto& p : _properties) { - _object->remove_property(p.first, p.second); - } - } else if (_type == Type::SET) { - for (const auto& p : _properties) { - _object->remove_property(p.first, uris.patch_wildcard); - } + if (_object && (_type == Type::PUT || _type == Type::SET)) { + for (const auto& p : _properties) { + _object->remove_property(p.first, uris.patch_wildcard); } } |