add chat.get_summary

(returns a lot like the original function chatlit.getsummary
 but it doesn't need a chatlist to work)
This commit is contained in:
Simon Laux
2020-07-15 22:51:21 +02:00
parent 667364b90e
commit 439d09ebb5
4 changed files with 125 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import calendar
import json
from datetime import datetime
import os
from .cutil import as_dc_charpointer, from_dc_charpointer, iter_array
from .cutil import as_dc_charpointer, from_dc_charpointer, iter_array, DCLot
from .capi import lib, ffi
from . import const
from .message import Message
@@ -344,6 +344,11 @@ class Chat(object):
s = from_dc_charpointer(dc_res)
return json.loads(s)
def get_summary_lot(self):
""" return summary lot of chat (used for displaying last message in a chatlist)"""
lot = lib.dc_chat_get_summary(self.account._dc_context, self._dc_chat)
return DCLot(lot)
# ------ group management API ------------------------------
def add_contact(self, obj):