Package common :: Module connection :: Class Connection
[hide private]
[frames] | no frames]

Class Connection

source code


Instance Methods [hide private]
 
__init__(self, name) source code
 
get_config_values_or_default(self) source code
 
check_jid(self, jid)
This function must be implemented by derivated classes.
source code
 
_reconnect(self)
To be implemented by derivated classes
source code
 
disconnect(self, on_purpose=False) source code
 
_disconnectedReconnCB(self)
Called when we are disconnected
source code
 
_connection_lost(self) source code
 
_event_dispatcher(self, realm, event, data) source code
 
_select_next_host(self, hosts)
Selects the next host according to RFC2782 p.3 based on it's priority.
source code
 
connect(self, data=None)
Start a connection to the Jabber server
source code
 
_on_resolve(self, host, result_array) source code
 
_connect_to_next_host(self, retry=False) source code
 
connect_to_next_type(self, retry=False) source code
 
log_hosttype_info(self, port) source code
 
_connect_failure(self, con_type=None) source code
 
on_proxy_failure(self, reason) source code
 
_connect_success(self, con, con_type) source code
 
connection_accepted(self, con, con_type) source code
 
ssl_certificate_accepted(self) source code
 
_register_handlers(self, con, con_type) source code
 
__on_auth(self, con, auth) source code
 
add_lang(self, stanza) source code
 
get_privacy_lists(self) source code
 
send_keepalive(self) source code
 
_on_xmpp_ping_answer(self, iq_obj) source code
 
sendPing(self, pingTo=None)
Send XMPP Ping (XEP-0199) request.
source code
 
get_active_default_lists(self) source code
 
del_privacy_list(self, privacy_list) source code
 
get_privacy_list(self, title) source code
 
set_privacy_list(self, listname, tags) source code
 
set_active_list(self, listname) source code
 
set_default_list(self, listname) source code
 
build_privacy_rule(self, name, action, order=1)
Build a Privacy rule stanza for invisibility
source code
 
build_invisible_rule(self) source code
 
set_invisible_rule(self) source code
 
activate_privacy_rule(self, name)
Activate a privacy rule
source code
 
send_invisible_presence(self, msg, signed, initial=False) source code
 
_continue_invisible(self, con, iq_obj, msg, signed, initial) source code
 
get_signed_presence(self, msg, callback=None) source code
 
connect_and_auth(self) source code
 
connect_and_init(self, show, msg, sign_msg) source code
 
_discover_server_at_connection(self, con) source code
 
_on_stun_resolved(self, host, result_array) source code
 
_request_privacy(self) source code
 
send_custom_status(self, show, msg, jid) source code
 
_change_to_invisible(self, msg) source code
 
_change_from_invisible(self) source code
 
_update_status(self, show, msg) source code
 
send_motd(self, jid, subject='', msg='', xhtml=None) source code
 
send_message(self, jid, msg, keyID=None, type_='chat', subject='', chatstate=None, msg_id=None, composing_xep=None, resource=None, user_nick=None, xhtml=None, label=None, session=None, forward_from=None, form_node=None, original_message=None, delayed=None, callback=None, callback_args=[], now=False) source code
 
send_contacts(self, contacts, jid)
Send contacts with RosterX (Xep-0144)
source code
 
send_stanza(self, stanza)
Send a stanza untouched
source code
 
ack_subscribed(self, jid)
To be implemented by derivated classes
source code
 
ack_unsubscribed(self, jid)
To be implemented by derivated classes
source code
 
request_subscription(self, jid, msg='', name='', groups=[], auto_auth=False, user_nick='')
To be implemented by derivated classes
source code
 
send_authorization(self, jid)
To be implemented by derivated classes
source code
 
refuse_authorization(self, jid)
To be implemented by derivated classes
source code
 
unsubscribe(self, jid, remove_auth=True)
To be implemented by derivated classes
source code
 
