mirror of
https://github.com/ArcaneChat/arcanechat-tui.git
synced 2026-07-03 14:05:26 +02:00
avoid using deprecated chat.get_subtitle()
This commit is contained in:
@@ -4,6 +4,14 @@ import deltachat as dc
|
||||
import urwid
|
||||
|
||||
|
||||
def get_subtitle(chat):
|
||||
members = chat.get_contacts()
|
||||
if not chat.is_group() and members:
|
||||
return members[0].addr
|
||||
else:
|
||||
return "{} member(s)".format(len(members))
|
||||
|
||||
|
||||
class MessageSendWidget(urwid.Filler, ChatListMonitor):
|
||||
def __init__(self, keymap, account):
|
||||
self.text_caption = " >> "
|
||||
@@ -58,7 +66,7 @@ class MessageSendWidget(urwid.Filler, ChatListMonitor):
|
||||
if chat.is_verified():
|
||||
verified = '✓ '
|
||||
text = ' {}[ {} ] -- {}'.format(
|
||||
verified, chat.get_name(), chat.get_subtitle())
|
||||
verified, chat.get_name(), get_subtitle(chat))
|
||||
|
||||
self.status_bar.set_text(text)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user