Add partially-functioning getfile command
[fonbot.git] / src / ro / ieval / fonbot / Utils.java
index c425420e84013dfa545d55ff2e6633853304d044..f37773a2a98b8de22711d1568e157755be611d7c 100644 (file)
@@ -65,7 +65,7 @@ public final class Utils {
                LS, RM, CONTACTS, DISABLE, ENABLE,
                POLL, HANGUP, ANSWER, LAUNCH, DATA,
                GPS, GLOCATION, REBOOT, NOTIFY, SCREENCAP,
-               TORCH
+               TORCH, GETFILE
        }
 
        /**
@@ -986,6 +986,22 @@ public final class Utils {
                case TORCH:
                        Heavy.torch(context, replyTo);
                        break;
+
+               case GETFILE:
+                       if(args.length != 3){
+                               Heavy.help(context, replyTo, toNonNull(Command.GETFILE));
+                               return;
+                       }
+
+                       final int getfilePort;
+                       try{
+                               getfilePort=Integer.parseInt(args[2]);
+                       } catch (NumberFormatException e){
+                               sendMessage(context, replyTo, cannot_parse_port);
+                               break;
+                       }
+                       Heavy.getfile(context, replyTo, toNonNull(args[0]), toNonNull(args[1]), getfilePort);
+                       break;
                }
 
        }
This page took 0.009762 seconds and 4 git commands to generate.