diff options
author | mathieui <mathieui@mathieui.net> | 2012-05-13 18:45:40 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-05-13 18:45:40 +0200 |
commit | d949a379a3aa353b6f1f7c48e92ac8cefaca60fc (patch) | |
tree | 7069a02488036074e6a8c6fb398623fe42c86a85 /plugins | |
parent | ef8a7a647f6e895c89cefba0e2f83fb20fdb80c5 (diff) | |
download | poezio-d949a379a3aa353b6f1f7c48e92ac8cefaca60fc.tar.gz poezio-d949a379a3aa353b6f1f7c48e92ac8cefaca60fc.tar.bz2 poezio-d949a379a3aa353b6f1f7c48e92ac8cefaca60fc.tar.xz poezio-d949a379a3aa353b6f1f7c48e92ac8cefaca60fc.zip |
Use add_tab_command in the link plugin
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/link.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/link.py b/plugins/link.py index 2fcf9ddd..29ded32f 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -3,15 +3,18 @@ import re -from plugin import BasePlugin, PluginConfig +from plugin import BasePlugin from xhtml import clean_text import common +import tabs url_pattern = re.compile(r'\b(http[s]?://(?:\S+))\b', re.I|re.U) class Plugin(BasePlugin): def init(self): - self.add_command('link', self.command_link, "Usage: /link\nLink: opens the last link from the conversation into a browser.") + self.add_tab_command(tabs.MucTab, 'link', self.command_link, "Usage: /link\nLink: opens the last link from the conversation into a browser.") + self.add_tab_command(tabs.PrivateTab, 'link', self.command_link, "Usage: /link\nLink: opens the last link from the conversation into a browser.") + self.add_tab_command(tabs.ConversationTab, 'link', self.command_link, "Usage: /link\nLink: opens the last link from the conversation into a browser.") def find_link(self, nb): messages = self.core.get_conversation_messages() |