# `misc` – Miscellaneous XSOs

This subpackage bundles XSO definitions for several XEPs. They do not get their own subpackage because they often only define one or two XSOs without any logic involved. The XSOs are often intended for re-use by other protocols.

## Out of Band Data (XEP-0066)

class aioxmpp.misc.OOBExtension(*args, **kwargs)

aioxmpp.Message.xep0066_oob

## Delayed Delivery (XEP-0203)

class aioxmpp.misc.Delay

  A marker indicating delayed delivery of a stanza.

  from_

    The address as `aioxmpp.JID` of the entity where the stanza was delayed. May be `None`.

  stamp

    The timestamp (as `datetime.datetime`) at which the stanza was originally sent or intended to be sent.

  reason

    The reason for which the stanza was delayed or `None`.

  Warning

  Please take the security considerations of XEP-0203 into account.

aioxmpp.Message.xep0203_delay

  A `Delay` instance which indicates that the message has been delivered with delay.

## Stanza Forwarding (XEP-0297)

class aioxmpp.misc.Forwarded

  Wrap a stanza for forwarding.

  delay

    If not `None`, this is a `aioxmpp.misc.Delay` XSO which indicates the timestamp at which the wrapped stanza was originally sent.

  stanza

    The forwarded stanza.

  Warning

  Please take the security considerations of XEP-0297 and the protocol using this XSO into account.

## Last Message Correction (XEP-0308)

class aioxmpp.misc.Replace

  A marker indicating that the stanza is the correction of another one

  id_

    The identifier of the stanza to correct.

aioxmpp.Message.xep308_replace

  A `Replace` instance which indicates that the message is supposed to replcae another message.

## Chat Markers (XEP-0333)

class aioxmpp.misc.ReceivedMarker(*args, **kwargs)

class aioxmpp.misc.DisplayedMarker(*args, **kwargs)

class aioxmpp.misc.AcknowledgedMarker(*args, **kwargs)

aioxmpp.Message.xep0333_marker

## JSON Containers (XEP-0335)

XEP-0335 defines a standard way to transport JSON data in XMPP. The `JSONContainer` is an XSO class which represents the `<json/>` element specified in XEP-0335.

`aioxmpp` also provides an `AbstractElementType` called `JSONContainerType` which can be used to extract JSON data from an element using the `JSONContainer` format.

class aioxmpp.misc.JSONContainer(*args, **kwargs)

  XSO which represents the JSON container specified in XEP-0335.

  This is a full XSO and not an attribute descriptor. It is registered as pubsub payload by default.

class aioxmpp.misc.JSONContainerType

  XSO element type to unwrap JSON container payloads specified in XEP-0335.

  This type is designed to be used with the ChildValue* descriptors provided in `aioxmpp.xso`, for example with `aioxmpp.xso.ChildValue` or `aioxmpp.xso.ChildValueList`.

      class HTTPRESTMessage(aioxmpp.xso.XSO):
          TAG = ("https://neverdothis.example", "http-rest")

          method = aioxmpp.xso.Attr("method")

          payload = aioxmpp.xso.ChildValue(
              type_=aioxmpp.misc.JSONContainerType
          )

## Unique and Stable Stanza IDs (XEP-0359)

XEP-0359 defines a way to attach additional IDs to a stanza, allowing entities on the path from the sender to the recipient to signal under which ID they know a specific stanza. This is most notably used by MAM (XEP-0313).

class aioxmpp.misc.StanzaID(*[, id_][, by])

  Represent a XEP-0359 Stanza ID.

  Parameters:

    - id – The stanza ID to set

    - by (`aioxmpp.JID`) – The entity which has set the stanza ID

  id_

    The assigned stanza ID.

  by

    The entity who has assigned the stanza ID.

  Warning

  Stanza IDs may be spoofed. Please take the security considerations of XEP-0359 and the protocols using it into account.

class aioxmpp.misc.OriginID

  Represent a XEP-0359 Origin ID.

  Parameters:

    id – The origin ID to set

  id_

    The assigned origin ID.

  Warning

  Origin IDs may be spoofed. Please take the security considerations of XEP-0359 and the protocols using it into account.

aioxmpp.Message.xep0359_stanza_ids

  This is a mapping which associates the by value of a stanza ID with the list of IDs (as strings or `None` if the attribute was not set) assigned by that entity. Normally, there should only ever be a single ID assigned, but misbehaving parties on the path could inject IDs for other entities.

  To allow code handling the ID selection deterministically in such cases, all IDs are exposed.

aioxmpp.Message.xep0359_origin_id

  The `OriginID` object, if any.

## Pre-Authenticated Roster Subcription (XEP-0379)

class aioxmpp.misc.Preauth(*args, **kwargs)

  The preauth element for Pre-Authenticated Roster Subcription.

  token

    The pre-auth token associated with this subscription request.

aioxmpp.Presence.xep0379_preauth

  The pre-auth element associate with a subscription request.

## Current Jabber OpenPGP Usage (XEP-0027)

class aioxmpp.misc.OpenPGPEncrypted(*args, **kwargs)

  Wrapper around an ASCII-armored OpenPGP encrypted blob.

  Warning

  Please see the security considerations of XEP-0027 before making use of this protocol. Consider implementation of XEP-0373 instead.

  See XEP-0027 for details.

  payload

    The character data of the wrapper element.

    Note

    While the wire format is base64, since the base64 output is intended to be passed verbatim to OpenPGP, the payload is declared as normal string and aioxmpp will not de-base64 it for you (and vice versa).

class aioxmpp.misc.OpenPGPSigned(*args, **kwargs)

  Wrapper around an ASCII-armored OpenPGP signed blob.

  Warning

  Please see the security considerations of XEP-0027 before making use of this protocol. Consider implementation of XEP-0373 instead.

  See XEP-0027 for details.

  payload

    The character data of the wrapper element.

    Note

    While the wire format is base64, since the base64 output is intended to be passed verbatim to OpenPGP, the payload is declared as normal string and aioxmpp will not de-base64 it for you (and vice versa).

aioxmpp.Message.xep0027_encrypted

  Instance of `OpenPGPEncrypted`, if present.

  Note

  XEP-0027 does not specify the signing of messages.

aioxmpp.Presence.xep0027_signed

  Instance of `OpenPGPSigned`, if present.