unsubscribe_agent(self, agent)
To be implemented by derivated classes
source code
 
send_new_account_infos(self, form, is_form) source code
 
new_account(self, name, config, sync=False)
To be implemented by derivated classes
source code
 
_on_new_account(self, con=None, con_type=None)
To be implemented by derivated classes
source code
 
request_os_info(self, jid, resource, groupchat_jid=None)
groupchat_jid is used when we want to send a request to a real jid and act as if the answer comes from the groupchat_jid
source code
 
request_entity_time(self, jid, resource, groupchat_jid=None)
groupchat_jid is used when we want to send a request to a real jid and act as if the answer comes from the groupchat_jid
source code
 
get_settings(self)
Get Gajim settings as described in XEP 0049
source code
 
seclabel_catalogue(self, to, callback) source code
 
_request_bookmarks_xml(self) source code
 
_check_bookmarks_received(self) source code
 
get_bookmarks(self, storage_type=None)
Get Bookmarks from storage or PubSub if supported as described in XEP 0048
source code
 
store_bookmarks(self, storage_type=None)
Send bookmarks to the storage namespace or PubSub if supported
source code
 
get_annotations(self)
Get Annonations from storage as described in XEP 0048, and XEP 0145
source code
 
store_annotations(self)
Set Annonations in private storage as described in XEP 0048, and XEP 0145
source code
 
get_metacontacts(self)
Get metacontacts list from storage as described in XEP 0049
source code
 
store_metacontacts(self, tags_list)
Send meta contacts to the storage namespace
source code
 
send_agent_status(self, agent, ptype)
To be implemented by derivated classes
source code
 
send_captcha(self, jid, form_node) source code
 
check_unique_room_id_support(self, server, instance) source code
 
join_gc(self, nick, room_jid, password, change_nick=False) source code
 
send_gc_message(self, jid, msg, xhtml=None, label=None) source code
 
send_gc_subject(self, jid, subject) source code
 
request_gc_config(self, room_jid) source code
 
destroy_gc_room(self, room_jid, reason='', jid='') source code
 
send_gc_status(self, nick, jid, show, status) source code
 
gc_got_disconnected(self, room_jid)
A groupchat got disconnected.
source code
 
gc_set_role(self, room_jid, nick, role, reason='')
Role is for all the life of the room so it's based on nick
source code
 
gc_set_affiliation(self, room_jid, jid, affiliation, reason='')
Affiliation is for all the life of the room so it's based on jid
source code
 
send_gc_affiliation_list(self, room_jid, users_dict) source code
 
get_affiliation_list(self, room_jid, affiliation) source code
 
send_gc_config(self, room_jid, form) source code
 
change_password(self, password) source code
 
get_password(self, callback, type_) source code
 
set_password(self, password) source code
 
accept_insecure_password(self) source code
 
unregister_account(self, on_remove_success) source code
 
send_invite(self, room, to, reason='', continue_tag=False)
Send invitation
source code
 
check_pingalive(self) source code
 
_reconnect_alarm(self) source code
 
request_search_fields(self, jid) source code
 
send_search_form(self, jid, form, is_form) source code
 
load_roster_from_db(self) source code

Inherited from CommonConnection: account_changed, ask_gpg_keys, ask_gpg_secrete_keys, change_status, dispatch, get_signed_msg, get_status, gpg_passphrase, log_message, quit, request_last_status_time, test_gpg_passphrase, update_contact, update_contacts

Method Details [hide private]

__init__(self, name)
(Constructor)

source code 
Overrides: CommonConnection.__init__

get_config_values_or_default(self)

source code 

check_jid(self, jid)

source code 
This function must be implemented by derivated classes. It has to return the valid jid, or raise a helpers.InvalidFormat exception
Overrides: CommonConnection.check_jid
(inherited documentation)

_reconnect(self)

source code 
To be implemented by derivated classes
Overrides: CommonConnection._reconnect
(inherited documentation)

