db - check if table exists

This commit is contained in:
ingvar1995 2016-03-24 06:49:04 +03:00
parent 3900115d6a
commit c46801c183

View file

@ -561,6 +561,7 @@ class Profile(Contact, Singleton):
if num is not None:
friend = self._friends[num]
friend.clear_corr()
if self._history.friend_exists_in_db(friend.tox_id):
self._history.delete_messages(friend.tox_id)
self._history.delete_friend_from_db(friend.tox_id)
else: # clear all history
@ -648,6 +649,7 @@ class Profile(Contact, Singleton):
"""
friend = self._friends[num]
self.clear_history(num)
if self._history.friend_exists_in_db(friend.tox_id):
self._history.delete_friend_from_db(friend.tox_id)
self._tox.friend_delete(friend.number)
del self._friends[num]