| | 1774 | |
| | 1775 | if gajim.otr_module: |
| | 1776 | # disconnect from ENCRYPTED OTR contexts when going |
| | 1777 | # offline/invisible |
| | 1778 | if status == 'offline' or status == 'invisible': |
| | 1779 | ctx = gajim.otr_userstates[account].context_root |
| | 1780 | while ctx is not None: |
| | 1781 | if ctx.msgstate == gajim.otr_module.OTRL_MSGSTATE_ENCRYPTED: |
| | 1782 | disconnected = True |
| | 1783 | gajim.otr_module.otrl_message_disconnect(gajim.otr_userstates[account], |
| | 1784 | (gajim.otr_ui_ops, |
| | 1785 | {'account':account,'urgent':True}), ctx.accountname, |
| | 1786 | ctx.protocol, ctx.username) |
| | 1787 | ctx = ctx.next |