package app.hima.net;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import android.os.AsyncTask;
import app.hima.tool.Preferences;

public class SendUserMessage extends AsyncTask<String, Integer, Boolean> {

	@Override
	protected Boolean doInBackground(String... params) {
		try {
			final String URL = ServerRequest.SERVER + "sendUserMessage.pl?user="+Preferences.id+"&receiver="+params[1]+"&message="+URLEncoder.encode(params[0], "UTF-8");
			String res = ServerRequest.send(URL);
			return res.equals("1");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		return false;
	}

}
