service: In dialog list: support entries with unknown names (shouldn't happen)
patch 039674332424c9792bcc0ef23d43f47dd7189644
Author: E. Bosch <presidev@AT@gmail.com>
Date: Sat Mar 18 05:12:31 CET 2023
* service: In dialog list: support entries with unknown names (shouldn't happen)
diff -rN -u old-irgramd/service.py new-irgramd/service.py
--- old-irgramd/service.py 2024-11-22 17:04:33.000603354 +0100
+++ new-irgramd/service.py 2024-11-22 17:04:33.000603354 +0100
@@ -86,7 +86,13 @@
pin = 'Yes' if dialog.pinned else 'No'
arch = 'Yes' if dialog.archived else 'No'
last = compact_date(dialog.date)
- name_in_irc = self.tmp_ircnick if id == self.tg.id else self.tg.tid_to_iid[id]
+ if id == self.tg.id:
+ name_in_irc = self.tmp_ircnick
+ else:
+ if id in self.tg.tid_to_iid.keys():
+ name_in_irc = self.tg.tid_to_iid[id]
+ else:
+ name_in_irc = '<Unknown>'
reply += (' {:<11d} {:<9d} {:<9d} {:4} {:<3} {:<4} {:<6} {}'.format(
id, unr, men, ty, pin, arch, last, name_in_irc),
)