diff options
author | Andi_G <andigros72@googlemail.com> | 2011-09-05 15:36:25 (GMT) |
---|---|---|
committer | Andi_G <andigros72@googlemail.com> | 2011-09-05 15:36:25 (GMT) |
commit | 24e894da03476cd342d577af03509141fd981597 (patch) | |
tree | 933f114a1eb37eae2fbf9a776f3b6b555894c166 | |
parent | 4bd0ec8306c37a4b832b53c722bf24b993125545 (diff) |
only upload your own annotations
-rw-r--r-- | readdb.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -721,9 +721,11 @@ class AnnotationManager: if self._userid == '': self._userid = self.get_userid_for_username( self.get_user_string( user ) ) self._creator = self._userid + if len(self._annotates) > 0: + values = {'w3c_hasTarget' : self._annotates } + else: + values = {'checksum' : self._filehash } - #values = {'w3c_hasTarget' : self._annotates, 'creator' : self._creator } - values = {'w3c_hasTarget' : self._filehash, 'creator' : self._creator } _logger.debug('sync annotations -- annotates is: %s ' % self._annotates) try: data = urllib.urlencode(values) @@ -758,8 +760,9 @@ class AnnotationManager: _logger.debug(str('after update: timestamps are remote: %d, local %d' % (rmodifiedtstamp, self._annotations[ind].get_modified()))) self.update_annotation_db_record(a) else: - _logger.debug(str('remote annotation is outdated, sending %s' % self._annotations[ind])) - self.send_annotation_to_server(self._annotations[ind]) + if self._annotations[ind].get_creator() == self._userid: + _logger.debug(str('remote annotation is outdated, sending %s' % self._annotations[ind])) + self.send_annotation_to_server(self._annotations[ind]) if (len(self._annotations) > 0): #send annotations if necessary |