| ... |
... |
@@ -88,8 +88,10 @@ def __init__(self, con: types.Client) -> None: |
|
88
|
88
|
self._blocked: list[JID] = []
|
|
89
|
89
|
self._enabled = False
|
|
90
|
90
|
|
|
91
|
|
- self._con.connect_signal('state-changed', self._on_client_state_changed)
|
|
92
|
|
- self._con.connect_signal('resume-failed', self._on_client_resume_failed)
|
|
|
91
|
+ self._client.connect_signal('state-changed',
|
|
|
92
|
+ self._on_client_state_changed)
|
|
|
93
|
+ self._client.connect_signal('resume-failed',
|
|
|
94
|
+ self._on_client_resume_failed)
|
|
93
|
95
|
|
|
94
|
96
|
def _on_client_resume_failed(self,
|
|
95
|
97
|
_client: types.Client,
|
| ... |
... |
@@ -120,7 +122,7 @@ def _set_enabled(self, value: bool) -> None: |
|
120
|
122
|
2, self._check_last_interaction)
|
|
121
|
123
|
else:
|
|
122
|
124
|
self.cleanup()
|
|
123
|
|
- self._con.get_module('Contacts').force_chatstate_update()
|
|
|
125
|
+ self._client.get_module('Contacts').force_chatstate_update()
|
|
124
|
126
|
|
|
125
|
127
|
@ensure_enabled
|
|
126
|
128
|
def _presence_received(self,
|
| ... |
... |
@@ -251,7 +253,7 @@ def get_active_chatstate(self, |
|
251
|
253
|
|
|
252
|
254
|
if not contact.is_groupchat:
|
|
253
|
255
|
# Don’t send chatstates to ourself
|
|
254
|
|
- if self._con.get_own_jid().bare_match(contact.jid):
|
|
|
256
|
+ if self._client.is_own_jid(contact.jid):
|
|
255
|
257
|
return None
|
|
256
|
258
|
|
|
257
|
259
|
if not contact.supports(Namespace.CHATSTATES):
|
| ... |
... |
@@ -284,7 +286,7 @@ def set_chatstate_delayed(self, |
|
284
|
286
|
# User starts writing again.
|
|
285
|
287
|
|
|
286
|
288
|
# Don’t send chatstates to ourself
|
|
287
|
|
- if self._con.get_own_jid().bare_match(contact.jid):
|
|
|
289
|
+ if self._client.is_own_jid(contact.jid):
|
|
288
|
290
|
return
|
|
289
|
291
|
|
|
290
|
292
|
self.remove_delay_timeout(contact)
|
| ... |
... |
@@ -294,7 +296,7 @@ def set_chatstate_delayed(self, |
|
294
|
296
|
@ensure_enabled
|
|
295
|
297
|
def set_chatstate(self, contact: types.ChatContactT, state: State) -> None:
|
|
296
|
298
|
# Don’t send chatstates to ourself
|
|
297
|
|
- if self._con.get_own_jid().bare_match(contact.jid):
|
|
|
299
|
+ if self._client.is_own_jid(contact.jid):
|
|
298
|
300
|
return
|
|
299
|
301
|
|
|
300
|
302
|
if contact.jid in self._blocked:
|
| ... |
... |
@@ -364,7 +366,7 @@ def _send_chatstate(self, |
|
364
|
366
|
chatstate=chatstate.value,
|
|
365
|
367
|
play_sound=False)
|
|
366
|
368
|
|
|
367
|
|
- self._con.send_message(message)
|
|
|
369
|
+ self._client.send_message(message)
|
|
368
|
370
|
|
|
369
|
371
|
@ensure_enabled
|
|
370
|
372
|
def set_mouse_activity(self,
|