diff --git a/src/common/connection.py b/src/common/connection.py index 64acabd77..1bb74caff 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -126,7 +126,8 @@ class Connection: 'ACC_OK': [], 'MYVCARD': [], 'OS_INFO': [], 'VCARD': [], 'GC_MSG': [], 'GC_SUBJECT': [], 'GC_CONFIG': [], 'BAD_PASSPHRASE': [], 'ROSTER_INFO': [], 'ERROR_ANSWER': [], 'BOOKMARKS': [], 'CON_TYPE': [], - 'FILE_REQUEST': [], 'FILE_RCV_COMPLETED': [], 'FILE_PROGRESS': [] + 'FILE_REQUEST': [], 'FILE_RCV_COMPLETED': [], 'FILE_PROGRESS': [], + 'STANZA_ARRIVED': [] } self.name = name self.connected = 0 # offline @@ -868,6 +869,7 @@ class Connection: self.dispatch('ERROR_ANSWER', (id, jid_from, errmsg, errcode)) def _StanzaArrivedCB(self, con, obj): + self.dispatch('STANZA_ARRIVED', str(obj)) self.last_incoming = time.time() self.keep_alive_sent = False diff --git a/src/dialogs.py b/src/dialogs.py index 18788ce2a..177810111 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -1357,6 +1357,11 @@ class XMLConsoleWindow: self.xml.signal_autoconnect(self) self.window.show_all() + def print_incomming_stanza(self, stanza): + buffer = self.stanzas_log_textview.get_buffer() + end_iter = buffer.get_end_iter() + buffer.insert(end_iter, stanza) + def on_send_button_clicked(self, widget): begin_iter, end_iter = self.input_tv_buffer.get_bounds() stanza = self.input_tv_buffer.get_text(begin_iter, end_iter) diff --git a/src/gajim.py b/src/gajim.py index a84108a76..18747abfb 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -760,6 +760,11 @@ class Interface: instance = dialogs.PopupNotificationWindow(self, event_type, jid, account, msg_type, file_props) self.roster.popup_notification_windows.append(instance) + + def handle_event_stanza_arrived(self, account, stanza): + if self.windows[account].has_key('xml_console'): + self.windows[account]['xml_console'].print_incomming_stanza(stanza) + def read_sleepy(self): '''Check idle status and change that status if needed''' if not self.sleeper.poll(): @@ -926,6 +931,7 @@ class Interface: con.register_handler('BOOKMARKS', self.handle_event_bookmarks) con.register_handler('CON_TYPE', self.handle_event_con_type) con.register_handler('FILE_REQUEST', self.handle_event_file_request) + con.register_handler('STANZA_ARRIVED', self.handle_event_stanza_arrived) def process_connections(self): try: