Fix zeroconf connection and prevent invalid stanzas from being sent.
This commit is contained in:
parent
e80b0ba9b3
commit
1bf8a35b64
|
@ -753,9 +753,12 @@ class ClientZeroconf:
|
|||
|
||||
def send(self, stanza, is_message=False, now=False, on_ok=None,
|
||||
on_not_ok=None):
|
||||
stanza.setFrom(self.roster.zeroconf.name)
|
||||
to = stanza.getTo()
|
||||
if to is None:
|
||||
# Can’t send undirected stanza over Zeroconf.
|
||||
return -1
|
||||
to = gajim.get_jid_without_resource(to)
|
||||
stanza.setFrom(self.roster.zeroconf.name)
|
||||
|
||||
try:
|
||||
item = self.roster[to]
|
||||
|
|
|
@ -144,7 +144,7 @@ class Zeroconf:
|
|||
val += c
|
||||
if val is None: # missing '='
|
||||
val = ''
|
||||
txt_dict[key] = val.decode('utf-8', 'ignore')
|
||||
txt_dict[key] = val
|
||||
return txt_dict
|
||||
|
||||
def service_resolved_callback(self, interface, protocol, name, stype, domain,
|
||||
|
|
Loading…
Reference in New Issue