88c7eb09da
Warning! It is beta software and it has not been tested thoroughly. [UPD] Code restructurization. Removed unneccessary XMPPSession class. [UPD] Recuded memory consumption. [UPD] Seems like memory leaks fixed too, need test a bit longer [UPD] Now running in forever-loop, use double Ctrl+C to quit [ADD] Admin commands /sessions, /debug and /restart [ADD] New config parameters: xmpp->debug to print XML stream and xmpp->admins[] to give access to above mentioned /commands [ADD] We can now use memory profiler to get detailed memory usage information: run application with --profiler key (and also gem install memprof2) (yes, fucking leaks...) [FIX] Fixed secret chat closing (I hope so...)
21 lines
620 B
Ruby
21 lines
620 B
Ruby
# Some very important libraries'
|
|
require 'yaml'
|
|
require 'logger'
|
|
require 'xmpp4r'
|
|
require 'digest'
|
|
require 'base64'
|
|
require 'sqlite3'
|
|
require 'tdlib-ruby'
|
|
require 'memprof2' if ARGV.include? '--profiler'
|
|
require_relative 'inc/telegramclient'
|
|
require_relative 'inc/xmppcomponent'
|
|
|
|
# profiler #
|
|
Memprof2.start if defined? Memprof2
|
|
|
|
# configuration
|
|
Config = YAML.load_file(File.dirname(__FILE__) + '/config.yml')
|
|
TelegramClient.configure(Config['telegram']) # configure tdlib
|
|
Zhabogram = XMPPComponent.new(Config['xmpp']) # spawn zhabogram
|
|
loop do Zhabogram.connect(); sleep(1); end # forever loop jk till double ctrl+c
|