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

Method new_empty

python/src/deltachat/message.py:54–64  ·  view source on GitHub ↗

create a non-persistent message. :param view_type: the message type code or one of the strings: "text", "audio", "video", "file", "sticker", "videochat", "webxdc"

(cls, account, view_type)

Source from the content-addressed store, hash-verified

52
53 @classmethod
54 def new_empty(cls, account, view_type):
55 """create a non-persistent message.
56
57 :param view_type: the message type code or one of the strings:
58 "text", "audio", "video", "file", "sticker", "videochat", "webxdc"
59 """
60 view_type_code = view_type if isinstance(view_type, int) else get_viewtype_code_from_name(view_type)
61 return Message(
62 account,
63 ffi.gc(lib.dc_msg_new(account._dc_context, view_type_code), lib.dc_msg_unref),
64 )
65
66 def create_chat(self):
67 """create or get an existing chat (group) object for this message.

Callers 12

send_fileMethod · 0.80
send_imageMethod · 0.80
test_set_get_draftMethod · 0.80
send_and_receive_messageFunction · 0.80
test_html_messageFunction · 0.80
test_webxdc_messageFunction · 0.80
test_webxdc_huge_updateFunction · 0.80
test_reply_privatelyFunction · 0.80
test_quote_attachmentFunction · 0.80
test_group_quoteFunction · 0.80

Calls 2

MessageClass · 0.70

Tested by 10

test_set_get_draftMethod · 0.64
send_and_receive_messageFunction · 0.64
test_html_messageFunction · 0.64
test_webxdc_messageFunction · 0.64
test_webxdc_huge_updateFunction · 0.64
test_reply_privatelyFunction · 0.64
test_quote_attachmentFunction · 0.64
test_group_quoteFunction · 0.64