diff --git a/client/download/homerRasta.jpg b/client/download/homerRasta.jpg new file mode 100644 index 0000000..827a4de Binary files /dev/null and b/client/download/homerRasta.jpg differ diff --git a/client/download/wallpaper targaryen_sigil.jpg b/client/download/wallpaper targaryen_sigil.jpg new file mode 100644 index 0000000..ba24968 Binary files /dev/null and b/client/download/wallpaper targaryen_sigil.jpg differ diff --git a/client/start.py b/client/start.py index 71023b8..e7270d9 100755 --- a/client/start.py +++ b/client/start.py @@ -538,9 +538,11 @@ class start(QtGui.QMainWindow): self.s.send("/userlistaway".encode()) if self.codeNb(txt.split(" ")[0]) == "HAS_ASKED_FILE": - self.ShowMessageOK(txt.split(" ")[1]+" share a file with you, do you want download "+' '.join(txt.split(" ")[2].split("/")[-1:])+" ?") - self.questionMessage(txt.split(" ")[1],txt.split(" ")[2]) - self.fileNom = ' '.join(txt.split(" ")[2].split("/")[-1:]) + nomfichierEn = ' '.join(txt.split(" ")[2:]) + nomfichier = ' '.join(nomfichierEn.split("/")[-1:]) + self.ShowMessageOK(txt.split(" ")[1]+" share a file with you, do you want download "+nomfichier+" ?") + self.questionMessage(txt.split(" ")[1],nomfichierEn) + self.fileNom = nomfichier if self.codeNb(txt.split(" ")[0]) == "SUCC_ASKED_FILE": self.ShowMessageOK("Succes asked file") @@ -555,7 +557,8 @@ class start(QtGui.QMainWindow): ms = socket(AF_INET, SOCK_STREAM) print(txt.split(" ")[2]+" "+txt.split(" ")[3]) ms.connect((str(txt.split(" ")[2]), int(txt.split(" ")[3]))) - f = open(txt.split(" ")[4], "rb") + namefichier = ' '.join(txt.split(" ")[4:]) + f = open(namefichier, "rb") data = f.read() f.close() ms.send(data) diff --git a/server/Server.py b/server/Server.py index bd3059d..36b976b 100644 --- a/server/Server.py +++ b/server/Server.py @@ -181,16 +181,16 @@ def handle_request(connection, data): reject_private_message(connection, array_data[1]) return if array_data[0] == "/pm": - private_message(connection, array_data[1], " ".join(array_data[2:])) + private_message(connection, array_data[1], " ".join(array_data[2:]).strip()) return if array_data[0] == "/pmfile": - ask_file(connection, array_data[1], " ".join(array_data[2:])) + ask_file(connection, array_data[1], " ".join(array_data[2:]).strip()) return if array_data[0] == "/acceptfile": - accept_file(connection, array_data[1], " ".join(array_data[3:]), array_data[2]) + accept_file(connection, array_data[1], " ".join(array_data[3:]).strip(), array_data[2]) return if array_data[0] == "/rejectfile": - reject_file(connection, array_data[1], " ".join(array_data[2:])) + reject_file(connection, array_data[1], " ".join(array_data[2:]).strip()) return connection.sendall("{}".format(COMMAND_NOT_FOUND).encode()) else: @@ -310,7 +310,7 @@ def ask_private_message(connection, pseudo): ERR_ALREADY_ASKED_FOR_PM), Log.lvl.INFO) else: askPM.append(pm) - log.printL("askPm {}".format(askPM), Log.lvl.DEBUG) + #log.printL("askPm {}".format(askPM), Log.lvl.DEBUG) c.sendall("{} {}".format(ASKING_FOR_PM, usersConnected[connection][1]).encode()) log.printL("Send to {} : {} {}".format(usersConnected[c][0], ASKING_FOR_PM, usersConnected[connection][1]), Log.lvl.INFO)