plugin XEP-0166, 0176, 0234: minor renaming + type hints
This commit is contained in:
parent
1781694141
commit
5c6578a1f6
1 changed files with 20 additions and 9 deletions
|
|
@ -697,20 +697,20 @@ class XEP_0234:
|
|||
else:
|
||||
raise NotImplementedError
|
||||
|
||||
def jingle_terminate(self, client, action, session, content_name, jingle_elt):
|
||||
if jingle_elt.decline:
|
||||
def jingle_terminate(self, client, action, session, content_name, reason_elt):
|
||||
if reason_elt.decline:
|
||||
# progress is the only way to tell to frontends that session has been declined
|
||||
progress_id = self.get_progress_id(session, content_name)
|
||||
self.host.bridge.progress_error(
|
||||
progress_id, C.PROGRESS_ERROR_DECLINED, client.profile
|
||||
)
|
||||
elif not jingle_elt.success:
|
||||
elif not reason_elt.success:
|
||||
progress_id = self.get_progress_id(session, content_name)
|
||||
first_child = jingle_elt.firstChildElement()
|
||||
first_child = reason_elt.firstChildElement()
|
||||
if first_child is not None:
|
||||
reason = first_child.name
|
||||
if jingle_elt.text is not None:
|
||||
reason = f"{reason} - {jingle_elt.text}"
|
||||
if reason_elt.text is not None:
|
||||
reason = f"{reason} - {reason_elt.text}"
|
||||
else:
|
||||
reason = C.PROGRESS_ERROR_FAILED
|
||||
self.host.bridge.progress_error(
|
||||
|
|
|
|||
Loading…
Reference in a new issue