MCPcopy Create free account
hub / github.com/chatmail/core / get_draft

Method get_draft

python/src/deltachat/chat.py:338–348  ·  view source on GitHub ↗

get draft message for this chat. :param message: a :class:`Message` instance :returns: Message object or None (if no draft available)

(self)

Source from the content-addressed store, hash-verified

336 lib.dc_set_draft(self.account._dc_context, self.id, message._dc_msg)
337
338 def get_draft(self):
339 """get draft message for this chat.
340
341 :param message: a :class:`Message` instance
342 :returns: Message object or None (if no draft available)
343 """
344 x = lib.dc_get_draft(self.account._dc_context, self.id)
345 if x == ffi.NULL:
346 return None
347 dc_msg = ffi.gc(x, lib.dc_msg_unref)
348 return Message(self.account, dc_msg)
349
350 def get_messages(self):
351 """return list of messages in this chat.

Callers 3

test_set_get_draftMethod · 0.45

Calls 1

MessageClass · 0.70

Tested by 3

test_set_get_draftMethod · 0.36