check welcome message 'send' too
This commit is contained in:
parent
1db485d493
commit
82cdadae80
|
@ -68,6 +68,8 @@ class Channel:
|
||||||
timeout=self._timeout)
|
timeout=self._timeout)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
resp = r.json()
|
resp = r.json()
|
||||||
|
if "welcome" in resp:
|
||||||
|
self._handle_welcome(resp["welcome"])
|
||||||
self._add_inbound_messages(resp["messages"])
|
self._add_inbound_messages(resp["messages"])
|
||||||
|
|
||||||
def get_first_of(self, phases):
|
def get_first_of(self, phases):
|
||||||
|
|
|
@ -106,6 +106,11 @@ class Channel:
|
||||||
"phase": phase,
|
"phase": phase,
|
||||||
"body": hexlify(msg).decode("ascii")}
|
"body": hexlify(msg).decode("ascii")}
|
||||||
d = post_json(self._agent, self._relay_url+"add", payload)
|
d = post_json(self._agent, self._relay_url+"add", payload)
|
||||||
|
def _maybe_handle_welcome(resp):
|
||||||
|
if "welcome" in resp:
|
||||||
|
self._handle_welcome(resp["welcome"])
|
||||||
|
return resp
|
||||||
|
d.addCallback(_maybe_handle_welcome)
|
||||||
d.addCallback(lambda resp: self._add_inbound_messages(resp["messages"]))
|
d.addCallback(lambda resp: self._add_inbound_messages(resp["messages"]))
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user