summaryrefslogtreecommitdiff
path: root/docs/api/plugins/xep_0012.rst
blob: 8e72ee2ab613b54d7f6f40ce39695a88fd375419 (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

XEP-0012: Last Activity
=======================

.. module:: slixmpp.plugins.xep_0012

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


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

This plugin uses an in-memory storage by default to keep track of the
received and sent last activities.

.. glossary::

    get_last_activity
        - **jid**: :class:`~.JID` of whom to retrieve the last activity
        - **node**: unused
        - **ifrom**: who the request is from (None = local)
        - **args**: ``None`` or an :class:`~.Iq` that is requesting the
        - **returns**
          information.

        Get the last activity of a JID from the storage.

    set_last_activity
        - **jid**: :class:`~.JID` of whom to set the last activity
        - **node**: unused
        - **ifrom**: unused
        - **args**: A dict containing ``'seconds'`` and ``'status'``
          ``{'seconds': Optional[int], 'status': Optional[str]}``

        Set the last activity of a JID in the storage.

    del_last_activity
        - **jid**: :class:`~.JID` to delete from the storage
        - **node**: unused
        - **ifrom**: unused
        - **args**: unused

        Remove the last activity of a JID from the storage.


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

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