Gestion des fenetres de clavardage

This commit is contained in:
Nabzzz 2020-12-20 15:04:31 +01:00
parent 2caf30da03
commit 711cc37040

View file

@ -64,7 +64,7 @@ public class SessionClavardage extends Thread {
public void arretSession() {
MessageHorodate msgh = new MessageHorodate(getU2(),getApp().getMe(),".",2);
try {
getOut().writeObject(msgh);
getOut().writeObject(msgh.toString());
} catch (IOException e) {
e.printStackTrace();
}
@ -79,7 +79,7 @@ public class SessionClavardage extends Thread {
public void envoiMsg(String msg) {
MessageHorodate msgh = new MessageHorodate(getU2(),getApp().getMe(),msg,1);
try {
getOut().writeObject(msgh);
getOut().writeObject(msgh.toString());
} catch (IOException e) {
e.printStackTrace();
}
@ -93,10 +93,12 @@ public class SessionClavardage extends Thread {
public void run() {
String plaintext = null;
MessageHorodate msg = null;
while(true) {
try {
msg = (MessageHorodate) getIn().readObject();
plaintext = (String) getIn().readObject();
msg = MessageHorodate.stringToMessageHorodate(plaintext);
} catch (ClassNotFoundException e) {
e.printStackTrace();