UrlShortenerPlugin.shortening message only once

This commit is contained in:
Denis Fomin
2013-01-16 18:01:11 +04:00
parent 723e9161a6
commit e8f1bf54f3

View File

@@ -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):