refactoring
This commit is contained in:
parent
eec056ccd1
commit
78e7361bf2
|
@ -60,6 +60,8 @@ class JingleTransport(object):
|
|||
"""
|
||||
pass
|
||||
|
||||
|
||||
|
||||
def make_transport(self, candidates=None):
|
||||
"""
|
||||
Build a transport stanza with the given candidates (or self.candidates if
|
||||
|
@ -78,6 +80,20 @@ class JingleTransport(object):
|
|||
"""
|
||||
return []
|
||||
|
||||
def set_connection(self, conn):
|
||||
self.connection = conn
|
||||
if not self.sid:
|
||||
self.sid = self.connection.connection.getAnID()
|
||||
|
||||
def set_file_props(self, file_props):
|
||||
self.file_props = file_props
|
||||
|
||||
def set_our_jid(self, jid):
|
||||
self.ourjid = jid
|
||||
|
||||
def set_sid(self, sid):
|
||||
self.sid = sid
|
||||
|
||||
class JingleTransportSocks5(JingleTransport):
|
||||
"""
|
||||
Socks5 transport in jingle scenario
|
||||
|
@ -91,16 +107,6 @@ class JingleTransportSocks5(JingleTransport):
|
|||
if node and node.getAttr('sid'):
|
||||
self.sid = node.getAttr('sid')
|
||||
|
||||
def set_file_props(self, file_props):
|
||||
self.file_props = file_props
|
||||
|
||||
def set_our_jid(self, jid):
|
||||
self.ourjid = jid
|
||||
|
||||
def set_connection(self, conn):
|
||||
self.connection = conn
|
||||
if not self.sid:
|
||||
self.sid = self.connection.connection.getAnID()
|
||||
|
||||
def make_candidate(self, candidate):
|
||||
import logging
|
||||
|
@ -309,9 +315,6 @@ class JingleTransportIBB(JingleTransport):
|
|||
self.sid = node.getAttr('sid')
|
||||
|
||||
|
||||
def set_sid(self, sid):
|
||||
self.sid = sid
|
||||
|
||||
def make_transport(self):
|
||||
|
||||
transport = xmpp.Node('transport')
|
||||
|
@ -320,10 +323,6 @@ class JingleTransportIBB(JingleTransport):
|
|||
transport.setAttr('sid', self.sid)
|
||||
return transport
|
||||
|
||||
def set_file_props(self, file_props):
|
||||
self.file_props = file_props
|
||||
|
||||
|
||||
import farsight
|
||||
|
||||
class JingleTransportICEUDP(JingleTransport):
|
||||
|
|
Loading…
Reference in New Issue