comparison sat/plugins/plugin_xep_0234.py @ 3527:bbf92ef05f38

plugin XEP-0166, XEP-0234: better management of `terminate`: - new `text` argument to specify human readable reason of termination - handling of `FirstError` (used when a error happens in a DeferredList) - handling of `StanzaError` - (XEP-0234): show human readable text of the reason if present
author Goffi <goffi@goffi.org>
date Wed, 05 May 2021 15:37:33 +0200
parents be6d91572633
children 3ef988734869
comparison
equal deleted inserted replaced
3526:e84ffb48acd4 3527:bbf92ef05f38
696 elif not jingle_elt.success: 696 elif not jingle_elt.success:
697 progress_id = self.getProgressId(session, content_name) 697 progress_id = self.getProgressId(session, content_name)
698 first_child = jingle_elt.firstChildElement() 698 first_child = jingle_elt.firstChildElement()
699 if first_child is not None: 699 if first_child is not None:
700 reason = first_child.name 700 reason = first_child.name
701 if jingle_elt.text is not None:
702 reason = f"{reason} - {jingle_elt.text}"
701 else: 703 else:
702 reason = C.PROGRESS_ERROR_FAILED 704 reason = C.PROGRESS_ERROR_FAILED
703 self.host.bridge.progressError( 705 self.host.bridge.progressError(
704 progress_id, reason, client.profile 706 progress_id, reason, client.profile
705 ) 707 )