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

Method from_db

python/src/deltachat/message.py:43–51  ·  view source on GitHub ↗

Attempt to load the message from the database given its ID. None is returned if the message does not exist, i.e. deleted.

(cls, account, id)

Source from the content-addressed store, hash-verified

41
42 @classmethod
43 def from_db(cls, account, id) -> Optional["Message"]:
44 """Attempt to load the message from the database given its ID.
45
46 None is returned if the message does not exist, i.e. deleted."""
47 assert id > 0
48 res = lib.dc_get_msg(account._dc_context, id)
49 if res == ffi.NULL:
50 return None
51 return cls(account, ffi.gc(res, lib.dc_msg_unref))
52
53 @classmethod
54 def new_empty(cls, account, view_type):

Callers 7

get_fresh_messagesMethod · 0.80
get_message_by_idMethod · 0.80
send_msgMethod · 0.80
send_textMethod · 0.80
send_fileMethod · 0.80
send_imageMethod · 0.80
get_messagesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected