add an INFORMATION event from connection to gui
This commit is contained in:
parent
0342329e0f
commit
c19e0f0bd4
|
@ -111,14 +111,14 @@ class Connection:
|
||||||
"""Connection class"""
|
"""Connection class"""
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
# dict of function to be called for each event
|
# dict of function to be called for each event
|
||||||
self.handlers = {'ROSTER': [], 'WARNING': [], 'ERROR': [], 'STATUS': [],
|
self.handlers = {'ROSTER': [], 'WARNING': [], 'ERROR': [],
|
||||||
'NOTIFY': [], 'MSG': [], 'MSGERROR': [], 'MSGSENT': [] ,
|
'INFORMATION': [], 'STATUS': [], 'NOTIFY': [], 'MSG': [],
|
||||||
'SUBSCRIBED': [], 'UNSUBSCRIBED': [], 'SUBSCRIBE': [],
|
'MSGERROR': [], 'MSGSENT': [] , 'SUBSCRIBED': [], 'UNSUBSCRIBED': [],
|
||||||
'AGENT_INFO': [], 'REGISTER_AGENT_INFO': [], 'AGENT_INFO_ITEMS': [],
|
'SUBSCRIBE': [], 'AGENT_INFO': [], 'REGISTER_AGENT_INFO': [],
|
||||||
'AGENT_INFO_INFO': [], 'QUIT': [], 'ACC_OK': [], 'MYVCARD': [],
|
'AGENT_INFO_ITEMS': [], 'AGENT_INFO_INFO': [], 'QUIT': [],
|
||||||
'OS_INFO': [], 'VCARD': [], 'GC_MSG': [], 'GC_SUBJECT': [],
|
'ACC_OK': [], 'MYVCARD': [], 'OS_INFO': [], 'VCARD': [], 'GC_MSG': [],
|
||||||
'GC_CONFIG': [], 'BAD_PASSPHRASE': [], 'ROSTER_INFO': [],
|
'GC_SUBJECT': [], 'GC_CONFIG': [], 'BAD_PASSPHRASE': [],
|
||||||
'ERROR_ANSWER': [], 'BOOKMARKS': [],}
|
'ROSTER_INFO': [], 'ERROR_ANSWER': [], 'BOOKMARKS': [],}
|
||||||
self.name = name
|
self.name = name
|
||||||
self.connected = 0 # offline
|
self.connected = 0 # offline
|
||||||
self.connection = None # xmpppy instance
|
self.connection = None # xmpppy instance
|
||||||
|
|
11
src/gajim.py
11
src/gajim.py
|
@ -173,15 +173,19 @@ class Interface:
|
||||||
#('ROSTER', account, array)
|
#('ROSTER', account, array)
|
||||||
self.roster.mklists(data, account)
|
self.roster.mklists(data, account)
|
||||||
self.roster.draw_roster()
|
self.roster.draw_roster()
|
||||||
|
|
||||||
def handle_event_warning(self, unused, data):
|
def handle_event_warning(self, unused, data):
|
||||||
#('WARNING', account, (title_text, section_text))
|
#('WARNING', account, (title_text, section_text))
|
||||||
dialogs.WarningDialog(data[0], data[1]).get_response()
|
dialogs.WarningDialog(data[0], data[1]).get_response()
|
||||||
|
|
||||||
def handle_event_error(self, unused, data):
|
def handle_event_error(self, unused, data):
|
||||||
#('ERROR', account, (title_text, section_text))
|
#('ERROR', account, (title_text, section_text))
|
||||||
dialogs.ErrorDialog(data[0], data[1]).get_response()
|
dialogs.ErrorDialog(data[0], data[1]).get_response()
|
||||||
|
|
||||||
|
def handle_event_information(self, unused, data):
|
||||||
|
#('INFORMATION', account, (title_text, section_text))
|
||||||
|
dialogs.InformationDialog(data[0], data[1]).get_response()
|
||||||
|
|
||||||
def handle_event_error_answer(self, account, array):
|
def handle_event_error_answer(self, account, array):
|
||||||
#('ERROR_ANSWER', account, (jid_from. errmsg, errcode))
|
#('ERROR_ANSWER', account, (jid_from. errmsg, errcode))
|
||||||
jid_from = array[0]
|
jid_from = array[0]
|
||||||
|
@ -722,6 +726,7 @@ class Interface:
|
||||||
conn.register_handler('ROSTER', self.handle_event_roster)
|
conn.register_handler('ROSTER', self.handle_event_roster)
|
||||||
conn.register_handler('WARNING', self.handle_event_warning)
|
conn.register_handler('WARNING', self.handle_event_warning)
|
||||||
conn.register_handler('ERROR', self.handle_event_error)
|
conn.register_handler('ERROR', self.handle_event_error)
|
||||||
|
conn.register_handler('INFORMATION', self.handle_event_information)
|
||||||
conn.register_handler('ERROR_ANSWER', self.handle_event_error_answer)
|
conn.register_handler('ERROR_ANSWER', self.handle_event_error_answer)
|
||||||
conn.register_handler('STATUS', self.handle_event_status)
|
conn.register_handler('STATUS', self.handle_event_status)
|
||||||
conn.register_handler('NOTIFY', self.handle_event_notify)
|
conn.register_handler('NOTIFY', self.handle_event_notify)
|
||||||
|
|
Loading…
Reference in New Issue