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

adapt to new API

This commit is contained in:
holger krekel 2018-10-07 15:39:11 +02:00
parent 1329f4d546
commit c565269d1c

View file

@ -40,10 +40,9 @@ class Message(object):
msg = cls(dc_context, 0) msg = cls(dc_context, 0)
view_type_code = MessageType.get_typecode(view_type) view_type_code = MessageType.get_typecode(view_type)
msg._dc_msg_volatile = ffi.gc( msg._dc_msg_volatile = ffi.gc(
lib.dc_msg_new(dc_context), lib.dc_msg_new(dc_context, view_type_code),
lib.dc_msg_unref lib.dc_msg_unref
) )
lib.dc_msg_set_type(msg._dc_msg, view_type_code)
return msg return msg
def get_state(self): def get_state(self):
@ -89,7 +88,7 @@ class Message(object):
:returns: a :class:`deltachat.chatting.MessageType` instance. :returns: a :class:`deltachat.chatting.MessageType` instance.
""" """
return MessageType(lib.dc_msg_get_type(self._dc_msg)) return MessageType(lib.dc_msg_get_viewtype(self._dc_msg))
@property_with_doc @property_with_doc
def time_sent(self): def time_sent(self):