From c9358db88310ced61b62229d9014e3de2284a6f8 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Fri, 1 Jul 2016 00:16:59 +0300 Subject: [PATCH] db bug fix --- src/profile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/profile.py b/src/profile.py index b078d14..4850f28 100644 --- a/src/profile.py +++ b/src/profile.py @@ -54,12 +54,15 @@ class Profile(contact.Contact, Singleton): item = self.create_friend_item() name = alias or tox.friend_get_name(i) or tox_id status_message = tox.friend_get_status_message(i) + if not self._history.friend_exists_in_db(tox_id): + self._history.add_friend_to_db(tox_id) message_getter = self._history.messages_getter(tox_id) friend = Friend(message_getter, i, name, status_message, item, tox_id) friend.set_alias(alias) self._friends.append(friend) self.filtration(self._show_online) + # ----------------------------------------------------------------------------------------------------------------- # Edit current user's data # -----------------------------------------------------------------------------------------------------------------