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