diff --git a/src/message_control.py b/src/message_control.py index 3c99f9dc1..ac623f1a0 100644 --- a/src/message_control.py +++ b/src/message_control.py @@ -59,6 +59,11 @@ class MessageControl: # Autoconnect glade signals self.xml.signal_autoconnect(self) + def get_full_jid(self): + fjid = self.contact.jid + if self.resource: + fjid += '/' + self.resource + def set_control_active(self, state): '''Called when the control becomes active (state is True) or inactive (state is False)''' diff --git a/src/message_window.py b/src/message_window.py index 050da2cf1..306ecdca1 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -139,9 +139,7 @@ class MessageWindow: def new_tab(self, control): if not self._controls.has_key(control.account): self._controls[control.account] = {} - fjid = control.contact.jid - if control.resource: - fjid += '/' + control.resource + fjid = control.get_full_jid() self._controls[control.account][fjid] = control if self.get_num_controls() > 1: @@ -268,7 +266,8 @@ class MessageWindow: self.disconnect_tab_dnd(ctrl.widget) self.notebook.remove_page(self.notebook.page_num(ctrl.widget)) - del self._controls[ctrl.account][ctrl.contact.jid] + fjid = control.get_full_jid() + del self._controls[ctrl.account][fjid] if len(self._controls[ctrl.account]) == 0: del self._controls[ctrl.account]