da2de42645
[!] Using YAML serilaization instead of sqlite3. You may convert your SQLite db to YAML format using this: (echo "---"; sqlite3 users.db 'select jid,login from users'|sed "s/|/: \'/g;s/$/\'/g") > users.dat [FIX] Fixed repllies [UPD] Sending presence probe after disconnect received — maybe there are another XMPP resource? ☺ [UPD] When XMPP user goes online if Telegram session already established -- resync statuses with Telegram network to get all contacts online immediately
20 lines
561 B
Ruby
20 lines
561 B
Ruby
# Some very important libraries'
|
|
require 'yaml'
|
|
require 'logger'
|
|
require 'xmpp4r'
|
|
require 'xmpp4r/discovery'
|
|
require 'digest'
|
|
require 'base64'
|
|
require 'fileutils'
|
|
require 'tdlib-ruby'
|
|
require_relative 'inc/telegramclient'
|
|
require_relative 'inc/xmppregister'
|
|
require_relative 'inc/xmppgateway'
|
|
require_relative 'inc/xmppcomponent'
|
|
|
|
# configuration
|
|
Config = YAML.load_file(File.dirname(__FILE__) + '/config.yml')
|
|
TelegramClient.configure(Config['telegram']) # configure tdlib
|
|
Zhabogram = XMPPComponent.new(Config['xmpp']) # spawn zhabogram
|
|
Zhabogram.connect()
|