From 3582722faa9623061da29331a8f35fc9d3cd16ee Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 13 Sep 2018 23:23:25 +0300 Subject: [PATCH] fixed 2 bugs with gc --- toxygen/mainscreen.py | 2 +- toxygen/profile.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/toxygen/mainscreen.py b/toxygen/mainscreen.py index 7d7b9e7..93ec72d 100644 --- a/toxygen/mainscreen.py +++ b/toxygen/mainscreen.py @@ -618,7 +618,7 @@ class MainWindow(QtWidgets.QMainWindow, Singleton): for i in range(len(chats)): name, number = chats[i] item = invite_menu.addAction(name) - item.triggered.connect(lambda: self.invite_friend_to_gc(num, number)) + item.triggered.connect(lambda number=number: self.invite_friend_to_gc(num, number)) plugins_loader = plugin_support.PluginLoader.get_instance() if plugins_loader is not None: diff --git a/toxygen/profile.py b/toxygen/profile.py index 16d117d..ec5b545 100644 --- a/toxygen/profile.py +++ b/toxygen/profile.py @@ -1316,6 +1316,8 @@ class Profile(basecontact.BaseContact, Singleton): return list(groups)[0] def add_gc(self, number): + if number == -1: + return widget = self.create_friend_item() gc = GroupChat('Group chat #' + str(number), '', widget, self._tox, number) self._contacts.append(gc)