Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/isida/vi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiSabler <dissy@ya.ru>2017-08-04 14:34:38 +0300
committerdiSabler <dissy@ya.ru>2017-08-04 14:34:38 +0300
commita7021192014ee10e464c7617743e317c050749a7 (patch)
tree7ec0f36b90b4a0e9202e2249e393d49de4568a9b
parent9a4fdb35b61f50bc7a8e9e326e63596e202b3bc3 (diff)
fix: symlinks for chat id in logs
-rw-r--r--plugins/logger.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/logger.py b/plugins/logger.py
index f97e73e..dff4975 100644
--- a/plugins/logger.py
+++ b/plugins/logger.py
@@ -177,8 +177,15 @@ def logger(raw_in):
CHAT_TITLE = CHAT_ID.get(chat_id,[''])[0]
CHAT_NAME = CHAT_ID.get(chat_id,['', ''])[1]
HB = HTML_BODY.replace('CHATNAME_TITLE', CHAT_TITLE)
- if SYMLINK and CHAT_TITLE and not os.path.exists(LOG_FOLDER % CHAT_TITLE):
- os.symlink(LOG_FOLDER % chat_id, LOG_FOLDER % CHAT_TITLE)
+ if SYMLINK
+ CT = CHAT_TITLE
+ if CHAT_NAME:
+ CT += ' - %s' CHAT_NAME
+ if CT and not os.path.exists(LOG_FOLDER % CT):
+ try:
+ os.symlink(chat_id, LOG_FOLDER % CT)
+ except:
+ pass
if CHAT_NAME:
CHAT_TITLE += ' - <a href="https://t.me/%s" class="title-link" target="_blank">@%s</a>' % (CHAT_NAME, CHAT_NAME)
HB = HB.replace('CHATNAME_LINK', CHAT_TITLE)