Exemple #1
0
def join_chat():
    """Sent by clients when they enter a room.
    A status message is broadcast to all people in the room."""
    backend = get_backend()
    uid = userid()
    chat_info = backend.get_chat_info(uid)
    backend.send(uid,
                 Event.JoinEvent(chat_info.agent_index, uid, str(time.time())))
    return jsonify(message=format_message("You entered the room.", True))
Exemple #2
0
 def __init__(self, session):
     self.session = session
     self.last_message_timestamp = time.time()
     self.queued_event = deque()
     # JoinEvent
     init_event = Event.JoinEvent(self.agent)
     self.queued_event.append(init_event)
     self.prev_action = None
     self.received = False
     self.num_utterances = 0
     self.start_typing = False