hey I'm just added OTR support ☺

This commit is contained in:
annelin 2019-06-20 19:29:06 +03:00
parent 3f78178d60
commit 7a2f85e0fe
2 changed files with 6 additions and 3 deletions

View file

@ -165,9 +165,12 @@ class TelegramClient
prefix += (update.message.chat_id < 0 and text and text != "") ? "\n" : '' # \n if it is groupchat and message is not empty
prefix += (update.message.chat_id > 0 and text and text != "") ? " | " : ''
# OTR support
text = prefix + text unless text.start_with? '?OTR'
# read message & send it to xmpp
@client.view_messages(update.message.chat_id, [update.message.id], force_read: true)
@xmpp.message(@jid, update.message.chat_id.to_s, prefix + text)
@xmpp.message(@jid, update.message.chat_id.to_s, text)
end
# new chat update -- when tg client discovers new chat #

View file

@ -134,8 +134,8 @@ class XMPPComponent
req.add_element('nick', {'xmlns' => 'http://jabber.org/protocol/nick'} ).add_text(nickname) unless nickname.nil? # nickname
req.add_element('x', {'xmlns' => 'vcard-temp:x:update'} ).add_element("photo").add_text(photo) unless photo.nil? # nickname
@logger.debug req.to_s
#(immediately) ? @component.send(req) : @presence_que.store(req.from.to_s+req.to.to_s, req)
@component.send(req)
(immediately) ? @component.send(req) : @presence_que.store(req.from.to_s+req.to.to_s, req)
# @component.send(req)
end
# request timezone information #