ConversationTab: don't display comma in /info if no status

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-03-31 12:12:48 +02:00 committed by Maxime Buquet
parent 2005ed6ae0
commit 12af2c5e47
2 changed files with 4 additions and 10 deletions

View file

@ -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

View file

@ -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"),