Author: js Date: 2008-06-08 17:51:55 +0200 (Sun, 08 Jun 2008) New Revision: 9772
Modified: trunk/src/chat_control.py trunk/src/common/connection.py trunk/src/common/connection_handlers.py Log: * Fix passing of message ID. * Don't asnwer to receipt requests from users not in roster.
Modified: trunk/src/chat_control.py =================================================================== --- trunk/src/chat_control.py 2008-06-08 15:27:05 UTC (rev 9771) +++ trunk/src/chat_control.py 2008-06-08 15:51:55 UTC (rev 9772) @@ -621,13 +621,14 @@ if not message or message == '\n': return 1
+ ret = None + if not process_command or not self._process_command(message): ret = MessageControl.send_message(self, message, keyID, type = type, chatstate = chatstate, msg_id = msg_id, composing_xep = composing_xep, resource = resource, user_nick = self.user_nick) - if ret: - return ret + # Record message history self.save_sent_message(message)
@@ -638,6 +639,8 @@ message_buffer = self.msg_textview.get_buffer() message_buffer.set_text('') # clear message buffer (and tv of course)
+ return ret + def save_sent_message(self, message): # save the message, so user can scroll though the list with key up/down size = len(self.sent_history) @@ -1501,11 +1504,12 @@ gobject.source_remove(self.possible_inactive_timeout_id) self._schedule_activity_timers()
- if not ChatControlBase.send_message(self, message, keyID, type = 'chat', - chatstate = chatstate_to_send, composing_xep = composing_xep, - process_command = process_command): - self.print_conversation(message, self.contact.jid, - encrypted = encrypted) + ChatControlBase.send_message(self, message, keyID, + type = 'chat', chatstate = chatstate_to_send, + composing_xep = composing_xep, + process_command = process_command) + self.print_conversation(message, self.contact.jid, + encrypted = encrypted)
def check_for_possible_paused_chatstate(self, arg): ''' did we move mouse of that window or write something in message
Modified: trunk/src/common/connection.py =================================================================== --- trunk/src/common/connection.py 2008-06-08 15:27:05 UTC (rev 9771) +++ trunk/src/common/connection.py 2008-06-08 15:51:55 UTC (rev 9772) @@ -1126,7 +1126,7 @@ if session.enable_encryption: msg_iq = session.encrypt_stanza(msg_iq)
- self.connection.send(msg_iq) + msg_id = self.connection.send(msg_iq) if not forward_from and session and session.is_loggable(): no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')\ .split() @@ -1148,6 +1148,8 @@ self.dispatch('ERROR', (_('Disk Write Error'), str(e))) self.dispatch('MSGSENT', (jid, msg, keyID))
+ return msg_id + def send_stanza(self, stanza): ''' send a stanza untouched ''' if not self.connection:
Modified: trunk/src/common/connection_handlers.py =================================================================== --- trunk/src/common/connection_handlers.py 2008-06-08 15:27:05 UTC (rev 9771) +++ trunk/src/common/connection_handlers.py 2008-06-08 15:51:55 UTC (rev 9772) @@ -1694,7 +1694,9 @@ # Receipt requested # TODO: We shouldn't answer if we're invisible! if msg.getTag('request', namespace='urn:xmpp:receipts') and \ - gajim.config.get_per('accounts', self.name, 'answer_receipt'): + gajim.config.get_per('accounts', self.name, 'answer_receipt') \ + and gajim.contacts.get_contact_from_full_jid(self.name, frm). \ + sub not in (u'to', u'none'): receipt = common.xmpp.Message(to = jid, typ = 'chat') receipt.setID(msg.getID()) receipt.setTag('received',