Merge branch 'bug_fix' into sharedpref_uniq_id
This commit is contained in:
commit
401b6fc850
Binary file not shown.
|
@ -93,7 +93,19 @@ public class PostActionAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||||
else
|
else
|
||||||
api = new API(contextReference.get());
|
api = new API(contextReference.get());
|
||||||
if( remoteStatus != null){
|
if( remoteStatus != null){
|
||||||
Results search = api.search(remoteStatus.getReblog()!=null?remoteStatus.getReblog().getUri():remoteStatus.getUri());
|
String uri;
|
||||||
|
if( remoteStatus.getReblog() != null){
|
||||||
|
if( remoteStatus.getReblog().getUri().startsWith("http"))
|
||||||
|
uri = remoteStatus.getReblog().getUri();
|
||||||
|
else
|
||||||
|
uri = remoteStatus.getReblog().getUrl();
|
||||||
|
}else {
|
||||||
|
if( remoteStatus.getUri().startsWith("http"))
|
||||||
|
uri = remoteStatus.getUri();
|
||||||
|
else
|
||||||
|
uri = remoteStatus.getUrl();
|
||||||
|
}
|
||||||
|
Results search = api.search(uri);
|
||||||
if( search != null){
|
if( search != null){
|
||||||
List<fr.gouv.etalab.mastodon.client.Entities.Status> remoteStatuses = search.getStatuses();
|
List<fr.gouv.etalab.mastodon.client.Entities.Status> remoteStatuses = search.getStatuses();
|
||||||
if( remoteStatuses != null && remoteStatuses.size() > 0 ){
|
if( remoteStatuses != null && remoteStatuses.size() > 0 ){
|
||||||
|
|
|
@ -16,9 +16,7 @@ package fr.gouv.etalab.mastodon.asynctasks;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
import fr.gouv.etalab.mastodon.client.API;
|
import fr.gouv.etalab.mastodon.client.API;
|
||||||
import fr.gouv.etalab.mastodon.client.Entities.Results;
|
import fr.gouv.etalab.mastodon.client.Entities.Results;
|
||||||
import fr.gouv.etalab.mastodon.interfaces.OnRetrieveRemoteAccountInterface;
|
import fr.gouv.etalab.mastodon.interfaces.OnRetrieveRemoteAccountInterface;
|
||||||
|
|
|
@ -1111,8 +1111,10 @@ public class API {
|
||||||
results = parseResultsResponse(new JSONObject(response));
|
results = parseResultsResponse(new JSONObject(response));
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||||
setError(e.getStatusCode(), e);
|
setError(e.getStatusCode(), e);
|
||||||
|
e.printStackTrace();
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
setDefaultError();
|
setDefaultError();
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ package fr.gouv.etalab.mastodon.drawers;
|
||||||
* see <http://www.gnu.org/licenses>. */
|
* see <http://www.gnu.org/licenses>. */
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
@ -1162,10 +1161,18 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
||||||
Intent sendIntent = new Intent(Intent.ACTION_SEND);
|
Intent sendIntent = new Intent(Intent.ACTION_SEND);
|
||||||
sendIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.shared_via));
|
sendIntent.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.shared_via));
|
||||||
String url;
|
String url;
|
||||||
if( status.getReblog() != null)
|
|
||||||
url = status.getReblog().getUri();
|
if( status.getReblog() != null) {
|
||||||
else
|
if( status.getReblog().getUri().startsWith("http"))
|
||||||
url = status.getUri();
|
url = status.getReblog().getUri();
|
||||||
|
else
|
||||||
|
url = status.getReblog().getUrl();
|
||||||
|
}else {
|
||||||
|
if( status.getUri().startsWith("http"))
|
||||||
|
url = status.getUri();
|
||||||
|
else
|
||||||
|
url = status.getUrl();
|
||||||
|
}
|
||||||
sendIntent.putExtra(Intent.EXTRA_TEXT, url);
|
sendIntent.putExtra(Intent.EXTRA_TEXT, url);
|
||||||
sendIntent.setType("text/plain");
|
sendIntent.setType("text/plain");
|
||||||
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
|
context.startActivity(Intent.createChooser(sendIntent, context.getString(R.string.share_with)));
|
||||||
|
|
|
@ -222,8 +222,21 @@ public class CrossActions {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground(Void... voids) {
|
protected Void doInBackground(Void... voids) {
|
||||||
|
|
||||||
API api = new API(contextReference.get(), account.getInstance(), account.getToken());
|
API api = new API(contextReference.get(), account.getInstance(), account.getToken());
|
||||||
Results search = api.search(status.getReblog()!=null?status.getReblog().getUri():status.getUri());
|
String uri;
|
||||||
|
if(status.getReblog() != null ){
|
||||||
|
if( status.getReblog().getUri().startsWith("http"))
|
||||||
|
uri = status.getReblog().getUri();
|
||||||
|
else
|
||||||
|
uri = status.getReblog().getUrl();
|
||||||
|
}else {
|
||||||
|
if( status.getUri().startsWith("http"))
|
||||||
|
uri = status.getUri();
|
||||||
|
else
|
||||||
|
uri = status.getUrl();
|
||||||
|
}
|
||||||
|
Results search = api.search(uri);
|
||||||
if( search != null){
|
if( search != null){
|
||||||
remoteStatuses = search.getStatuses();
|
remoteStatuses = search.getStatuses();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue