don't allow privacy rules window if server doesn't support it. Fixes #253
This commit is contained in:
parent
bcdd4d2315
commit
382b245062
|
@ -404,8 +404,6 @@ class Connection(ConnectionHandlers):
|
||||||
con.RegisterDisconnectHandler(self._disconnectedReconnCB)
|
con.RegisterDisconnectHandler(self._disconnectedReconnCB)
|
||||||
gajim.log.debug(_('Connected to server %s:%s with %s') % (self._current_host['host'],
|
gajim.log.debug(_('Connected to server %s:%s with %s') % (self._current_host['host'],
|
||||||
self._current_host['port'], con_type))
|
self._current_host['port'], con_type))
|
||||||
# Ask metacontacts before roster
|
|
||||||
self.get_metacontacts()
|
|
||||||
self._register_handlers(con, con_type)
|
self._register_handlers(con, con_type)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -591,8 +589,11 @@ class Connection(ConnectionHandlers):
|
||||||
if self.connection:
|
if self.connection:
|
||||||
con.set_send_timeout(self.keepalives, self.send_keepalive)
|
con.set_send_timeout(self.keepalives, self.send_keepalive)
|
||||||
self.connection.onreceive(None)
|
self.connection.onreceive(None)
|
||||||
# Ask metacontacts before roster
|
iq = common.xmpp.Iq('get', common.xmpp.NS_PRIVACY, xmlns = '')
|
||||||
self.get_metacontacts()
|
id = self.connection.getAnID()
|
||||||
|
iq.setID(id)
|
||||||
|
self.awaiting_answers[id] = (PRIVACY_ARRIVED, )
|
||||||
|
self.connection.send(iq)
|
||||||
|
|
||||||
def change_status(self, show, msg, auto = False):
|
def change_status(self, show, msg, auto = False):
|
||||||
if not show in STATUS_LIST:
|
if not show in STATUS_LIST:
|
||||||
|
|
|
@ -41,6 +41,7 @@ VCARD_PUBLISHED = 'vcard_published'
|
||||||
VCARD_ARRIVED = 'vcard_arrived'
|
VCARD_ARRIVED = 'vcard_arrived'
|
||||||
AGENT_REMOVED = 'agent_removed'
|
AGENT_REMOVED = 'agent_removed'
|
||||||
METACONTACTS_ARRIVED = 'metacontacts_arrived'
|
METACONTACTS_ARRIVED = 'metacontacts_arrived'
|
||||||
|
PRIVACY_ARRIVED = 'privacy_arrived'
|
||||||
HAS_IDLE = True
|
HAS_IDLE = True
|
||||||
try:
|
try:
|
||||||
import common.idle as idle # when we launch gajim from sources
|
import common.idle as idle # when we launch gajim from sources
|
||||||
|
@ -1004,6 +1005,11 @@ class ConnectionVcard:
|
||||||
self.dispatch('METACONTACTS', meta_list)
|
self.dispatch('METACONTACTS', meta_list)
|
||||||
# We can now continue connection by requesting the roster
|
# We can now continue connection by requesting the roster
|
||||||
self.connection.initRoster()
|
self.connection.initRoster()
|
||||||
|
elif self.awaiting_answers[id][0] == PRIVACY_ARRIVED:
|
||||||
|
if iq_obj.getType() != 'error':
|
||||||
|
self.privacy_rules_supported = True
|
||||||
|
# Ask metacontacts before roster
|
||||||
|
self.get_metacontacts()
|
||||||
|
|
||||||
del self.awaiting_answers[id]
|
del self.awaiting_answers[id]
|
||||||
|
|
||||||
|
|
|
@ -691,8 +691,11 @@ class RosterWindow:
|
||||||
xml_console_menuitem.connect('activate',
|
xml_console_menuitem.connect('activate',
|
||||||
self.on_xml_console_menuitem_activate, account)
|
self.on_xml_console_menuitem_activate, account)
|
||||||
|
|
||||||
privacy_lists_menuitem.connect('activate',
|
if gajim.connections[account] and gajim.connections[account].privacy_rules_supported:
|
||||||
self.on_privacy_lists_menuitem_activate, account)
|
privacy_lists_menuitem.connect('activate',
|
||||||
|
self.on_privacy_lists_menuitem_activate, account)
|
||||||
|
else:
|
||||||
|
privacy_lists_menuitem.set_sensitive(False)
|
||||||
|
|
||||||
send_server_message_menuitem.connect('activate',
|
send_server_message_menuitem.connect('activate',
|
||||||
self.on_send_server_message_menuitem_activate, account)
|
self.on_send_server_message_menuitem_activate, account)
|
||||||
|
|
Loading…
Reference in New Issue