Daniel Brötzmann pushed to branch master at gajim / gajim
Commits: 10cb5866 by Stephen Paul Weber at 2022-02-23T18:21:27+01:00 XEP-0260 <candidate port="" /> is optional
XEP-0065 specifies that the default is 1080.
Previously, sending Gajim a <candidate/> with no port would result in a backtrace, since int() does not accept NoneType. Now it will correctly fall back to the default port.
- - - - -
1 changed file:
- gajim/common/jingle_transport.py
Changes:
===================================== gajim/common/jingle_transport.py ===================================== @@ -154,16 +154,13 @@ def make_transport(self, candidates=None, add_candidates=True): def parse_transport_stanza(self, transport): candidates = [] for candidate in transport.iterTags('candidate'): - typ = 'direct' # default value - if candidate.has_attr('type'): - typ = candidate['type'] cand = { 'state': 0, 'target': self.ourjid, 'host': candidate['host'], - 'port': int(candidate['port']), + 'port': int(candidate.get('port', 1080)), 'candidate_id': candidate['cid'], - 'type': typ, + 'type': candidate.get('type', 'direct'), 'priority': candidate['priority'] } candidates.append(cand)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/10cb58663bbbf6dcc7e9738ad8a6739e8...