Merge branch 'master' of https://git.etud.insa-toulouse.fr/gallois/Clavardage
This commit is contained in:
commit
a168df58fb
1 changed files with 8 additions and 5 deletions
|
@ -190,16 +190,18 @@ public class Controller {
|
|||
|
||||
String tmpPseudo = view.PseudotextField.getText(); // Read user input
|
||||
|
||||
while(!(this.validatePseudo(tmpPseudo)) || tmpPseudo.equals(oldPseudo)) {
|
||||
if(!(this.validatePseudo(tmpPseudo)) || tmpPseudo.equals(oldPseudo)) {
|
||||
view.Pseudolabel.setText("Already exists, enter another nickname. Your current username is: " + oldPseudo); // Read user input
|
||||
tmpPseudo = view.PseudotextField.getText(); // Read user input
|
||||
}
|
||||
else {
|
||||
this.myUser.setPseudo(tmpPseudo);
|
||||
JOptionPane.showMessageDialog(null ,"Your new nickname : " + tmpPseudo + " is valid !");
|
||||
this.notify_remote_users();
|
||||
|
||||
this.myUser.setPseudo(tmpPseudo);
|
||||
}
|
||||
|
||||
JOptionPane.showMessageDialog(null ,"Your new nickname : " + tmpPseudo + " is valid !");
|
||||
|
||||
this.notify_remote_users();
|
||||
}
|
||||
/**
|
||||
* <p>
|
||||
|
@ -380,11 +382,12 @@ public class Controller {
|
|||
}
|
||||
|
||||
public void askCloseSession() {
|
||||
closeSession(this.activeChat);
|
||||
this.activeChat = null;
|
||||
}
|
||||
public void closeSession(Chat c) {
|
||||
sendMessage(new Msg_Text(myUser.getAddIP(),"end"), c); // tell rm session STOP
|
||||
JOptionPane.showMessageDialog(null ,"Close session with "+c.getRemoteUser().getPseudo()+" loading history");
|
||||
JOptionPane.showMessageDialog(null ,"Close session with "+c.getRemoteUser().getPseudo());
|
||||
this.myUser.closeChat(c);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue