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:
parent
2c69b7ed57
commit
ad42cd5fdf
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue