Fix Bonjour code to not rely on undeclared variables.

This commit is contained in:
Emmanuel Gil Peyrot 2016-11-05 15:16:20 +00:00
parent 32db80c7ef
commit 20637b2ef1
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
from common import gajim
import select
import re
from common.zeroconf.zeroconf import C_BARE_NAME, C_DOMAIN
from common.zeroconf.zeroconf import C_BARE_NAME, C_DOMAIN, C_TXT
try:
import pybonjour
@ -171,7 +171,7 @@ class Zeroconf:
if name != self.name:
# update TXT data only, as intended according to resolve_all comment
old_contact = self.contacts[name]
self.contacts[name] = old_contact[0:C_TXT] + (txt,) + old_contact[C_TXT+1:]
self.contacts[name] = old_contact[0:C_TXT] + (self.txt,) + old_contact[C_TXT+1:]
def service_added_callback(self, sdRef, flags, errorCode, name, regtype, domain):