Refresh tab when information element is added or removed

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent e2981f33
...@@ -89,6 +89,7 @@ class ConversationTab(OneToOneTab): ...@@ -89,6 +89,7 @@ class ConversationTab(OneToOneTab):
raise NotImplementedError raise NotImplementedError
@staticmethod @staticmethod
@refresh_wrapper.always
def add_information_element(plugin_name, callback): def add_information_element(plugin_name, callback):
""" """
Lets a plugin add its own information to the ConversationInfoWin Lets a plugin add its own information to the ConversationInfoWin
...@@ -96,6 +97,7 @@ class ConversationTab(OneToOneTab): ...@@ -96,6 +97,7 @@ class ConversationTab(OneToOneTab):
ConversationTab.additional_information[plugin_name] = callback ConversationTab.additional_information[plugin_name] = callback
@staticmethod @staticmethod
@refresh_wrapper.always
def remove_information_element(plugin_name): def remove_information_element(plugin_name):
del ConversationTab.additional_information[plugin_name] del ConversationTab.additional_information[plugin_name]
......
...@@ -109,6 +109,7 @@ class MucTab(ChatTab): ...@@ -109,6 +109,7 @@ class MucTab(ChatTab):
return None return None
@staticmethod @staticmethod
@refresh_wrapper.always
def add_information_element(plugin_name: str, callback: Callable[[str], str]) -> None: def add_information_element(plugin_name: str, callback: Callable[[str], str]) -> None:
""" """
Lets a plugin add its own information to the MucInfoWin Lets a plugin add its own information to the MucInfoWin
...@@ -116,6 +117,7 @@ class MucTab(ChatTab): ...@@ -116,6 +117,7 @@ class MucTab(ChatTab):
MucTab.additional_information[plugin_name] = callback MucTab.additional_information[plugin_name] = callback
@staticmethod @staticmethod
@refresh_wrapper.always
def remove_information_element(plugin_name: str) -> None: def remove_information_element(plugin_name: str) -> None:
""" """
Lets a plugin add its own information to the MucInfoWin Lets a plugin add its own information to the MucInfoWin
......
...@@ -94,6 +94,7 @@ class PrivateTab(OneToOneTab): ...@@ -94,6 +94,7 @@ class PrivateTab(OneToOneTab):
super().ack_message(msg_id, msg_jid) super().ack_message(msg_id, msg_jid)
@staticmethod @staticmethod
@refresh_wrapper.always
def add_information_element(plugin_name, callback): def add_information_element(plugin_name, callback):
""" """
Lets a plugin add its own information to the PrivateInfoWin Lets a plugin add its own information to the PrivateInfoWin
...@@ -101,6 +102,7 @@ class PrivateTab(OneToOneTab): ...@@ -101,6 +102,7 @@ class PrivateTab(OneToOneTab):
PrivateTab.additional_information[plugin_name] = callback PrivateTab.additional_information[plugin_name] = callback
@staticmethod @staticmethod
@refresh_wrapper.always
def remove_information_element(plugin_name): def remove_information_element(plugin_name):
del PrivateTab.additional_information[plugin_name] del PrivateTab.additional_information[plugin_name]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment