summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/link.py2
-rw-r--r--plugins/reorder.py8
-rw-r--r--plugins/send_delayed.py6
3 files changed, 12 insertions, 4 deletions
diff --git a/plugins/link.py b/plugins/link.py
index 2c34232c..c8c75918 100644
--- a/plugins/link.py
+++ b/plugins/link.py
@@ -87,7 +87,7 @@ from poezio.xhtml import clean_text
from poezio import common
from poezio import tabs
-url_pattern = re.compile(r'\b(http[s]?://(?:\S+))\b', re.I|re.U)
+url_pattern = re.compile(r'\b(?:http[s]?://(?:\S+))|(?:magnet:\?(?:\S+))\b', re.I|re.U)
app_mapping = {
'Linux': 'xdg-open',
'Darwin': 'open',
diff --git a/plugins/reorder.py b/plugins/reorder.py
index ecab457e..87e87ee6 100644
--- a/plugins/reorder.py
+++ b/plugins/reorder.py
@@ -62,6 +62,7 @@ And finally, the ``[tab name]`` must be:
from poezio import tabs
from poezio.decorators import command_args_parser
from poezio.plugin import BasePlugin
+from poezio.config import config
TEXT_TO_TAB = {
'muc': tabs.MucTab,
@@ -141,10 +142,12 @@ class Plugin(BasePlugin):
old_tabs = self.core.tabs[1:]
roster = self.core.tabs[0]
+ create_gaps = config.get('create_gaps')
+
new_tabs = []
last = 0
for pos in sorted(tabs_spec):
- if pos > last + 1:
+ if create_gaps and pos > last + 1:
new_tabs += [tabs.GapTab(self.core) for i in range(pos - last)]
cls, name = tabs_spec[pos]
tab = self.core.get_tab_by_name(name, typ=cls)
@@ -153,7 +156,8 @@ class Plugin(BasePlugin):
old_tabs.remove(tab)
else:
self.api.information('Tab %s not found' % name, 'Warning')
- new_tabs.append(tabs.GapTab(self.core))
+ if create_gaps:
+ new_tabs.append(tabs.GapTab(self.core))
last = pos
for tab in old_tabs:
diff --git a/plugins/send_delayed.py b/plugins/send_delayed.py
index 299de6e2..7a3ddc60 100644
--- a/plugins/send_delayed.py
+++ b/plugins/send_delayed.py
@@ -38,15 +38,19 @@ class Plugin(BasePlugin):
@command_args_parser.quoted(2)
def command_delayed(self, args):
if args is None:
+ self.core.command.help('send_delayed')
return
delay_str, txt = args
delay = common.parse_str_to_secs(delay_str)
- if not delay_str:
+ if not delay:
+ self.api.information('Failed to parse %s.' % delay_str, 'Error')
return
tab = self.api.current_tab()
timed_event = timed_events.DelayedEvent(delay, self.say, (tab, txt))
self.api.add_timed_event(timed_event)
+ self.api.information('Delayed message will be sent in %ds (%s).'
+ % (delay, delay_str), 'Info')
def completion_delay(self, the_input):
txt = the_input.get_text()