owncloud/core — pull request #2189 by schiesbn (2013-03-08 10:28:07+00:00)
Title: fix versioning for the sync client - distinguish between touch and write operation

The sync client always performs two operations if he updates a file. First he writes the file to the server and than he triggers a touch() to correct the timestamp.

The problem: writing the file and touch() both triggers a "write" hook which makes it impossible for apps like the file versioning to distinguish between the two operation which leads to version duplicates.

Solution: I updated the touch operation to send a 'touch' signal by default in case if someone always needs to listen to the touch operation and add the "write' signal only when the touch operation creates a new file.

I looked at the code where we use touch(). It is used in the trash bin and versioning app, for both this changes are OK. Our sabre connector uses it to set the timestamp, that's why I introduced the changes so it should be safe too. The files app uses it to create a new file but than the write hook will be added, so it should be also safe.

Please review it, especially @icewind1991