summaryrefslogtreecommitdiff
path: root/plugins/link.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-05-20 13:43:53 +0200
committerFlorent Le Coz <louiz@louiz.org>2012-05-20 13:43:53 +0200
commit65c2d3dc8891eae4307375eef4b79d13ac793e46 (patch)
tree98359af6c6d9809585b52dcc1aadf083fa590412 /plugins/link.py
parent0f0efb7ada6ad60f88360bc6a8feb3607fcabd3c (diff)
parent51c788ad96703d215942499ffefe6fdc98326b6b (diff)
downloadpoezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.gz
poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.bz2
poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.xz
poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.zip
Merge branch 'master' of https://git.louiz.org/poezio
Diffstat (limited to 'plugins/link.py')
-rw-r--r--plugins/link.py7
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()