comparison sat/plugins/plugin_xep_0054.py @ 3199:5afd7416ca2d

plugin XEP-0054: fixed use of current dir instead of empty string
author Goffi <goffi@goffi.org>
date Sun, 01 Mar 2020 18:33:16 +0100
parents 554b3b632378
children 6cf4bd6972c2
comparison
equal deleted inserted replaced
3198:08151c103636 3199:5afd7416ca2d
19 # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 20
21 import mimetypes 21 import mimetypes
22 from base64 import b64decode, b64encode 22 from base64 import b64decode, b64encode
23 from hashlib import sha1 23 from hashlib import sha1
24 from pathlib import Path
25 from zope.interface import implementer 24 from zope.interface import implementer
26 from twisted.internet import threads, defer 25 from twisted.internet import threads, defer
27 from twisted.words.protocols.jabber import jid, error 26 from twisted.words.protocols.jabber import jid, error
28 from twisted.words.xish import domish 27 from twisted.words.xish import domish
29 from twisted.python.failure import Failure 28 from twisted.python.failure import Failure
433 if full_path is None: 432 if full_path is None:
434 # cache file is not available (probably expired) 433 # cache file is not available (probably expired)
435 raise KeyError 434 raise KeyError
436 else: 435 else:
437 # avatar has already been checked but it is not set 436 # avatar has already been checked but it is not set
438 full_path = Path("") 437 full_path = ""
439 except KeyError: 438 except KeyError:
440 # avatar is not in cache 439 # avatar is not in cache
441 if cache_only: 440 if cache_only:
442 return defer.fail(Failure(exceptions.NotFound())) 441 return defer.fail(Failure(exceptions.NotFound()))
443 # we request vCard to get avatar 442 # we request vCard to get avatar