Commit 3f12ad0f authored by Thomas's avatar Thomas
Browse files

#1122 - Support instance only for GoToSocial

parent e83b4d1a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ public interface MastodonStatusesService {
            @Field("visibility") String visibility,
            @Field("language") String language,
            @Field("quote_id") String quote_id,
            @Field("content_type") String content_type
            @Field("content_type") String content_type,
            @Field("local_only") Boolean local_only
    );

    @GET("statuses/{id}/source")
+1 −1
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ public class ComposeWorker extends Worker {
                if (dataPost.scheduledDate == null) {
                    if (dataPost.statusEditId == null) {
                        statusCall = mastodonStatusesService.createStatus(null, dataPost.token, statuses.get(i).text, attachmentIds, poll_options, poll_expire_in,
                                poll_multiple, poll_hide_totals, statuses.get(i).quote_id == null ? in_reply_to_status : null, statuses.get(i).sensitive, statuses.get(i).spoilerChecked ? statuses.get(i).spoiler_text : null, statuses.get(i).visibility.toLowerCase(), statuses.get(i).language, statuses.get(i).quote_id, statuses.get(i).content_type);
                                poll_multiple, poll_hide_totals, statuses.get(i).quote_id == null ? in_reply_to_status : null, statuses.get(i).sensitive, statuses.get(i).spoilerChecked ? statuses.get(i).spoiler_text : null, statuses.get(i).visibility.toLowerCase(), statuses.get(i).language, statuses.get(i).quote_id, statuses.get(i).content_type, statuses.get(i).local_only);
                    } else { //Status is edited
                        StatusParams statusParams = new StatusParams();
                        statusParams.status = statuses.get(i).text;
+3 −2
Original line number Diff line number Diff line
@@ -189,12 +189,13 @@ public class StatusesVM extends AndroidViewModel {
                                       String visibility,
                                       String language,
                                       String quote_id,
                                       String content_type) {
                                       String content_type,
                                       Boolean local_only) {
        MastodonStatusesService mastodonStatusesService = init(instance);
        statusMutableLiveData = new MutableLiveData<>();
        new Thread(() -> {
            Call<Status> statusCall = mastodonStatusesService.createStatus(idempotency_Key, token, text, media_ids, poll_options, poll_expire_in,
                    poll_multiple, poll_hide_totals, in_reply_to_id, sensitive, spoiler_text, visibility, language, quote_id, content_type);
                    poll_multiple, poll_hide_totals, in_reply_to_id, sensitive, spoiler_text, visibility, language, quote_id, content_type, local_only);
            Status status = null;
            if (statusCall != null) {
                try {
+2 −2
Original line number Diff line number Diff line
@@ -2046,7 +2046,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
                        viewModelComment.comment(ADD_COMMENT, peertube.getId(), null, commentStr).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(ADD_COMMENT, 0, apiResponse1));
                    } else {//Remote account is posting a message
                        StatusesVM statusesVM = new ViewModelProvider(PeertubeActivity.this).get(StatusesVM.class);
                        statusesVM.postStatus(currentInstance, currentToken, null, commentStr, null, null, null, null, null, status.id, false, null, "public", null, null, null).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon);
                        statusesVM.postStatus(currentInstance, currentToken, null, commentStr, null, null, null, null, null, status.id, false, null, "public", null, null, null, null).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon);
                    }
                    binding.addCommentWrite.setText("");
                }
@@ -2058,7 +2058,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
                        viewModelComment.comment(REPLY, peertube.getId(), comment.getId(), commentView).observe(PeertubeActivity.this, apiResponse1 -> manageVIewPostActions(REPLY, position, apiResponse1));
                    } else {//Remote account is posting a message
                        StatusesVM statusesVM = new ViewModelProvider(PeertubeActivity.this).get(StatusesVM.class);
                        statusesVM.postStatus(currentInstance, currentToken, null, commentView, null, null, null, null, null, status.id, false, null, "public", null, null, null).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon);
                        statusesVM.postStatus(currentInstance, currentToken, null, commentView, null, null, null, null, null, status.id, false, null, "public", null, null, null, null).observe(PeertubeActivity.this, this::manageVIewPostActionsMastodon);
                    }
                    binding.addCommentWrite.setText("");
                }