|
|
|
@ -140,28 +140,6 @@ class Operator(Keymaker):
|
|
|
|
|
return TheTelephone()
|
|
|
|
|
return Caller(name)
|
|
|
|
|
|
|
|
|
|
def route_msg(msg_obj)
|
|
|
|
|
# decrypt
|
|
|
|
|
if resp_msg_obj.is_encrypted:
|
|
|
|
|
resp_msg_obj.decrypt()
|
|
|
|
|
# are there instructions for us?
|
|
|
|
|
if resp_msg_obj.route:
|
|
|
|
|
# get result from routing
|
|
|
|
|
self.log(f'routing msg to self.{msg_obj.route}(**{msg_obj.data})')
|
|
|
|
|
response = self.route(msg_obj.data, route=msg_obj.route)
|
|
|
|
|
self.log('route response:',response)
|
|
|
|
|
# can we pass the buck on?
|
|
|
|
|
elif msg_obj.has_embedded_msg:
|
|
|
|
|
embedded_msg = msg_obj.msg
|
|
|
|
|
embedded_recipient = embedded_msg.to_whom
|
|
|
|
|
# whew, then we can make someone else take the phone
|
|
|
|
|
self.log(f'passing msg onto {embedded_recipient} ...')
|
|
|
|
|
|
|
|
|
|
response = embedded_recipient.pronto_pronto(embedded_msg).msg_d
|
|
|
|
|
self.log(f'passed msg onto {embedded_recipient}, got this response: {response} ...')
|
|
|
|
|
# otherwise what are we doing?
|
|
|
|
|
else:
|
|
|
|
|
raise KomradeException('No route, no embedded msg. What to do?')
|
|
|
|
|
|
|
|
|
|
def ring_ring(self,msg,to_whom,get_resp_from=None):
|
|
|
|
|
# ring ring
|
|
|
|
@ -222,8 +200,10 @@ class Operator(Keymaker):
|
|
|
|
|
self.log(f'passed msg onto {embedded_recipient}, got this response: {response} ...')
|
|
|
|
|
# otherwise what are we doing?
|
|
|
|
|
else:
|
|
|
|
|
#raise KomradeException('No route, no embedded msg. What to do?')
|
|
|
|
|
return msg_obj.msg_d
|
|
|
|
|
response = msg_obj.msg_d
|
|
|
|
|
|
|
|
|
|
# ???
|
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
def pronto_pronto(self, msg_obj):
|
|
|
|
|
self.log(f'''
|
|
|
|
|