reconnection fixes
This commit is contained in:
parent
b227ed627a
commit
0cfb8efefa
2 changed files with 8 additions and 3 deletions
|
@ -193,7 +193,7 @@ class Contact(basecontact.BaseContact):
|
||||||
if not self._search_index:
|
if not self._search_index:
|
||||||
return None
|
return None
|
||||||
for i in range(self._search_index + 1, 0):
|
for i in range(self._search_index + 1, 0):
|
||||||
if type(self._corr[i]) is not TextMessage:
|
if self._corr[i].get_type() > 1:
|
||||||
continue
|
continue
|
||||||
message = self._corr[i].get_data()[0]
|
message = self._corr[i].get_data()[0]
|
||||||
if re.search(self._search_string, message, re.IGNORECASE) is not None:
|
if re.search(self._search_string, message, re.IGNORECASE) is not None:
|
||||||
|
|
|
@ -41,6 +41,7 @@ class Profile(basecontact.BaseContact, Singleton):
|
||||||
self._call = calls.AV(tox.AV) # object with data about calls
|
self._call = calls.AV(tox.AV) # object with data about calls
|
||||||
self._incoming_calls = set()
|
self._incoming_calls = set()
|
||||||
self._load_history = True
|
self._load_history = True
|
||||||
|
self._waiting_for_reconnection = False
|
||||||
self._factory = items_factory.ItemsFactory(self._screen.friends_list, self._messages)
|
self._factory = items_factory.ItemsFactory(self._screen.friends_list, self._messages)
|
||||||
settings = Settings.get_instance()
|
settings = Settings.get_instance()
|
||||||
self._sorting = settings['sorting']
|
self._sorting = settings['sorting']
|
||||||
|
@ -87,7 +88,7 @@ class Profile(basecontact.BaseContact, Singleton):
|
||||||
if status is not None:
|
if status is not None:
|
||||||
self._tox.self_set_status(status)
|
self._tox.self_set_status(status)
|
||||||
else:
|
else:
|
||||||
QtCore.QTimer.singleShot(45000, self.reconnect)
|
QtCore.QTimer.singleShot(50000, self.reconnect)
|
||||||
|
|
||||||
def set_name(self, value):
|
def set_name(self, value):
|
||||||
if self.name == value:
|
if self.name == value:
|
||||||
|
@ -855,9 +856,13 @@ class Profile(basecontact.BaseContact, Singleton):
|
||||||
self.update_filtration()
|
self.update_filtration()
|
||||||
|
|
||||||
def reconnect(self):
|
def reconnect(self):
|
||||||
|
if self._waiting_for_reconnection:
|
||||||
|
return
|
||||||
|
self._waiting_for_reconnection = False
|
||||||
if self.status is None or all(list(map(lambda x: x.status is None, self._contacts))) and len(self._contacts):
|
if self.status is None or all(list(map(lambda x: x.status is None, self._contacts))) and len(self._contacts):
|
||||||
|
self._waiting_for_reconnection = True
|
||||||
self.reset(self._screen.reset)
|
self.reset(self._screen.reset)
|
||||||
QtCore.QTimer.singleShot(45000, self.reconnect)
|
QtCore.QTimer.singleShot(50000, self.reconnect)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
for friend in self._contacts:
|
for friend in self._contacts:
|
||||||
|
|
Loading…
Reference in a new issue