diff options
-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 |