diff options
author | Denis Fomin <fominde@gmail.com> | 2013-07-19 13:54:56 +0400 |
---|---|---|
committer | Denis Fomin <fominde@gmail.com> | 2013-07-19 13:54:56 +0400 |
commit | 8302f0fc78553c1f5ce6966a645a703c034506e6 (patch) | |
tree | bb598e8fc9819556f1ef49a2a5cc702d7798f581 | |
parent | 4be3be994ee3ac2a7b871255343f722bee0ff2bc (diff) |
UrlShortenerPlugin. gc support
-rw-r--r-- | clients_icons/manifest.ini | 2 | ||||
-rw-r--r-- | url_shortener/manifest.ini | 2 | ||||
-rw-r--r-- | url_shortener/url_shortener.py | 12 |
3 files changed, 14 insertions, 2 deletions
diff --git a/clients_icons/manifest.ini b/clients_icons/manifest.ini index 1200d55..3bf4e0e 100644 --- a/clients_icons/manifest.ini +++ b/clients_icons/manifest.ini @@ -1,7 +1,7 @@ [info] name: Clients icons short_name: clients_icons -version: 4.4 +version: 4.5 description: Shows the client icons in the roster and in groupchats. For icons in tooltip support, you need to install Gajim r14117 or above. diff --git a/url_shortener/manifest.ini b/url_shortener/manifest.ini index a2beb4c..5ed9306 100644 --- a/url_shortener/manifest.ini +++ b/url_shortener/manifest.ini @@ -1,7 +1,7 @@ [info] name: Url Shortener short_name: url_shortener -version: 0.3.1 +version: 0.3.2 description: Plugin that allows users to shorten a long URL in messages. For example, you can turn this link: http://maps.google.com/maps?f=d&saddr=New+York+Penn+Station&daddr=9th+Ave+%26+14th+St,+New+York,+NY&hl=en&geocode=&mra=ls&dirflg=r&date=11%2F12%2F08&time=4:13pm&ttype=dep&noexp=0&noal=0&sort=&sll=40.746175,-73.998395&sspn=0.014468,0.036392&ie=UTF8&z=14 diff --git a/url_shortener/url_shortener.py b/url_shortener/url_shortener.py index 27683ae..4d66a7e 100644 --- a/url_shortener/url_shortener.py +++ b/url_shortener/url_shortener.py @@ -37,10 +37,15 @@ class UrlShortenerPlugin(GajimPlugin): 'SHORTEN_OUTGOING': (False, ''),} self.events_handlers['message-outgoing'] = (ged.OUT_PRECORE, self.handle_outgoing_msg) + self.events_handlers['gc-message-outgoing'] = (ged.OUT_PRECORE, + self.handle_outgoing_msg) self.chat_control = None self.controls = [] + self.is_active = None def handle_outgoing_msg(self, event): + if not self.active: + return if not event.message: return if not self.config['SHORTEN_OUTGOING']: @@ -97,6 +102,13 @@ class UrlShortenerPlugin(GajimPlugin): control.disconnect_from_chat_control() self.controls.remove(control) + def activate(self): + self.active = True + + def deactivate(self): + self.active = False + + class Base(object): def __init__(self, plugin, chat_control): self.plugin = plugin |