diff --git a/gui_for_me/gui_for_me.py b/gui_for_me/gui_for_me.py index 3ba9b1e..cdf3b08 100644 --- a/gui_for_me/gui_for_me.py +++ b/gui_for_me/gui_for_me.py @@ -41,7 +41,8 @@ class GuiForMe(GajimPlugin): for base in self.controls: if base.chat_control != chat_control: continue - base.button.set_sensitive(chat_control.msg_textview.get_sensitive()) + base.button.set_sensitive(chat_control.contact.show != 'offline' \ + and gajim.connections[chat_control.account].connected > 0) class Base(object): diff --git a/quick_replies/plugin.py b/quick_replies/plugin.py index f0650bb..91d309e 100644 --- a/quick_replies/plugin.py +++ b/quick_replies/plugin.py @@ -1,5 +1,6 @@ import gtk import gtkgui_helpers +from common import gajim from plugins import GajimPlugin from plugins.gui import GajimPluginConfigDialog @@ -37,8 +38,8 @@ class QuickRepliesPlugin(GajimPlugin): def connect_with_chat_control(self, chat_control): self.chat_control = chat_control - control = Base(self, self.chat_control) - self.controls.append(control) + base = Base(self, chat_control) + self.controls.append(base) @log_calls('QuickRepliesPlugin') def disconnect_from_chat_control(self, chat_control): @@ -47,12 +48,13 @@ class QuickRepliesPlugin(GajimPlugin): control.disconnect_from_chat_control() self.controls = [] - @log_calls('GuiForMePlugin') + @log_calls('QuickRepliesPlugin') def update_button_state(self, chat_control): for base in self.controls: if base.chat_control != chat_control: continue - base.button.set_sensitive(chat_control.msg_textview.get_sensitive()) + base.button.set_sensitive(chat_control.contact.show != 'offline' \ + and gajim.connections[chat_control.account].connected > 0) class Base(object):