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

Method create_chat

python/src/deltachat/contact.py:109–118  ·  view source on GitHub ↗

create or get an existing 1:1 chat object for the specified contact or contact id. :param contact: chat_id (int) or contact object. :returns: a :class:`deltachat.chat.Chat` object.

(self)

Source from the content-addressed store, hash-verified

107 return from_dc_charpointer(lib.dc_contact_get_status(self._dc_contact))
108
109 def create_chat(self):
110 """create or get an existing 1:1 chat object for the specified contact or contact id.
111
112 :param contact: chat_id (int) or contact object.
113 :returns: a :class:`deltachat.chat.Chat` object.
114 """
115 dc_context = self.account._dc_context
116 chat_id = lib.dc_create_chat_by_contact_id(dc_context, self.id)
117 assert chat_id > const.DC_CHAT_ID_LAST_SPECIAL, chat_id
118 return Chat(self.account, chat_id)
119
120 # deprecated name
121 get_chat = create_chat

Callers

nothing calls this directly

Calls 1

ChatClass · 0.70

Tested by

no test coverage detected