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

github.com/isida/4.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiSabler <dissy@ya.ru>2015-12-30 15:43:36 +0300
committerdiSabler <dissy@ya.ru>2015-12-30 15:43:36 +0300
commitccc4b04d0cc7c626749ab318f1faaec926d0333d (patch)
treedb1249560d1417d6e5d481f6f6aa69d32557f34b
parentdce352449d19942ab33a9be1cd1c94f860e2b681 (diff)
parentaf347080aba4806aa6257bd4fa95017ebfb3507e (diff)
Merge pull request #5 from Atterratio/master
add: enable logins and logouts logging config
-rw-r--r--data/locales/ru.txt4
-rw-r--r--plugins/logger.py53
-rw-r--r--plugins/main.py3
3 files changed, 32 insertions, 28 deletions
diff --git a/data/locales/ru.txt b/data/locales/ru.txt
index a2c8949..901a748 100644
--- a/data/locales/ru.txt
+++ b/data/locales/ru.txt
@@ -1744,6 +1744,7 @@ Troll. Delay between messages for troll command Troll. Задержка отпр
Karma. Minimal karma for allow krama change for participants Karma. Минимальная карма при которой изменение кармы доступно не постоянным участникам
Iq. Allow answer to service discovery Iq. Разрешение отвечать на запрос обзора сервисов
Msgtoadmin. Time limit for next message for msgtoadmin Msgtoadmin. Лимит времени следующей посылки сообщения для команды msgtoadmin
+Logger. Enable logins and logouts logging Logger. Запись в логи входов и выходов
Muc-filter. A kind words count Muc-filter. Счётчик одинаковых слов
Whereis. Frequency for answer check for whereis command Whereis. Частота проверки ответа для команды whereis
Kernel. Bot status. Show different status for bot loading Kernel. Bot status. Особый статус при загрузке
@@ -1858,5 +1859,6 @@ API settings Настройки API
World of Tanks settings Настройки плагина World of Tanks
# write locale file: ru.txt
-# total: 1435
+# total: 1436
# regenarated without mistakes!
+
diff --git a/plugins/logger.py b/plugins/logger.py
index 3bd8067..556048e 100644
--- a/plugins/logger.py
+++ b/plugins/logger.py
@@ -174,33 +174,34 @@ def presence_logger(room,jid,nick,type,mass,mode,logfile):
if not os.path.exists(curr_path): os.mkdir(curr_path)
curr_file = ['%s/%02d.txt','%s/%02d.html'][GT('html_logs_enable')] % (curr_path,lt[2])
ott = onlytimeadd(lt)
- log_body = ['[%s] ' % ott,'<p><a id="%s" name="%s" href="#%s" class="time">%s</a> ' % (ott,ott,ott,ott)][GT('html_logs_enable')]
- if type == 'unavailable':
- log_body += ['*** %s','<span class="unavailable">%s'][GT('html_logs_enable')] % nick
- if mode and jid != 'None': log_body += ' (%s)' % jid
- if len(exit_type): log_body += ' %s' % exit_type
- else: log_body += ' %s' % L('leave')
- if exit_message != '': log_body += ' (%s)' % exit_message
- if mode and '\r' in mass[4]: log_body += ', %s %s' % (L('Client:'),mass[4].split('\r')[1])
- log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')]
- else:
- log_body += ['*** %s','<span class="status">%s'][GT('html_logs_enable')] % nick
- if not_found == 0:
+ if GT('movement_logs_enable'):
+ log_body = ['[%s] ' % ott,'<p><a id="%s" name="%s" href="#%s" class="time">%s</a> ' % (ott,ott,ott,ott)][GT('html_logs_enable')]
+ if type == 'unavailable':
+ log_body += ['*** %s','<span class="unavailable">%s'][GT('html_logs_enable')] % nick
if mode and jid != 'None': log_body += ' (%s)' % jid
- log_body += ' %s %s' % (L('join as'),L("%s/%s" % (role,affiliation)))
- status_type = '%s_log_join'
- elif not_found == 1:
- log_body += ' %s %s' % (L('now is'),L("%s/%s" % (role,affiliation)))
- if exit_message: log_body += ' (%s)' % exit_message
- elif not_found == 2: status_type = '%s_log_change'
- if not_found == 0 or not_found == 2:
- status_mask = ' %s' if not_found else ', %s'
- if show != 'None': log_body += status_mask % L(status_type % show).replace(status_type % '','')
- else: log_body += status_mask % L(status_type % "online").replace(status_type % '','')
- if priority != 'None': log_body += ' [%s]' % priority
- else: log_body += ' [0]'
- if text != 'None': log_body += ' (%s)' % text
- log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')]
+ if len(exit_type): log_body += ' %s' % exit_type
+ else: log_body += ' %s' % L('leave')
+ if exit_message != '': log_body += ' (%s)' % exit_message
+ if mode and '\r' in mass[4]: log_body += ', %s %s' % (L('Client:'),mass[4].split('\r')[1])
+ log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')]
+ else:
+ log_body += ['*** %s','<span class="status">%s'][GT('html_logs_enable')] % nick
+ if not_found == 0:
+ if mode and jid != 'None': log_body += ' (%s)' % jid
+ log_body += ' %s %s' % (L('join as'),L("%s/%s" % (role,affiliation)))
+ status_type = '%s_log_join'
+ elif not_found == 1:
+ log_body += ' %s %s' % (L('now is'),L("%s/%s" % (role,affiliation)))
+ if exit_message: log_body += ' (%s)' % exit_message
+ elif not_found == 2: status_type = '%s_log_change'
+ if not_found == 0 or not_found == 2:
+ status_mask = ' %s' if not_found else ', %s'
+ if show != 'None': log_body += status_mask % L(status_type % show).replace(status_type % '','')
+ else: log_body += status_mask % L(status_type % "online").replace(status_type % '','')
+ if priority != 'None': log_body += ' [%s]' % priority
+ else: log_body += ' [0]'
+ if text != 'None': log_body += ' (%s)' % text
+ log_body += '%s\n' % ['','</span></p>'][GT('html_logs_enable')]
lht = '%s - %02d/%02d/%02d' % (room,lt[0],lt[1],lt[2])
log_he = ['%s\t\thttp://isida-bot.com\n\n' % lht,log_header+lht+'</title></head><body><div class="main"><div class="top"><div class="heart"><a href="http://isida-bot.com">http://isida-bot.com</a></div><div class="conference">'+lht+'</div></div><div class="container">\n'][GT('html_logs_enable')]
try: log_he += initial_log_users(room,ott) + ['[%s] ' % ott,'<p><a id="%s" name="%s" href="#%s" class="time">%s</a> ' % (ott,ott,ott,ott)][GT('html_logs_enable')] + ['*** %s\n','<span class="topic">%s</span></p>'][GT('html_logs_enable')] % [topics[room],html_escape(topics[room]).replace('\n','<br/>')][GT('html_logs_enable')]
diff --git a/plugins/main.py b/plugins/main.py
index 1ca41f0..f65300c 100644
--- a/plugins/main.py
+++ b/plugins/main.py
@@ -1754,6 +1754,7 @@ config_groups = [config_group_mucfilter,config_group_mucfilter_newbie,config_gro
# XXe - execute latest field by eval
owner_prefs = {'syslogs_enable': ['Logger. Enable system logs','b',True],
+ 'movement_logs_enable':['Logger. Enable logins and logouts logging','b',True],
'status_logs_enable':['Logger. Enable status change logging','b',True],
'aff_role_logs_enable':['Logger. Enable role and affiliation logging','b',True],
'html_logs_enable':['Logger. Html logs. Otherwize in text','b',True],
@@ -1877,7 +1878,7 @@ owner_group_juick = ['Juick settings','#owner-juick',
['juick_user_post_limit','juick_user_post_size','juick_msg_answers_default','juick_user_tags_limit']]
owner_group_logs = ['Logs settings','#owner-logs',
- ['syslogs_enable','status_logs_enable','aff_role_logs_enable','html_logs_enable','html_logs_end_text','chatlogs_logs_gmt']]
+ ['syslogs_enable','status_logs_enable','aff_role_logs_enable','movement_logs_enable','html_logs_enable','html_logs_end_text','chatlogs_logs_gmt']]
owner_group_youtube = ['Youtube settings','#owner-youtube',
['youtube_max_videos','youtube_default_videos','youtube_max_page_size','youtube_default_lang']]