summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/mailstore/leap_attachment_store.py
diff options
context:
space:
mode:
authorJefferson Stachelski <jstachel@thoughtworks.com>2016-02-03 14:31:53 -0200
committerJefferson Stachelski <jstachel@thoughtworks.com>2016-02-04 23:54:15 -0200
commit9442be5c230e286073244451189ffc05ae6c8083 (patch)
treee1113019780b6a7fcde3f0c7dec2991fc02b7c73 /service/pixelated/adapter/mailstore/leap_attachment_store.py
parent746069cb8fe957aa6206f4c57ec63704838546c1 (diff)
Issue #549 - Implemented remove attachment
Diffstat (limited to 'service/pixelated/adapter/mailstore/leap_attachment_store.py')
-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)