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

don't use removed send_file_msg but message creation and the generic dc_send_msg

This commit is contained in:
holger krekel 2018-10-16 23:33:13 +02:00
parent 2c69b7ed57
commit ad42cd5fdf

View file

@ -130,7 +130,9 @@ class Chat(object):
""" """
path = as_dc_charpointer(path) path = as_dc_charpointer(path)
mtype = as_dc_charpointer(mime_type) 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: if msg_id == 0:
raise ValueError("message could not be send, does chat exist?") raise ValueError("message could not be send, does chat exist?")
return Message.from_db(self._dc_context, msg_id) return Message.from_db(self._dc_context, msg_id)