From 38593b7db1fe91f03c765787098270172f0103c0 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sat, 12 Mar 2016 18:34:10 +0300 Subject: [PATCH] add contact fixes --- src/menu.py | 4 +++- src/profile.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/menu.py b/src/menu.py index ed2c2e2..105e012 100644 --- a/src/menu.py +++ b/src/menu.py @@ -36,7 +36,7 @@ class AddContact(CenteredWidget): self.tox_id.setGeometry(QtCore.QRect(50, 40, 471, 27)) self.tox_id.setObjectName("lineEdit") self.label = QtGui.QLabel(self) - self.label.setGeometry(QtCore.QRect(70, 10, 50, 20)) + self.label.setGeometry(QtCore.QRect(30, 10, 80, 20)) self.error_label = QtGui.QLabel(self) self.error_label.setGeometry(QtCore.QRect(120, 10, 400, 20)) font = QtGui.QFont() @@ -67,6 +67,8 @@ class AddContact(CenteredWidget): # request was successful self.close() else: # print error data + if len(send) > 40: + send = send[:40] + '...' self.error_label.setText(send) def retranslateUi(self): diff --git a/src/profile.py b/src/profile.py index b532e7e..06fa238 100644 --- a/src/profile.py +++ b/src/profile.py @@ -494,7 +494,7 @@ class Profile(Contact, Singleton): try: message = message or 'Add me to your contact list' if '@' in tox_id: # value like groupbot@toxme.io - tox_id = tox_dns() + tox_id = tox_dns(tox_id) if tox_id is None: raise Exception('TOX DNS lookup failed') result = self.tox.friend_add(tox_id, message.encode('utf-8'))