disconnect(self, on_purpose=False)

source code 

_disconnectedReconnCB(self)

source code 
Called when we are disconnected

_connection_lost(self)

source code 

_event_dispatcher(self, realm, event, data)

source code 
Overrides: CommonConnection._event_dispatcher

_select_next_host(self, hosts)

source code 
Selects the next host according to RFC2782 p.3 based on it's priority. Chooses between hosts with the same priority randomly, where the probability of being selected is proportional to the weight of the host

connect(self, data=None)

source code 

Start a connection to the Jabber server

Returns connection, and connection type ('tls', 'ssl', 'plain', '') data MUST contain hostname, usessl, proxy, use_custom_host, custom_host (if use_custom_host), custom_port (if use_custom_host)

_on_resolve(self, host, result_array)

source code 

_connect_to_next_host(self, retry=False)

source code 

connect_to_next_type(self, retry=False)

source code 

log_hosttype_info(self, port)

source code 

_connect_failure(self, con_type=None)

source code 

on_proxy_failure(self, reason)

source code 

_connect_success(self, con, con_type)

source code 

connection_accepted(self, con, con_type)

source code 

ssl_certificate_accepted(self)

source code 

_register_handlers(self, con, con_type)

source code 

__on_auth(self, con, auth)

source code 

add_lang(self, stanza)

source code 

get_privacy_lists(self)

source code 

send_keepalive(self)

source code 

_on_xmpp_ping_answer(self, iq_obj)

source code 

sendPing(self, pingTo=None)

source code 
Send XMPP Ping (XEP-0199) request. If pingTo is not set, ping is sent to server to detect connection failure at application level

get_active_default_lists(self)

source code 

del_privacy_list(self, privacy_list)

source code 

get_privacy_list(self, title)

source code 

set_privacy_list(self, listname, tags)

source code 

set_active_list(self, listname)

source code 

set_default_list(self, listname)

source code 

build_privacy_rule(self, name, action, order=1)

source code 
Build a Privacy rule stanza for invisibility

build_invisible_rule(self)

source code 

set_invisible_rule(self)

source code 

activate_privacy_rule(self, name)

source code 
Activate a privacy rule

send_invisible_presence(self, msg, signed, initial=False)

source code 

_continue_invisible(self, con, iq_obj, msg, signed, initial)

source code 

get_signed_presence(self, msg, callback=None)

source code 

connect_and_auth(self)

source code 

connect_and_init(self, show, msg, sign_msg)

source code 

_discover_server_at_connection(self, con)

source code 

_on_stun_resolved(self, host, result_array)

source code 

_request_privacy(self)

source code 

send_custom_status(self, show, msg, jid)

source code 

_change_to_invisible(self, msg)

source code 

_change_from_invisible(self)

source code 

_update_status(self, show, msg)

source code 

send_motd(self, jid, subject='', msg='', xhtml=None)

source code 

send_message(self, jid, msg, keyID=None, type_='chat', subject='', chatstate=None, msg_id=None, composing_xep=None, resource=None, user_nick=None, xhtml=None, label=None, session=None, forward_from=None, form_node=None, original_message=None, delayed=None, callback=None, callback_args=[], now=False)

source code 

send_contacts(self, contacts, jid)

source code 
Send contacts with RosterX (Xep-0144)

send_stanza(self, stanza)

source code 
Send a stanza untouched

ack_subscribed(self, jid)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.ack_subscribed
(inherited documentation)

ack_unsubscribed(self, jid)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.ack_unsubscribed
(inherited documentation)

request_subscription(self, jid, msg='', name='', groups=[], auto_auth=False, user_nick='')

source code 
To be implemented by derivated classes
Overrides: CommonConnection.request_subscription
(inherited documentation)

send_authorization(self, jid)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.send_authorization
(inherited documentation)

refuse_authorization(self, jid)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.refuse_authorization
(inherited documentation)

