summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/mailstore
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-02-12 14:53:41 -0200
committerNavaL <ayoyo@thoughtworks.com>2016-02-12 14:53:41 -0200
commit077e4100160ba58ee2abf91c0572ca1c0962277e (patch)
tree336ba2bc1484d423f5f807247f13482915c91140 /service/pixelated/adapter/mailstore
parent78925e0332bbc41ed37e27d506be192abdb7124e (diff)
Revert "Revert "Issue #549 - Implemented remove attachment""
This reverts commit 3c6b905d7e5b78e521b2e7692e5e32b7b0c226bc.
Diffstat (limited to 'service/pixelated/adapter/mailstore')
-rw-r--r--service/pixelated/adapter/mailstore/leap_attachment_store.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_attachment_store.py b/service/pixelated/adapter/mailstore/leap_attachment_store.py
index 982d9222..2c004abf 100644
--- a/service/pixelated/adapter/mailstore/leap_attachment_store.py
+++ b/service/pixelated/adapter/mailstore/leap_attachment_store.py
@@ -63,3 +63,9 @@ class LeapAttachmentStore(object):
def _calc_attachment_id_(self, content, content_type, encoder=encoders.encode_base64):
cdoc = self._attachment_to_cdoc(content, content_type, encoder)
return cdoc.phash
+
+ @defer.inlineCallbacks
+ def delete_attachment(self, attachment_id):
+ doc = yield self.soledad.get_from_index('by-type-and-payloadhash', 'cnt', attachment_id)
+ doc = doc[0]
+ yield self.soledad.delete_doc(doc)