Refresh tab when information element is added or removed

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-04-19 15:14:53 +01:00
parent e2981f3377
commit 2508eea8e6
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
3 changed files with 6 additions and 0 deletions

View file

@ -89,6 +89,7 @@ class ConversationTab(OneToOneTab):
raise NotImplementedError
@staticmethod
@refresh_wrapper.always
def add_information_element(plugin_name, callback):
"""
Lets a plugin add its own information to the ConversationInfoWin
@ -96,6 +97,7 @@ class ConversationTab(OneToOneTab):
ConversationTab.additional_information[plugin_name] = callback
@staticmethod
@refresh_wrapper.always
def remove_information_element(plugin_name):
del ConversationTab.additional_information[plugin_name]

View file

@ -109,6 +109,7 @@ class MucTab(ChatTab):
return None
@staticmethod
@refresh_wrapper.always
def add_information_element(plugin_name: str, callback: Callable[[str], str]) -> None:
"""
Lets a plugin add its own information to the MucInfoWin
@ -116,6 +117,7 @@ class MucTab(ChatTab):
MucTab.additional_information[plugin_name] = callback
@staticmethod
@refresh_wrapper.always
def remove_information_element(plugin_name: str) -> None:
"""
Lets a plugin add its own information to the MucInfoWin

View file

@ -94,6 +94,7 @@ class PrivateTab(OneToOneTab):
super().ack_message(msg_id, msg_jid)
@staticmethod
@refresh_wrapper.always
def add_information_element(plugin_name, callback):
"""
Lets a plugin add its own information to the PrivateInfoWin
@ -101,6 +102,7 @@ class PrivateTab(OneToOneTab):
PrivateTab.additional_information[plugin_name] = callback
@staticmethod
@refresh_wrapper.always
def remove_information_element(plugin_name):
del PrivateTab.additional_information[plugin_name]