unsubscribe(self, jid, remove_auth=True)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.unsubscribe
(inherited documentation)

unsubscribe_agent(self, agent)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.unsubscribe_agent
(inherited documentation)

send_new_account_infos(self, form, is_form)

source code 

new_account(self, name, config, sync=False)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.new_account
(inherited documentation)

_on_new_account(self, con=None, con_type=None)

source code 
To be implemented by derivated classes
Overrides: CommonConnection._on_new_account
(inherited documentation)

request_os_info(self, jid, resource, groupchat_jid=None)

source code 
groupchat_jid is used when we want to send a request to a real jid and act as if the answer comes from the groupchat_jid
Overrides: CommonConnection.request_os_info

request_entity_time(self, jid, resource, groupchat_jid=None)

source code 
groupchat_jid is used when we want to send a request to a real jid and act as if the answer comes from the groupchat_jid

get_settings(self)

source code 
Get Gajim settings as described in XEP 0049
Overrides: CommonConnection.get_settings

seclabel_catalogue(self, to, callback)

source code 

_request_bookmarks_xml(self)

source code 

_check_bookmarks_received(self)

source code 

get_bookmarks(self, storage_type=None)

source code 

Get Bookmarks from storage or PubSub if supported as described in XEP 0048

storage_type can be set to xml to force request to xml storage

Overrides: CommonConnection.get_bookmarks

store_bookmarks(self, storage_type=None)

source code 

Send bookmarks to the storage namespace or PubSub if supported

storage_type can be set to 'pubsub' or 'xml' so store in only one method else it will be stored on both

Overrides: CommonConnection.store_bookmarks

get_annotations(self)

source code 
Get Annonations from storage as described in XEP 0048, and XEP 0145

store_annotations(self)

source code 
Set Annonations in private storage as described in XEP 0048, and XEP 0145

get_metacontacts(self)

source code 
Get metacontacts list from storage as described in XEP 0049
Overrides: CommonConnection.get_metacontacts

store_metacontacts(self, tags_list)

source code 
Send meta contacts to the storage namespace

send_agent_status(self, agent, ptype)

source code 
To be implemented by derivated classes
Overrides: CommonConnection.send_agent_status
(inherited documentation)

send_captcha(self, jid, form_node)

source code 

check_unique_room_id_support(self, server, instance)

source code 

join_gc(self, nick, room_jid, password, change_nick=False)

source code 

send_gc_message(self, jid, msg, xhtml=None, label=None)

source code 

send_gc_subject(self, jid, subject)

source code 

request_gc_config(self, room_jid)

source code 

destroy_gc_room(self, room_jid, reason='', jid='')

source code 

send_gc_status(self, nick, jid, show, status)

source code 

gc_got_disconnected(self, room_jid)

source code 

A groupchat got disconnected. This can be or purpose or not

Save the time we had last message to avoid duplicate logs AND be faster than get that date from DB. Save time that we have in mem in a small table (with fast access)

gc_set_role(self, room_jid, nick, role, reason='')

source code 
Role is for all the life of the room so it's based on nick

gc_set_affiliation(self, room_jid, jid, affiliation, reason='')

source code 
Affiliation is for all the life of the room so it's based on jid

send_gc_affiliation_list(self, room_jid, users_dict)

source code 

get_affiliation_list(self, room_jid, affiliation)

source code 

send_gc_config(self, room_jid, form)

source code 

change_password(self, password)

source code 

get_password(self, callback, type_)

source code 

set_password(self, password)

source code 

accept_insecure_password(self)

source code 

unregister_account(self, on_remove_success)

source code 

send_invite(self, room, to, reason='', continue_tag=False)

source code 
Send invitation

check_pingalive(self)

source code 

_reconnect_alarm(self)

source code 

request_search_fields(self, jid)

source code 

send_search_form(self, jid, form, is_form)

source code 

load_roster_from_db(self)

source code 
Overrides: CommonConnection.load_roster_from_db