Skip to content

Commit 70c66dd

Browse files
committed
fix notifications
1 parent 47ae3ca commit 70c66dd

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

ncTelegram/__init__.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ def display_notif(self, msg):
105105
if self.conf['general']['notification']:
106106
text = msg['text']
107107

108-
try:
109-
sender = msg['to']['title'] + ": " + msg['from']['first_name']
110-
except:
111-
sender = msg['from']['first_name']
108+
if msg['receiver']['type'] == 'user':
109+
sender = msg['sender']['first_name']
110+
else:
111+
sender = msg['receiver']['name'] + ": " + msg['sender']['first_name']
112+
112113

113114
Notify.Notification.new('', '<b>' + sender + '</b>\n' + text, self.image).show()
114115

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from distutils.core import setup
44

55
setup(name='ncTelegram',
6-
version='0.9.1',
6+
version='0.9.3',
77
description='A curse Telegram client',
88
license='GPLv3',
99
author='Sébastien Lemaire',
@@ -12,6 +12,6 @@
1212
scripts=['nctelegram'],
1313
data_files=[('/etc', ['ncTelegram.conf']),
1414
('/usr/share/ncTelegram', ['t_logo.png']),],
15-
install_requires=["pytg==0.4.5"]
15+
install_requires=["pytg>=0.4.6"]
1616

1717
)

0 commit comments

Comments
 (0)