diff options
author | Denis Fomin <fominde@gmail.com> | 2013-01-16 18:01:11 +0400 |
---|---|---|
committer | Denis Fomin <fominde@gmail.com> | 2013-01-16 18:01:11 +0400 |
commit | e8f1bf54f3d078d80f6a823210865cea737f4a81 (patch) | |
tree | f447cf55d309ad4728e7d8e162425138186766d4 /url_shortener/url_shortener.py | |
parent | 723e9161a64ba5203728c79790f435377a0b2577 (diff) |
UrlShortenerPlugin.shortening message only once
Diffstat (limited to 'url_shortener/url_shortener.py')
-rw-r--r-- | url_shortener/url_shortener.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/url_shortener/url_shortener.py b/url_shortener/url_shortener.py index c2a9a5a..c9131e0 100644 --- a/url_shortener/url_shortener.py +++ b/url_shortener/url_shortener.py @@ -44,6 +44,8 @@ class UrlShortenerPlugin(GajimPlugin): return if not self.config['SHORTEN_OUTGOING']: return + if hasattr(event, 'shortened'): + return iterator = gajim.interface.basic_pattern_re.finditer(event.message) for match in iterator: @@ -67,6 +69,7 @@ class UrlShortenerPlugin(GajimPlugin): if short_link: event.message = event.message.replace(link, short_link) event.callback_args[1] = event.message + event.shortened = True @log_calls('UrlShortenerPlugin') def connect_with_chat_control(self, chat_control): |