events.rst 6.02 KB
Newer Older
1 2 3 4 5 6 7 8 9
Event Index
===========

The following events are poezio-only events, for SleekXMPP events, check out
`their index <http://sleekxmpp.com/event_index.html>`_.

.. glossary::
    :sorted:

mathieui's avatar
mathieui committed
10 11 12 13 14 15
    tab_change
        - **old_tab_nb:** :py:class:`int` Old current tab number.
        - **new_tab_nb:** :py:class:`int` New current tab number.

        Triggered whenever the user switches between tabs.

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
    muc_say
        - **message:** :py:class:`~sleekxmpp.Message` that will be sent
        - **tab:** :py:class:`~tabs.MucTab` source

        Triggered whenever the user sends a message to a :py:class:`~tabs.MucTab`.

    muc_say_after
        - **message:** :py:class:`~sleekxmpp.Message` that will be sent
        - **tab:** :py:class:`~tabs.MucTab` source

        Same thing than :term:`muc_say`, but after XHTML generation of the body, if needed.
        This means you must not insert any colors in the body in the handler, since
        it may lead to send invalid XML. This hook is less safe than ``muc_say`` and
        you should probably not need it.

    private_say
        - **message:** :py:class:`~sleekxmpp.Message` that will be sent
        - **tab:** :py:class:`~tabs.PrivateTab` source

        Triggered whenever the user sends a message to a :py:class:`~tabs.PrivateTab`.

    private_say_after
        - **message:** :py:class:`~sleekxmpp.Message` that will be sent
        - **tab:** :py:class:`~tabs.PrivateTab` source

        Same thing than :term:`private_say`, but after XHTML generation of the body, if needed.
        This means you must not insert any colors in the body in the handler, since
        it may lead to send invalid XML. This hook is less safe than :term:`private_say` and
        you should probably not need it.

    conversation_say
        - **message:** :py:class:`~sleekxmpp.Message` that will be sent
        - **tab:** :py:class:`~tabs.ConversationTab` source

        Triggered whenever the user sends a message to a :py:class:`~tabs.ConversationTab`.

    conversation_say_after:
        - **message:** :py:class:`~sleekxmpp.Message` that will be sent
        - **tab:** :py:class:`~tabs.ConversationTab` source

56 57 58 59 60
        Same thing than :term:`conversation_say`, but after XHTML generation
        of the body, if needed.  This means you must not insert any colors
        in the body in the handler, since it may lead to send
        invalid XML. This hook is less safe than :term:`conversation_say`
        and you should probably not need it.
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 90 91 92 93 94 95 96 97 98 99

    muc_msg
        - **message:** :py:class:`~sleekxmpp.Message` received
        - **tab:** :py:class:`~tabs.MucTab` source

        Triggered when a message is received in a :py:class:`~tabs.MucTab`.

    private_msg
        - **message:** :py:class:`~sleekxmpp.Message` received
        - **tab:** :py:class:`~tabs.PrivateTab` source

        Triggered when a message is received in a :py:class:`~tabs.PrivateTab`.

    conversation_msg
        - **message:** :py:class:`~sleekxmpp.Message` received
        - **tab:** :py:class:`~tabs.ConversationTab` source

        Triggered when a message is received in a :py:class:`~tabs.ConversationTab`.

    conversation_chatstate
        - **message:** :py:class:`~sleekxmpp.Message` received
        - **tab:** :py:class:`~tabs.ConversationTab` source

        Triggered when a chatstate is received in a :py:class:`~tabs.ConversationTab`.

    muc_chatstate
        - **message:** :py:class:`~sleekxmpp.Message` received
        - **tab:** :py:class:`~tabs.MucTab` source

        Triggered when a chatstate is received in a :py:class:`~tabs.MucTab`.

    private_chatstate
        - **message:** :py:class:`~sleekxmpp.Message` received
        - **tab:** :py:class:`PrivateTab <tabs.PrivateTab>` source

        Triggered when a chatstate is received in a :py:class:`~tabs.PrivateTab`.

    normal_presence
        - **presence:** :py:class:`~sleekxmpp.Presence` received
100
        - **resource:** :py:class:`Resource <str>` that emitted the :py:class:`~sleekxmpp.Presence`
101 102 103 104 105 106 107

        Triggered when a presence is received from a contact.

    muc_presence
        - **presence:** :py:class:`~sleekxmpp.Presence` received
        - **tab:** :py:class:`~tabs.MucTab` source

108 109
        Triggered when a presence is received from someone in a
        :py:class:`~tabs.MucTab`.
110

louiz’'s avatar
louiz’ committed
111 112 113
    joining_muc
        - **presence:** :py:class:`~~sleekxmpp.Presence` to be sent

114 115
        Triggered when joining a MUC. The presence can thus be modified
        before being sent.
louiz’'s avatar
louiz’ committed
116

117 118 119 120 121 122
    changing_nick
        - **presence:** :py:class:`~~sleekxmpp.Presence` to be sent

        Triggered when the user changes his/her nickname on a MUC. The
        presence can thus be modified before being sent.

123 124 125
    send_normal_presence
        - **presence:** :py:class:`~sleekxmpp.Presence` sent

126 127
        Triggered when poezio sends a new :py:class:`~sleekxmpp.Presence`
        stanza. The presence can thus be modified before being sent.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159

    muc_join
        - **presence:** :py:class:`~sleekxmpp.Presence` received
        - **tab:** :py:class:`~tabs.MucTab` source

        Triggered when an user joins a :py:class:`~tabs.MucTab`

    muc_ban
        - **presence:** :py:class:`~sleekxmpp.Presence` received
        - **tab:** :py:class:`~tabs.MucTab` source

        Triggered when an user from a :py:class:`~tabs.MucTab`
        gets banned.

    muc_kicked
        - **presence:** :py:class:`~sleekxmpp.Presence` received
        - **tab:** :py:class:`~tabs.MucTab` source

        Triggered when an user from a :py:class:`~tabs.MucTab`
        gets kicked.

    muc_nickchange
        - **presence:** :py:class:`~sleekxmpp.Presence` received
        - **tab:** :py:class:`~tabs.MucTab` source

        Triggered when an user in a :py:class:`~tabs.MucTab` changes
        his nickname.

    ignored_private
        - **message**:py:class:`~sleekxmpp.Message` received
        - **tab:** :py:class:`~tabs.PrivateTab` source

160 161
        Triggered when a private message (that goes in a
        :py:class:`~tabs.PrivateTab`) is ignored automatically by poezio.
162

163 164
        **tab** is always ``None``, except when a tab has already been
         opened.