From 7d6b301087dcdc95fb177ea62eb9866ba354ccf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 1 Apr 2020 01:17:01 +0200 Subject: reorder: Create ConversationTabs when they don't exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/reorder.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/reorder.py b/plugins/reorder.py index eebc810a..2708d395 100644 --- a/plugins/reorder.py +++ b/plugins/reorder.py @@ -175,9 +175,15 @@ class Plugin(BasePlugin): new_tabs.append(tab) old_tabs.remove(tab) else: - self.api.information('Tab %s not found' % jid, 'Warning') - if create_gaps: - new_tabs.append(tabs.GapTab(self.core)) + self.api.information('Tab %s not found. Creating it' % jid, 'Warning') + # TODO: Add support for MucTab. Requires nickname. + if cls in (tabs.DynamicConversationTab, tabs.StaticConversationTab): + try: + new_tab = cls(self.core, jid) + new_tabs.append(new_tab) + except: + self.api.information('Failed to create tab \'%s\'.' % jid, 'Error') + continue last = pos for tab in old_tabs: -- cgit v1.2.3