From 9442be5c230e286073244451189ffc05ae6c8083 Mon Sep 17 00:00:00 2001 From: Jefferson Stachelski Date: Wed, 3 Feb 2016 14:31:53 -0200 Subject: Issue #549 - Implemented remove attachment --- service/pixelated/adapter/mailstore/leap_attachment_store.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'service/pixelated/adapter/mailstore') 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) -- cgit v1.2.3