Commit 290c7fcd authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Client: Add priority property

parent abddbcbe
......@@ -56,7 +56,7 @@ def __init__(self, account):
self._user = app.config.get_per('accounts', self._account, 'name')
self.password = None
self.priority = 0
self._priority = 0
self.handlers_registered = False
self._connect_machine_calls = 0
self.avatar_conversion = False
......@@ -102,6 +102,10 @@ def status(self):
def status_message(self):
return self._status_message
@property
def priority(self):
return self._priority
@property
def certificate(self):
return self._client.peer_certificate[0]
......@@ -356,16 +360,14 @@ def change_status(self, show, msg, auto=False):
destroy_client=True)
return
priority = app.get_priority(self._account, show)
self._priority = app.get_priority(self._account, show)
self.get_module('Presence').send_presence(
priority=priority,
priority=self._priority,
show=show,
status=msg,
idle_time=auto)
self.priority = priority
self.get_module('MUC').update_presence(auto=auto)
app.nec.push_incoming_event(
......@@ -397,15 +399,13 @@ def connect_machine(self):
self._send_first_presence()
def _send_first_presence(self):
priority = app.get_priority(self._account, self._status)
self._priority = app.get_priority(self._account, self._status)
self.get_module('Presence').send_presence(
priority=priority,
priority=self._priority,
show=self._status,
status=self._status_message)
self.priority = priority
self._set_client_available()
if not self.avatar_conversion:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment