summaryrefslogtreecommitdiff
path: root/docs/api/plugins/xep_0047.rst
blob: 0e81ae10c56c32ba98f8bb7ea2603eb75938daea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

XEP-0047: In-band Bytestreams
=============================

.. module:: slixmpp.plugins.xep_0047

.. autoclass:: XEP_0047
    :members:
    :exclude-members: session_bind, plugin_init, plugin_end

.. autoclass:: IBBytestream
    :members:

.. _api-0047:

Internal API methods
--------------------

The API here is used to manage streams and authorize. The default handlers
work with the config parameters.

.. glossary::

    authorized_sid (0047 version)
        - **jid**: :class:`~.JID` receiving the stream initiation.
        - **node**:  stream id
        - **ifrom**: who the stream is from.
        - **args**: :class:`~.Iq` of the stream request.
        - **returns**: ``True`` if the stream should be accepted,
          ``False`` otherwise.

        Check if the stream should be accepted. Uses
        the information setup by :term:`preauthorize_sid (0047 version)`
        by default.

    authorized (0047 version)
        - **jid**: :class:`~.JID` receiving the stream initiation.
        - **node**:  stream id
        - **ifrom**: who the stream is from.
        - **args**: :class:`~.Iq` of the stream request.
        - **returns**: ``True`` if the stream should be accepted,
          ``False`` otherwise.

        A fallback handler (run after :term:`authorized_sid (0047 version)`)
        to check if a stream should be accepted. Uses the ``auto_accept``
        parameter by default.

    preauthorize_sid (0047 version)
        - **jid**: :class:`~.JID` receiving the stream initiation.
        - **node**:  stream id
        - **ifrom**: who the stream will be from.
        - **args**: Unused.

        Register a stream id to be accepted automatically (called from
        other plugins such as XEP-0095).

    get_stream
        - **jid**: :class:`~.JID` of local receiver.
        - **node**:  stream id
        - **ifrom**: who the stream is from.
        - **args**: unused
        - **returns**: :class:`~.IBBytestream`

        Return a currently opened stream between two JIDs.

    set_stream
        - **jid**: :class:`~.JID` of local receiver.
        - **node**:  stream id
        - **ifrom**: who the stream is from.
        - **args**: unused

        Register an opened stream between two JIDs.

    del_stream
        - **jid**: :class:`~.JID` of local receiver.
        - **node**:  stream id
        - **ifrom**: who the stream is from.
        - **args**: unused

        Delete a stream between two JIDs.


Stanza elements
---------------

.. automodule:: slixmpp.plugins.xep_0047.stanza
    :members:
    :undoc-members: