hey I'm just added OTR support ☺

pull/1/head
annelin 5 years ago
parent 3f78178d60
commit 7a2f85e0fe

@ -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 #

@ -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 #

Loading…
Cancel
Save