Fix last DCC errors
This commit is contained in:
parent
e4ea24bfa9
commit
9e7442ade7
4
DCC.py
4
DCC.py
@ -54,7 +54,7 @@ class DCC(threading.Thread):
|
|||||||
|
|
||||||
def setError(self, msg):
|
def setError(self, msg):
|
||||||
self.error = True
|
self.error = True
|
||||||
self.srv.send_msg_usr(dest, msg)
|
self.srv.send_msg_usr(self.sender, msg)
|
||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
if self.connected:
|
if self.connected:
|
||||||
@ -109,7 +109,7 @@ class DCC(threading.Thread):
|
|||||||
print ('Listen on', self.port, "for", self.sender)
|
print ('Listen on', self.port, "for", self.sender)
|
||||||
|
|
||||||
#Send CTCP request for DCC
|
#Send CTCP request for DCC
|
||||||
self.srv.send_ctcp(self.nick, "DCC %s %s %d %d %s" % (type, filename, self.srv.ip, self.port, size), "PRIVMSG")
|
self.srv.send_ctcp(self.sender, "DCC %s %s %d %d %s" % (type, filename, self.srv.ip, self.port, size), "PRIVMSG")
|
||||||
|
|
||||||
s.listen(1)
|
s.listen(1)
|
||||||
#Waiting for the client
|
#Waiting for the client
|
||||||
|
@ -280,8 +280,8 @@ class Message:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
elif self.cmd[0] == "dcctest":
|
elif self.cmd[0] == "dcctest":
|
||||||
print("dcctest")
|
print("dcctest for", self.sender)
|
||||||
self.srv.send_dcc("Test DCC", self.name)
|
self.srv.send_dcc("Test DCC", self.sender)
|
||||||
elif self.cmd[0] == "pvdcctest":
|
elif self.cmd[0] == "pvdcctest":
|
||||||
print("dcctest")
|
print("dcctest")
|
||||||
self.send_snd("Test DCC")
|
self.send_snd("Test DCC")
|
||||||
|
@ -107,8 +107,8 @@ class Server(threading.Thread):
|
|||||||
"""Send a message through DCC connection"""
|
"""Send a message through DCC connection"""
|
||||||
if msg is not None and to is not None:
|
if msg is not None and to is not None:
|
||||||
realname = to.split("!")[1]
|
realname = to.split("!")[1]
|
||||||
if to not in self.dcc_clients.keys():
|
if realname not in self.dcc_clients.keys():
|
||||||
d = dcc.DCC(self, realname)
|
d = dcc.DCC(self, to)
|
||||||
self.dcc_clients[realname] = d
|
self.dcc_clients[realname] = d
|
||||||
self.dcc_clients[realname].send_dcc(msg)
|
self.dcc_clients[realname].send_dcc(msg)
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ class Server(threading.Thread):
|
|||||||
|
|
||||||
def send_msg_usr(self, user, msg):
|
def send_msg_usr(self, user, msg):
|
||||||
if user is not None and user[0] != "#":
|
if user is not None and user[0] != "#":
|
||||||
realname = to.split("!")[1]
|
realname = user.split("!")[1]
|
||||||
if realname in self.dcc_clients:
|
if realname in self.dcc_clients:
|
||||||
self.send_dcc(msg, user)
|
self.send_dcc(msg, user)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user