| | 154 | if gajim.otr_module: |
| | 155 | if type == 'chat' and isinstance(message, unicode): |
| | 156 | d = {'kwargs':{'keyID':keyID, 'type':type, |
| | 157 | 'chatstate':chatstate, 'msg_id':msg_id, |
| | 158 | 'composing_xep':composing_xep, 'resource':self.resource, |
| | 159 | 'user_nick':user_nick, 'session':self.session, |
| | 160 | 'original_message':original_message}, 'account':self.account} |
| | 161 | |
| | 162 | new_msg = gajim.otr_module.otrl_message_sending( |
| | 163 | gajim.otr_userstates[self.account], |
| | 164 | (gajim.otr_ui_ops, d), |
| | 165 | gajim.get_jid_from_account(self.account).encode(), gajim.OTR_PROTO, |
| | 166 | self.contact.get_full_jid().encode(), message.encode(), None) |
| | 167 | |
| | 168 | context = gajim.otr_module.otrl_context_find( |
| | 169 | gajim.otr_userstates[self.account], |
| | 170 | self.contact.get_full_jid().encode(), |
| | 171 | gajim.get_jid_from_account(self.account).encode(), |
| | 172 | gajim.OTR_PROTO, 1)[0] |
| | 173 | |
| | 174 | print repr(context.accountname), repr(context.username) |
| | 175 | |
| | 176 | # we send all because inject_message can filter on HTML stuff then |
| | 177 | gajim.otr_module.otrl_message_fragment_and_send( |
| | 178 | (gajim.otr_ui_ops, d), |
| | 179 | context, new_msg, gajim.otr_module.OTRL_FRAGMENT_SEND_ALL) |
| | 180 | return |
| | 181 | |