Release 1.3.2

[FIX] fixed status-update function
[FIX] trying to decrease memory leaks by using chats and message database
pull/1/head
annelin 5 years ago
parent 7122db0e31
commit c2ff64b0bd

@ -18,8 +18,8 @@ class TelegramClient
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.use_file_database = true # wow
config.client.use_message_database = false # such library
config.client.use_chat_info_database = false # much options
config.client.use_message_database = true # such library
config.client.use_chat_info_database = true # much options
config.client.enable_storage_optimizer = false # ...
end
TD::Api.set_log_verbosity_level(params['verbosity'] || 1)
@ -380,7 +380,7 @@ class TelegramClient
# sync statuses with XMPP roster
def sync_status()
@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
# convert telegram status to XMPP one

@ -84,7 +84,7 @@ class XMPPComponent
@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.stop()
rescue Interrupt
rescue Interrupt, SignalException
@logger.error 'Interrupted!'
@component.on_exception do |exception,| end
self.disconnect()

Loading…
Cancel
Save