diff options
Diffstat (limited to 'poezio/core/tabs.py')
-rw-r--r-- | poezio/core/tabs.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/poezio/core/tabs.py b/poezio/core/tabs.py index 1e0a035d..6d0589ba 100644 --- a/poezio/core/tabs.py +++ b/poezio/core/tabs.py @@ -171,12 +171,17 @@ class Tabs: return any_matched, candidate - def by_name_and_class(self, name: str, + def by_name_and_class(self, name: Union[str, JID], cls: Type[T]) -> Optional[T]: """Get a tab with its name and class""" + if isinstance(name, JID): + str_name = name.full + else: + str_name = name + str cls_tabs = self._tab_types.get(cls, []) for tab in cls_tabs: - if tab.name == name: + if tab.name == str_name: return cast(T, tab) return None |