From aad5c16054d458f6243de78f84980440f1d9d7e1 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 14 Jun 2017 20:31:29 +0100 Subject: [PATCH] Update to XEP-0234 version 0.18.0 (:5 namespace). --- src/chat_control.py | 6 +++--- src/common/caps_cache.py | 4 ++-- src/common/connection_handlers.py | 2 +- src/common/helpers.py | 2 +- src/common/jingle_content.py | 2 +- src/common/jingle_ft.py | 4 ++-- src/filetransfers_window.py | 4 ++-- src/gui_menu_builder.py | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 1009a8699..cb727fdeb 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -51,7 +51,7 @@ from common.logger import KindConstant from nbxmpp.protocol import NS_XHTML, NS_XHTML_IM, NS_FILE, NS_MUC from nbxmpp.protocol import NS_ESESSION from nbxmpp.protocol import NS_JINGLE_RTP_AUDIO, NS_JINGLE_RTP_VIDEO -from nbxmpp.protocol import NS_JINGLE_ICE_UDP, NS_JINGLE_FILE_TRANSFER +from nbxmpp.protocol import NS_JINGLE_ICE_UDP, NS_JINGLE_FILE_TRANSFER_5 from nbxmpp.protocol import NS_CHATSTATES from common.connection_handlers_events import MessageOutgoingEvent from common.exceptions import GajimGeneralException @@ -387,7 +387,7 @@ class ChatControl(ChatControlBase): # Send file if ((self.contact.supports(NS_FILE) or \ - self.contact.supports(NS_JINGLE_FILE_TRANSFER)) and \ + self.contact.supports(NS_JINGLE_FILE_TRANSFER_5)) and \ (self.type_id == 'chat' or self.gc_contact.resource)) and \ self.contact.show != 'offline': self._send_file_button.set_sensitive(True) @@ -395,7 +395,7 @@ class ChatControl(ChatControlBase): else: self._send_file_button.set_sensitive(False) if not (self.contact.supports(NS_FILE) or self.contact.supports( - NS_JINGLE_FILE_TRANSFER)): + NS_JINGLE_FILE_TRANSFER_5)): self._send_file_button.set_tooltip_text(_( "This contact does not support file transfer.")) else: diff --git a/src/common/caps_cache.py b/src/common/caps_cache.py index c0ccbd3f5..6a1fc7d15 100644 --- a/src/common/caps_cache.py +++ b/src/common/caps_cache.py @@ -39,11 +39,11 @@ log = logging.getLogger('gajim.c.caps_cache') from nbxmpp import (NS_XHTML_IM, NS_ESESSION, NS_CHATSTATES, NS_JINGLE_ICE_UDP, NS_JINGLE_RTP_AUDIO, NS_JINGLE_RTP_VIDEO, - NS_JINGLE_FILE_TRANSFER) + NS_JINGLE_FILE_TRANSFER_5) # Features where we cannot safely assume that the other side supports them FEATURE_BLACKLIST = [NS_CHATSTATES, NS_XHTML_IM, NS_ESESSION, NS_JINGLE_ICE_UDP, NS_JINGLE_RTP_AUDIO, NS_JINGLE_RTP_VIDEO, - NS_JINGLE_FILE_TRANSFER] + NS_JINGLE_FILE_TRANSFER_5] # Query entry status codes NEW = 0 diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 80f4cf19d..7ac2b8a94 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -187,7 +187,7 @@ class ConnectionDisco: query.setAttr('node', 'http://gajim.org#' + gajim.version.split('-', 1)[ 0]) for f in (nbxmpp.NS_BYTESTREAM, nbxmpp.NS_SI, nbxmpp.NS_FILE, - nbxmpp.NS_COMMANDS, nbxmpp.NS_JINGLE_FILE_TRANSFER, + nbxmpp.NS_COMMANDS, nbxmpp.NS_JINGLE_FILE_TRANSFER_5, nbxmpp.NS_JINGLE_XTLS, nbxmpp.NS_PUBKEY_PUBKEY, nbxmpp.NS_PUBKEY_REVOKE, nbxmpp.NS_PUBKEY_ATTEST): feature = nbxmpp.Node('feature') diff --git a/src/common/helpers.py b/src/common/helpers.py index 4d3b5b431..0d8f4cf70 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -1289,7 +1289,7 @@ def update_optional_features(account = None): gajim.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_RTP_VIDEO) gajim.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_ICE_UDP) gajim.gajim_optional_features[a].append( - nbxmpp.NS_JINGLE_FILE_TRANSFER) + nbxmpp.NS_JINGLE_FILE_TRANSFER_5) gajim.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_XTLS) gajim.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_BYTESTREAM) gajim.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_IBB) diff --git a/src/common/jingle_content.py b/src/common/jingle_content.py index 9d82c821f..4108f8ebc 100644 --- a/src/common/jingle_content.py +++ b/src/common/jingle_content.py @@ -175,7 +175,7 @@ class JingleContent: def _fill_content(self, content): description_node = nbxmpp.simplexml.Node( - tag=nbxmpp.NS_JINGLE_FILE_TRANSFER + ' description') + tag=nbxmpp.NS_JINGLE_FILE_TRANSFER_5 + ' description') file_tag = description_node.setTag('file') if self.file_props.name: node = nbxmpp.simplexml.Node(tag='name') diff --git a/src/common/jingle_ft.py b/src/common/jingle_ft.py index 1aa4a431a..3f7eae168 100644 --- a/src/common/jingle_ft.py +++ b/src/common/jingle_ft.py @@ -155,7 +155,7 @@ class JingleFileTransfer(JingleContent): checksum = nbxmpp.Node(tag='checksum', payload=[nbxmpp.Node(tag='file', payload=[self._compute_hash()])]) - checksum.setNamespace(nbxmpp.NS_JINGLE_FILE_TRANSFER) + checksum.setNamespace(nbxmpp.NS_JINGLE_FILE_TRANSFER_5) self.session.__session_info(checksum) pjid = gajim.get_jid_without_resource(self.session.peerjid) file_info = {'name' : self.file_props.name, @@ -410,4 +410,4 @@ class JingleFileTransfer(JingleContent): def get_content(desc): return JingleFileTransfer -contents[nbxmpp.NS_JINGLE_FILE_TRANSFER] = get_content +contents[nbxmpp.NS_JINGLE_FILE_TRANSFER_5] = get_content diff --git a/src/filetransfers_window.py b/src/filetransfers_window.py index 456874d09..7d1ab5483 100644 --- a/src/filetransfers_window.py +++ b/src/filetransfers_window.py @@ -40,7 +40,7 @@ from common import helpers from common.file_props import FilesProp from common.protocol.bytestream import (is_transfer_active, is_transfer_paused, is_transfer_stopped) -from nbxmpp.protocol import NS_JINGLE_FILE_TRANSFER +from nbxmpp.protocol import NS_JINGLE_FILE_TRANSFER_5 import logging log = logging.getLogger('gajim.filetransfer_window') @@ -357,7 +357,7 @@ class FileTransfersWindow: file_path, file_name, file_desc) if file_props is None: return False - if contact.supports(NS_JINGLE_FILE_TRANSFER): + if contact.supports(NS_JINGLE_FILE_TRANSFER_5): log.info("contact %s supports jingle file transfer"%(contact.get_full_jid())) gajim.connections[account].start_file_transfer(contact.get_full_jid(), file_props) diff --git a/src/gui_menu_builder.py b/src/gui_menu_builder.py index 58f892533..d96a6ad18 100644 --- a/src/gui_menu_builder.py +++ b/src/gui_menu_builder.py @@ -27,7 +27,7 @@ from common import gajim from common import helpers from common import i18n from nbxmpp.protocol import NS_COMMANDS, NS_FILE, NS_MUC, NS_ESESSION -from nbxmpp.protocol import NS_JINGLE_FILE_TRANSFER, NS_CONFERENCE +from nbxmpp.protocol import NS_JINGLE_FILE_TRANSFER_5, NS_CONFERENCE from gtkgui_helpers import get_action def build_resources_submenu(contacts, account, action, room_jid=None, @@ -260,7 +260,7 @@ control=None, gc_contact=None, is_anonymous=True): else: start_chat_menuitem.connect('activate', gajim.interface.on_open_chat_window, contact, account) - if contact.supports(NS_FILE) or contact.supports(NS_JINGLE_FILE_TRANSFER): + if contact.supports(NS_FILE) or contact.supports(NS_JINGLE_FILE_TRANSFER_5): send_file_menuitem.set_sensitive(True) send_file_menuitem.connect('activate', roster.on_send_file_menuitem_activate, contact, account)