Release 1.3.2

[FIX] fixed status-update function
[FIX] trying to decrease memory leaks by using chats and message database
This commit is contained in:
annelin 2019-06-13 13:12:59 +03:00
parent 7122db0e31
commit c2ff64b0bd
2 changed files with 4 additions and 4 deletions

View file

@ -18,8 +18,8 @@ class TelegramClient
config.client.use_test_dc = params['use_test_dc'] || false config.client.use_test_dc = params['use_test_dc'] || false
config.client.system_version = '42' # I think I have permission to hardcode The Ultimate Question of Life, the Universe, and Everything?.. config.client.system_version = '42' # I think I have permission to hardcode The Ultimate Question of Life, the Universe, and Everything?..
config.client.use_file_database = true # wow config.client.use_file_database = true # wow
config.client.use_message_database = false # such library config.client.use_message_database = true # such library
config.client.use_chat_info_database = false # much options config.client.use_chat_info_database = true # much options
config.client.enable_storage_optimizer = false # ... config.client.enable_storage_optimizer = false # ...
end end
TD::Api.set_log_verbosity_level(params['verbosity'] || 1) TD::Api.set_log_verbosity_level(params['verbosity'] || 1)
@ -380,7 +380,7 @@ class TelegramClient
# sync statuses with XMPP roster # sync statuses with XMPP roster
def sync_status() def sync_status()
@logger.debug "Syncing statuses with roster.." @logger.debug "Syncing statuses with roster.."
@cache[:chats].each do |chat| self.process_status_update(chat.id, (@cache[:users].include? chat.id ? @cache[:users][chat.id].status : chat.title.to_s), true) end @cache[:chats].each_value do |chat| self.process_status_update(chat.id, (chat.id > 0 and @cache[:users].include? chat.id) ? @cache[:users][chat.id].status : chat.title.to_s, true) end
end end
# convert telegram status to XMPP one # convert telegram status to XMPP one

View file

@ -84,7 +84,7 @@ class XMPPComponent
@sessions.each do |jid, session| self.presence(jid, nil, :subscribe) end @sessions.each do |jid, session| self.presence(jid, nil, :subscribe) end
Thread.new { while @component.is_connected? do @presence_que.each_value { |p| @component.send(p) }; @presence_que.clear; sleep(60); end } # presence updater thread Thread.new { while @component.is_connected? do @presence_que.each_value { |p| @component.send(p) }; @presence_que.clear; sleep(60); end } # presence updater thread
Thread.stop() Thread.stop()
rescue Interrupt rescue Interrupt, SignalException
@logger.error 'Interrupted!' @logger.error 'Interrupted!'
@component.on_exception do |exception,| end @component.on_exception do |exception,| end
self.disconnect() self.disconnect()