comparison sat/plugins/plugin_xep_0384.py @ 3933:cecf45416403

plugin XEP-0373 and XEP-0374: Implementation of OX and OXIM: GPGME is used as the GPG provider. rel 374
author Syndace <me@syndace.dev>
date Tue, 20 Sep 2022 16:22:18 +0200
parents 42d3110ac9b1
children 8dc6a4cfda4b
comparison
equal deleted inserted replaced
3932:7af29260ecb8 3933:cecf45416403
477 client.jid.userhostJID(), 477 client.jid.userhostJID(),
478 node, 478 node,
479 xml_tools.et_elt_2_domish_elt(element), 479 xml_tools.et_elt_2_domish_elt(element),
480 item_id=str(bundle.device_id), 480 item_id=str(bundle.device_id),
481 extra={ 481 extra={
482 xep_0060.EXTRA_PUBLISH_OPTIONS: { 482 XEP_0060.EXTRA_PUBLISH_OPTIONS: {
483 xep_0060.OPT_MAX_ITEMS: "max" 483 XEP_0060.OPT_MAX_ITEMS: "max"
484 }, 484 },
485 xep_0060.EXTRA_ON_PRECOND_NOT_MET: "raise" 485 XEP_0060.EXTRA_ON_PRECOND_NOT_MET: "raise"
486 } 486 }
487 ) 487 )
488 except (error.StanzaError, Exception) as e: 488 except (error.StanzaError, Exception) as e:
489 if ( 489 if (
490 isinstance(e, error.StanzaError) 490 isinstance(e, error.StanzaError)
517 client.jid.userhostJID(), 517 client.jid.userhostJID(),
518 node, 518 node,
519 xml_tools.et_elt_2_domish_elt(element), 519 xml_tools.et_elt_2_domish_elt(element),
520 item_id=xep_0060.ID_SINGLETON, 520 item_id=xep_0060.ID_SINGLETON,
521 extra={ 521 extra={
522 xep_0060.EXTRA_PUBLISH_OPTIONS: { xep_0060.OPT_MAX_ITEMS: 1 }, 522 XEP_0060.EXTRA_PUBLISH_OPTIONS: { XEP_0060.OPT_MAX_ITEMS: 1 },
523 xep_0060.EXTRA_ON_PRECOND_NOT_MET: "publish_without_options" 523 XEP_0060.EXTRA_ON_PRECOND_NOT_MET: "publish_without_options"
524 } 524 }
525 ) 525 )
526 except Exception as e: 526 except Exception as e:
527 raise omemo.BundleUploadFailed( 527 raise omemo.BundleUploadFailed(
528 f"Bundle upload failed: {bundle}" 528 f"Bundle upload failed: {bundle}"
544 try: 544 try:
545 items, __ = await xep_0060.getItems( 545 items, __ = await xep_0060.getItems(
546 client, 546 client,
547 jid.JID(bare_jid), 547 jid.JID(bare_jid),
548 node, 548 node,
549 max_items=None,
550 item_ids=[ str(device_id) ] 549 item_ids=[ str(device_id) ]
551 ) 550 )
552 except Exception as e: 551 except Exception as e:
553 raise omemo.BundleDownloadFailed( 552 raise omemo.BundleDownloadFailed(
554 f"Bundle download failed for {bare_jid}: {device_id} under" 553 f"Bundle download failed for {bare_jid}: {device_id} under"
651 client.jid.userhostJID(), 650 client.jid.userhostJID(),
652 node, 651 node,
653 xml_tools.et_elt_2_domish_elt(element), 652 xml_tools.et_elt_2_domish_elt(element),
654 item_id=xep_0060.ID_SINGLETON, 653 item_id=xep_0060.ID_SINGLETON,
655 extra={ 654 extra={
656 xep_0060.EXTRA_PUBLISH_OPTIONS: { 655 XEP_0060.EXTRA_PUBLISH_OPTIONS: {
657 xep_0060.OPT_MAX_ITEMS: 1, 656 XEP_0060.OPT_MAX_ITEMS: 1,
658 xep_0060.OPT_ACCESS_MODEL: "open" 657 XEP_0060.OPT_ACCESS_MODEL: "open"
659 }, 658 },
660 xep_0060.EXTRA_ON_PRECOND_NOT_MET: "raise" 659 XEP_0060.EXTRA_ON_PRECOND_NOT_MET: "raise"
661 } 660 }
662 ) 661 )
663 except (error.StanzaError, Exception) as e: 662 except (error.StanzaError, Exception) as e:
664 if ( 663 if (
665 isinstance(e, error.StanzaError) 664 isinstance(e, error.StanzaError)