X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Ffonbot%2FUtils.java;h=e14095ea4695e4301b33215e64731786b77a561c;hb=2e5049c9c08b1989b4bfbbfbf479d83dbe2b75a9;hp=d9060eb662734475026200ef84587260ef931794;hpb=bf70dcc30a9bd5cbcd71aa8481f7171331f9f1b6;p=fonbot.git diff --git a/src/ro/ieval/fonbot/Utils.java b/src/ro/ieval/fonbot/Utils.java index d9060eb..e14095e 100644 --- a/src/ro/ieval/fonbot/Utils.java +++ b/src/ro/ieval/fonbot/Utils.java @@ -316,8 +316,8 @@ public final class Utils { public static void sendMessage(final Context context, final Address address, final String message){ switch(address.protocol){ case HTTP: - new SendHttpMessageAsyncTask("/send", toNonNull(Arrays.asList( - new Header("X-Destination", toNonNull(address.data)))), context).execute(message); + new HttpCallExecutableRunnable("/send", toNonNull(Arrays.asList( + new Header("X-Destination", toNonNull(address.data)))), context, null, message).execute(); break; case SMS: @@ -425,6 +425,15 @@ public final class Utils { return url; } + /** + * Poll the server for pending commands. + * + * @param context Context instance + */ + public static void pollServer(final Context context){ + new HttpCallExecutableRunnable("/get", null, context, new PollResultCallback(context)).execute(); + } + /** * Executes a given command *