1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-03 17:59:19 +02:00

Merge pull request #393 from deltachat/cleanup3

remove deprecated dc_send_X_msg() functions
This commit is contained in:
holger krekel 2018-10-16 23:49:33 +02:00 committed by GitHub
commit 25e157b71f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 279 deletions

View file

@ -130,7 +130,9 @@ class Chat(object):
"""
path = as_dc_charpointer(path)
mtype = as_dc_charpointer(mime_type)
msg_id = lib.dc_send_file_msg(self._dc_context, self.id, path, mtype)
msg = Message.new(self._dc_context, "file")
msg.set_file(path, mtype)
msg_id = lib.dc_send_msg(self._dc_context, self.id, msg._dc_msg)
if msg_id == 0:
raise ValueError("message could not be send, does chat exist?")
return Message.from_db(self._dc_context, msg_id)