Develop #1

Open
HadiSharifi wants to merge 7 commits from develop into main
2 changed files with 4 additions and 4 deletions
Showing only changes of commit bb1d441c9b - Show all commits
@@ -12,7 +12,7 @@ import java.nio.file.Paths;
import java.util.Scanner;
public class chatClient {
public static void main() {
public static void main(String[] args) {
String host = "localhost";
int port = 9000;
@@ -54,7 +54,7 @@ public class chatClient {
System.out.println("Usage: /msg <user> <text>");
continue;
}
String target = parts[1];
String target = parts[1];
String text = parts[2];
out.writeObject(new ChatMessage(MessageType.PRIVATE_MESSAGE, username, target, text));
out.flush();
@@ -91,7 +91,7 @@ public class ClientSession implements Runnable {
}
case PRIVATE_MESSAGE -> {
ClientSession receiver = userManager.getUser(msg.getSender());
ClientSession receiver = userManager.getUser(msg.getReceiver());
if (receiver != null) {
receiver.sendMessage(msg);
}
@@ -107,7 +107,7 @@ public class ClientSession implements Runnable {
}
private void handleFileMessage(FileMessage fileMsg) throws IOException {
// Storing the file
var sentPath = FileManager.getSentPath(fileMsg.getSender(), fileMsg.getFilename());
var recvPath = FileManager.getReceivedPath(fileMsg.getReceiver(), fileMsg.getFilename());