Update to XEP-0234 version 0.18.0 (:5 namespace).
This commit is contained in:
parent
785a0b61e0
commit
aad5c16054
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue