Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_xep_0070.py @ 4270:0d7bb4df2343
Reformatted code base using black.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 19 Jun 2024 18:44:57 +0200 |
parents | 4b842c1fb686 |
children |
comparison
equal
deleted
inserted
replaced
4269:64a85ce8be70 | 4270:0d7bb4df2343 |
---|---|
94 auth_id = auth_elt["id"] | 94 auth_id = auth_elt["id"] |
95 auth_method = auth_elt["method"] | 95 auth_method = auth_elt["method"] |
96 auth_url = auth_elt["url"] | 96 auth_url = auth_elt["url"] |
97 self._dictRequest[client] = (auth_id, auth_method, auth_url, stanzaType, elt) | 97 self._dictRequest[client] = (auth_id, auth_method, auth_url, stanzaType, elt) |
98 title = D_("Auth confirmation") | 98 title = D_("Auth confirmation") |
99 message = D_("{auth_url} needs to validate your identity, do you agree?\n" | 99 message = D_( |
100 "Validation code : {auth_id}\n\n" | 100 "{auth_url} needs to validate your identity, do you agree?\n" |
101 "Please check that this code is the same as on {auth_url}" | 101 "Validation code : {auth_id}\n\n" |
102 ).format(auth_url=auth_url, auth_id=auth_id) | 102 "Please check that this code is the same as on {auth_url}" |
103 d = xml_tools.defer_confirm(self.host, message=message, title=title, | 103 ).format(auth_url=auth_url, auth_id=auth_id) |
104 profile=client.profile) | 104 d = xml_tools.defer_confirm( |
105 self.host, message=message, title=title, profile=client.profile | |
106 ) | |
105 d.addCallback(self._auth_request_callback, client) | 107 d.addCallback(self._auth_request_callback, client) |
106 | 108 |
107 def _auth_request_callback(self, authorized, client): | 109 def _auth_request_callback(self, authorized, client): |
108 try: | 110 try: |
109 auth_id, auth_method, auth_url, stanzaType, elt = self._dictRequest.pop( | 111 auth_id, auth_method, auth_url, stanzaType, elt = self._dictRequest.pop( |
110 client) | 112 client |
113 ) | |
111 except KeyError: | 114 except KeyError: |
112 authorized = False | 115 authorized = False |
113 | 116 |
114 if authorized: | 117 if authorized: |
115 if stanzaType == IQ: | 118 if stanzaType == IQ: |