|
|
Here are the different events that Gajim generates, and that plugins can register to. Each event have attributes that plugins can use. There are 2 types of events: [#incoming incoming events] and [#outgoing outgoing events].
|
|
|
|
|
|
== Incoming events: ==#incoming
|
|
|
|
|
|
They are generated when Gajim receives some stanza. Plugins can listen to them and eventually modify them before they are handled by GUI for example. All events have conn attribute that is the Connection instance.
|
|
|
|
|
|
|*Event name*|*attributes*|*Event description*|
|
|
|
|------------|------------|-------------------|
|
|
|
|account-created|account_info|
|
|
|
|account-not-created|reason|
|
|
|
|agent-info-error-received|stanza, fjid, jid, resource, id_|
|
|
|
|agent-info-received|stanza, id_, identities, features, data, node, fjid, jid, resource|
|
|
|
|agent-items-error-received|stanza, fjid, jid, resource, id_|
|
|
|
|agent-items-received|stanza, node, items, fjid, jid, resource, id_|
|
|
|
|agent-removed|agent, jid_list|
|
|
|
|anonymous-auth|old_jid, new_jid|
|
|
|
|archiving-preferences-changed-received|stanza, type_, conf, new_items, removed_items|
|
|
|
|archiving-received|stanza, type_|
|
|
|
|archiving-error-received|stanza, type_, error_msg|
|
|
|
|atom-entry-received|node, atom_entry|
|
|
|
|bad-gpg-passphrase|account, use_gpg_agent, keyID|
|
|
|
|bookmarks-received|bookmarks|
|
|
|
|caps-disco-received|fjid, jid, resource, client_caps|
|
|
|
|caps-presence-received|stanza, fjid, jid, resource, ptype, show, hash_method, node, caps_hash.
|
|
|
*Added at CORE level:* client_caps||
|
|
|
|caps-received|fjid, jid, resource, client_caps|
|
|
|
|-------------|--------------------------------|
|
|
|
|chatstate-received|msg_obj, stanza, jid, fjid, resource, chatstate|
|
|
|
|client-cert-passphrase|con, port, secure_tuple|
|
|
|
|connection-lost|title, msg|
|
|
|
|connection-type|connection_type|
|
|
|
|decrypted-message-received|msg_obj, stanza, id_, fjid, jid, resource, mtype, invite_tag, thread_id, msgtxt, gc_control, session, timestamp, encrypted, forwarded, sent, popup, msg_id, receipt_request_tag, receipt_received_tag, subject, displaymarking, seclabel, form_node, xhtml, user_nick, chatstate, msghash, additional_data
|
|
|
*Modified at CORE level (oob handling):* msgtxt||
|
|
|
|error-received|stanza, id_, fjid, jid, resource, errmsg, errcode|
|
|
|
|--------------|-------------------------------------------------|
|
|
|
|failed-decrypt|msg_obj, fjid, timestamp, session|
|
|
|
|file-request-error|jid, file_props, error_msg|
|
|
|
|file-request-received|stanza, id_, fjid, jid, file_props, dataform|
|
|
|
|file-transfer-completed|jid, file_props|
|
|
|
|fingerprint-error|certificate, new_fingerprint|
|
|
|
|gateway-prompt-received|stanza, fjid, jid, resource, desc, prompt, prompt_jid|
|
|
|
|gc-config-changed-received|msg_event, stanza, room_jid, status_code|
|
|
|
|gc-invitation|msg_obj, room_jid, jid_from, reason, password, is_continued|
|
|
|
|gc-message-received|msg_obj, stanza, fjid, msgtxt, jid, room_jid, nickname, timestamp, xhtml_msgtxt, nick, has_timestamp, subject, status_code, displaymarking, captcha_form, additional_data|
|
|
|
|gc-presence-received|stanza, ptype, fjid, jid, room_jid, nick, show, status, avatar_sha, errcode, errmsg, errcon, gc_control, gc_contact, presence_obj (see presence-received event)
|
|
|
*if ptype != 'error':* status_code, reason, role, affiliation, real_jid, actor, new_nick||
|
|
|
|gc-subject-received|msg_event, stanza, room_jid, nickname, fjid, subject, msgtxt, has_timestamp|
|
|
|
|-------------------|---------------------------------------------------------------------------|
|
|
|
|gmail-new-mail-received|stanza|
|
|
|
|gmail-notify|stanza, newmsgs, gmail_messages_list (list of dict {'From':, 'Subject':, 'Snippet':, 'url':, 'participation':, 'messages':, 'date':}), jid (our jid)|
|
|
|
|gpg-trust-key|callback|
|
|
|
|gpg-password-required|callback, keyid|
|
|
|
|http-auth-received|stanza, opt (option from config), iq_id, method, url, msg|
|
|
|
|iq-error-received|stanza, id_, fjid, jid, resource, errmsg, errcode|
|
|
|
|insecure-password| |
|
|
|
|insecure-ssl-connection|xmpp_client, conn_type|
|
|
|
|jingle-request-received|jingle_session, contents, fjid, jid, resource, sid|
|
|
|
|jingle-connected-received|jingle_session, media, fjid, jid, resource, sid|
|
|
|
|jingle-disconnected-received|jingle_session, media, reason, fjid, jid, resource, sid|
|
|
|
|jingle-error-received|jingle_session, reason, fjid, jid, resource, sid|
|
|
|
|last-request-received|stanza|
|
|
|
|last-result-received|stanza, id_, fjid, jid, resource, status, seconds|
|
|
|
|mam-decrypted-message-received|msg_obj, with_, direction, tim, msgtxt, additional_data|
|
|
|
|mam-message-received|stanza, tim, msg_, msgtxt, with_, direction, resource, enc_tag, additional_data|
|
|
|
|message-error|fjid, error_code, error_msg, msg, time_, session, stanza|
|
|
|
|message-not-sent|jid, message, error, time_, session|
|
|
|
|message-received|stanza, id_, fjid, jid, resource, enc_tag, invite_tag, thread_id, mtype, msgtxt, gc_control, session, timestamp, encrypted, forwarded, sent, additional_data
|
|
|
*Modified at CORE level (decryption):* stanza, msgtxt||
|
|
|
|message-sent|jid, message, keyID, chatstate, msg_id, automatic_message, additional_data|
|
|
|
|------------|--------------------------------------------------------------------------|
|
|
|
|metacontacts-received|stanza, meta_list|
|
|
|
|muc-admin-received|stanza, fjid, jid, resource, users_dict|
|
|
|
|muc-owner-received|stanza, fjid, jid, resource, form_node, dataform|
|
|
|
|new-account-connected|config, is_form, errnum, ssl_msg, ssl_cert, ssl_fingerprint|
|
|
|
|new-account-not-connected|reason|
|
|
|
|notification|jid, control, control_focused, first_unread, do_sound, sound_file, sound_event, show_popup, do_popup, popup_title, popup_text, popup_event_type, popup_msg_type, popup_image, do_command, command, show_in_notification_area, show_in_roster, notif_type
|
|
|
*if notif_type == 'msg':* control_focused
|
|
|
|our-show|show|Event arrive when account status changed|
|
|
|
|--------|----|----------------------------------------|
|
|
|
|password-required| |
|
|
|
|pep-config-received|node, form|
|
|
|
|pep-received|stanza, fjid, jid, resource, event_tag, pep_type|
|
|
|
|ping-error|contact|
|
|
|
|ping-received|stanza|
|
|
|
|ping-reply|contact, seconds|
|
|
|
|ping-sent|contact|
|
|
|
|plain-connection|xmpp_client|
|
|
|
|presence-received|stanza, id_, fjid, jid, resource, need_add_in_roster, need_redraw, popup, ptype, timestamp, is_gc, user_nick, contact_nickname, status, show, prio, keyID, avatar_sha, transport_auto_auth, errcode, errmsg
|
|
|
*Added at CORE level:* old_show, new_show, contact_list, was_highest, contact||
|
|
|
|privacy-list-active-default|active_list|
|
|
|
|---------------------------|-----------|
|
|
|
|privacy-list-received|list_name, rules|
|
|
|
|privacy-list-removed|list_name|
|
|
|
|privacy-lists-received|lists_list|
|
|
|
|private-storage-received|stanza, storage_node, namespace|
|
|
|
|private-storage-bookmarks-received|bookmarks|
|
|
|
|private-storage-rosternotes-received|annotations|
|
|
|
|pubsub-received|stanza, pubsub_node, items_node, item_node, node|
|
|
|
|pubsub-bookmarks-received|bookmarks|
|
|
|
|raw-iq-received|stanza|
|
|
|
|raw-message-received|stanza|
|
|
|
|raw-pres-received|stanza|
|
|
|
|register-agent-info-received|agent, config, is_form|
|
|
|
|roster-info|jid, nickname, sub, ask, groups|
|
|
|
|roster-item-exchange-received|stanza, id_, fjid, jid, resource, exchange_items_list, action|
|
|
|
|roster-set-received|stanza, version, items (dict {jid1: {'name':, 'sub':, 'ask':, 'groups':},}|
|
|
|
|roster-received|xmpp_roster, version, received_from_server, roster|
|
|
|
|rosternotes-received|annotations|
|
|
|
|search-form-received|stanza, fjid, jid, resource, data, is_dataform|
|
|
|
|search-result-received|stanza, fjid, jid, resource, data, is_dataform|
|
|
|
|signed-in| |
|
|
|
|ssl-error|error_text, error_num, cert, fingerprint, certificate|
|
|
|
|stanza-received|stanza_str, additional_data|
|
|
|
|stanza-sent|stanza_str, additional_data|
|
|
|
|stream-received|stanza|
|
|
|
|stream-conflict-received||
|
|
|
|subscribe-presence-received|stanza, jid, fjid, status, transport_auto_auth, user_nick, presence_obj|
|
|
|
|subscribed-presence-received|stanza, jid, resource, presence_obj|
|
|
|
|time-request-received|stanza|
|
|
|
|time-result-received|stanza, id_, fjid, jid, resource, time_info|
|
|
|
|time-revised-request-received|stanza|
|
|
|
|unique-room-id-not-supported|instance, server|
|
|
|
|unique-room-id-supported|instance, server, room_id|
|
|
|
|unsubscribed-presence-received|stanza, jid, presence_obj|
|
|
|
|vcard-not-published||
|
|
|
|vcard-published||
|
|
|
|vcard-received|vcard_dict, nickname, fjid, jid, resource|
|
|
|
|version-request-received|stanza|
|
|
|
|version-result-received|stanza, id_, fjid, jid, resource, client_info, os_info|
|
|
|
|zeroconf-name-conflict|alt_name|
|
|
|
|
|
|
### Example of usage
|
|
|
|
|
|
|
|
|
from common import gajim, ged
|
|
|
from plugins import GajimPlugin
|
|
|
|
|
|
...
|
|
|
|
|
|
class OurPlugin(GajimPlugin):
|
|
|
def init(self):
|
|
|
|
|
|
...
|
|
|
|
|
|
self.events_handlers = {'our-show': (ged.GUI2, self.our_show),
|
|
|
'presence-received': (ged.POSTGUI, self.presence_received)}
|
|
|
...
|
|
|
|
|
|
def our_show(self, obj):
|
|
|
if obj.show == 'offline':
|
|
|
|
|
|
...
|
|
|
|
|
|
def presence_received(self, obj):
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
== Outgoing events: == #outgoing
|
|
|
|
|
|
They are generated when Gajim is about to send stanza. Plugins can listen to them and eventually modify them before they are really sent.
|
|
|
|
|
|
|*Event name*|*attributes*|
|
|
|
|------------|------------|
|
|
|
|message-outgoing|account, jid, chatstate, msg_id, control, message, keyID, type_, subject, chatstate, msg_id, resource, user_nick, xhtml, label, session, forward_from, form_node, original_message, delayed, callback, callback_args, now, is_loggable, control, automatic_message, additional_data|
|
|
|
|gc-message-outgoing|account, jid, control, message, xhtml, label, callback, callback_args, is_loggable, correction_msg, automatic_message, additional_data|
|
|
|
|stanza-message-outgoing|conn, msg_iq, now, automatic_message, additional_data| |
|
|
\ No newline at end of file |