diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2020-04-01 01:17:01 +0200 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2020-04-01 01:17:01 +0200 |
commit | 7d6b301087dcdc95fb177ea62eb9866ba354ccf7 (patch) | |
tree | aef270b942081ec37caa5193599fdf327fae22e7 /plugins | |
parent | 00b91fe46218be23e040813aacbc73987b9015a0 (diff) | |
download | poezio-7d6b301087dcdc95fb177ea62eb9866ba354ccf7.tar.gz poezio-7d6b301087dcdc95fb177ea62eb9866ba354ccf7.tar.bz2 poezio-7d6b301087dcdc95fb177ea62eb9866ba354ccf7.tar.xz poezio-7d6b301087dcdc95fb177ea62eb9866ba354ccf7.zip |
reorder: Create ConversationTabs when they don't exist
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/reorder.py | 12 |
1 files 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: |