From 12af2c5e47893c190926c13d83c6bfc6972390f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 31 Mar 2022 12:12:48 +0200 Subject: ConversationTab: don't display comma in /info if no status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- CHANGELOG | 1 + poezio/tabs/conversationtab.py | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7f1265b4..6180d63e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -72,6 +72,7 @@ This file describes the new features in each poezio release. - Fix default dataform field handling (#3554) - Fix MUCListTab not joining selected MUCs (#3553) - Fix /color completion (Thanks eijebong) +- /info: Don't display comma before status message if not available ## Plugins diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py index d3a1640c..f07e7b0e 100644 --- a/poezio/tabs/conversationtab.py +++ b/poezio/tabs/conversationtab.py @@ -277,16 +277,9 @@ class ConversationTab(OneToOneTab): else: resource = None if resource: - status = ( - 'Status: %s' % resource.status) if resource.status else '' - self.add_message( - InfoMessage( - "Show: %(show)s, %(status)s" % { - 'show': resource.presence or 'available', - 'status': status, - } - ), - ) + status = (f', Status: {resource.status}') if resource.status else '' + show = f"Show: {resource.presence or 'available'}" + self.add_message(InfoMessage(f'{show}{status}')) return True self.add_message( InfoMessage("No information available"), -- cgit v1.2.3