contrib_bots: Switch encrypt bot to use send_reply.

This commit is contained in:
neiljp 2017-05-23 16:59:23 -07:00 committed by Tim Abbott
parent 9c637db2ec
commit ec0de2a7ff

View file

@ -30,20 +30,7 @@ class EncryptHandler(object):
def handle_message(self, message, client, state_handler): def handle_message(self, message, client, state_handler):
bot_response = self.get_bot_encrypt_response(message) bot_response = self.get_bot_encrypt_response(message)
client.send_reply(message, bot_response)
if message['type'] == 'private':
client.send_message(dict(
type='private',
to=message['sender_email'],
content=bot_response,
))
else:
client.send_message(dict(
type='stream',
to=message['display_recipient'],
subject=message['subject'],
content=bot_response,
))
def get_bot_encrypt_response(self, message): def get_bot_encrypt_response(self, message):
original_content = message['content'] original_content = message['content']