Commit 884e66e5 authored by dkirov's avatar dkirov

some bugs fixed

parent da309569
......@@ -91,7 +91,8 @@ class P2PClient(IdleObject):
self._owner = self
self.Namespace = 'jabber:client'
self.defaultNamespace = self.Namespace
self._component=0
self._component = 0
self._registered_name = None
self._caller = caller
self.Server = host
self.DBG = 'client'
......@@ -163,9 +164,6 @@ class P2PConnection(IdleObject, PlugIn):
self.on_connect = on_connect
self.writable = False
self.readable = False
# waiting for first bytes
# start waiting for data
self._registered_name = None
self._exported_methods=[self.send, self.disconnect, self.onreceive]
self.on_receive = None
if _sock:
......@@ -220,8 +218,8 @@ class P2PConnection(IdleObject, PlugIn):
r = stanza
if isinstance(r, unicode):
r = r.encode('utf-8')
#~ elif not isinstance(r, str):
#~ r = ustr(r).encode('utf-8')
elif not isinstance(r, str):
r = ustr(r).encode('utf-8')
self.sendqueue.append(r)
self._plug_idle()
......
......@@ -235,11 +235,12 @@ class ConnectionHandlersZeroconf(ConnectionVcard):
tim = msg.getTimestamp()
tim = time.strptime(tim, '%Y%m%dT%H:%M:%S')
tim = time.localtime(timegm(tim))
frm = str(msg.getFrom())
frm = msg.getFrom()
if frm == None:
for key in self.zeroconf.contacts:
if ip == self.zeroconf.contacts[key][zeroconf.C_ADDRESS]:
frm = key
frm = str(frm)
jid = frm
no_log_for = gajim.config.get_per('accounts', self.name,
'no_log_for').split()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment