Patrick Glavin hace 6 años
padre
commit
ee8a40c78d
Se han modificado 2 ficheros con 16 adiciones y 2 borrados
  1. 14
    0
      Client/src/main/java/DMGetter.java
  2. 2
    2
      Client/src/main/java/SimpleShell.java

+ 14
- 0
Client/src/main/java/DMGetter.java Ver fichero

@@ -0,0 +1,14 @@
1
+public class DMGetter implements Runnable{
2
+    private User user;
3
+    private YouAreEll webber;
4
+
5
+    public DMGetter(User user, YouAreEll webber) {
6
+        this.user = user;
7
+        this.webber = webber;
8
+    }
9
+
10
+    public void run() {
11
+        String results = webber.get_DMs(user);
12
+        SimpleShell.prettyPrintMessages(results);
13
+    }
14
+}

+ 2
- 2
Client/src/main/java/SimpleShell.java Ver fichero

@@ -120,8 +120,8 @@ public class SimpleShell {
120 120
                 // you need to add a bunch more.
121 121
 
122 122
                 if (list.contains("dms")) {
123
-                    String results = webber.get_DMs(user);
124
-                    SimpleShell.prettyPrintMessages(results);
123
+                    Thread thread = new Thread(new DMGetter(user, webber));
124
+                    thread.start();
125 125
                     continue;
126 126
                 }
127 127