mirror of
https://github.com/chatmail/core.git
synced 2026-04-06 15:42:10 +03:00
Add quote API
Sticky encryption rule, requiring that all replies to encrypted messages are encrypted, applies only to messages with a quote now. Co-Authored-By: B. Petersen <r10s@b44t.com>
This commit is contained in:
committed by
link2xt
parent
8c82a5cbfa
commit
20182b027e
@@ -175,6 +175,27 @@ class Message(object):
|
||||
if ts:
|
||||
return datetime.utcfromtimestamp(ts)
|
||||
|
||||
@property
|
||||
def quoted_text(self):
|
||||
"""Text inside the quote
|
||||
|
||||
:returns: Quoted text"""
|
||||
return from_dc_charpointer(lib.dc_msg_get_quoted_text(self._dc_msg))
|
||||
|
||||
@property
|
||||
def quote(self):
|
||||
"""Quote getter
|
||||
|
||||
:returns: Quoted message, if found in the database"""
|
||||
msg = lib.dc_msg_get_quoted_msg(self._dc_msg)
|
||||
if msg:
|
||||
return Message(self.account, ffi.gc(msg, lib.dc_msg_unref))
|
||||
|
||||
@quote.setter
|
||||
def quote(self, quoted_message):
|
||||
"""Quote setter"""
|
||||
lib.dc_msg_set_quote(self._dc_msg, quoted_message._dc_msg)
|
||||
|
||||
def get_mime_headers(self):
|
||||
""" return mime-header object for an incoming message.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user