mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
simplify replying to stories
no need to create thread before sending
This commit is contained in:
parent
e89c1ac9ef
commit
a45844b50e
@ -86,7 +86,7 @@ import awais.instagrabber.models.stickers.SliderModel;
|
|||||||
import awais.instagrabber.models.stickers.SwipeUpModel;
|
import awais.instagrabber.models.stickers.SwipeUpModel;
|
||||||
import awais.instagrabber.repositories.requests.StoryViewerOptions;
|
import awais.instagrabber.repositories.requests.StoryViewerOptions;
|
||||||
import awais.instagrabber.repositories.requests.StoryViewerOptions.Type;
|
import awais.instagrabber.repositories.requests.StoryViewerOptions.Type;
|
||||||
import awais.instagrabber.repositories.requests.directmessages.ThreadIdOrUserIds;
|
import awais.instagrabber.repositories.requests.directmessages.ThreadIdsOrUserIds;
|
||||||
import awais.instagrabber.utils.AppExecutors;
|
import awais.instagrabber.utils.AppExecutors;
|
||||||
import awais.instagrabber.utils.Constants;
|
import awais.instagrabber.utils.Constants;
|
||||||
import awais.instagrabber.utils.CookieUtils;
|
import awais.instagrabber.utils.CookieUtils;
|
||||||
@ -221,23 +221,11 @@ public class StoryViewerFragment extends Fragment {
|
|||||||
final AlertDialog ad = new AlertDialog.Builder(context)
|
final AlertDialog ad = new AlertDialog.Builder(context)
|
||||||
.setTitle(R.string.reply_story)
|
.setTitle(R.string.reply_story)
|
||||||
.setView(input)
|
.setView(input)
|
||||||
.setPositiveButton(R.string.confirm, (d, w) -> directMessagesService.createThread(
|
.setPositiveButton(R.string.confirm, (d, w) -> directMessagesService.broadcastStoryReply(
|
||||||
csrfToken,
|
csrfToken,
|
||||||
userId,
|
userId,
|
||||||
deviceId,
|
deviceId,
|
||||||
Collections.singletonList(currentStory.getUserId()),
|
ThreadIdsOrUserIds.Companion.ofOneUser(String.valueOf(currentStory.getUserId())),
|
||||||
null,
|
|
||||||
CoroutineUtilsKt.getContinuation((thread, throwable) -> AppExecutors.INSTANCE.getMainThread().execute(() -> {
|
|
||||||
if (throwable != null) {
|
|
||||||
Log.e(TAG, "onOptionsItemSelected: ", throwable);
|
|
||||||
Toast.makeText(context, R.string.downloader_unknown_error, Toast.LENGTH_SHORT).show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
directMessagesService.broadcastStoryReply(
|
|
||||||
csrfToken,
|
|
||||||
userId,
|
|
||||||
deviceId,
|
|
||||||
ThreadIdOrUserIds.of(thread.getThreadId()),
|
|
||||||
input.getText().toString(),
|
input.getText().toString(),
|
||||||
currentStory.getStoryMediaId(),
|
currentStory.getStoryMediaId(),
|
||||||
String.valueOf(currentStory.getUserId()),
|
String.valueOf(currentStory.getUserId()),
|
||||||
@ -251,9 +239,6 @@ public class StoryViewerFragment extends Fragment {
|
|||||||
Toast.makeText(context, R.string.answered_story, Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, R.string.answered_story, Toast.LENGTH_SHORT).show();
|
||||||
}), Dispatchers.getIO()
|
}), Dispatchers.getIO()
|
||||||
)
|
)
|
||||||
|
|
||||||
);
|
|
||||||
}), Dispatchers.getIO())
|
|
||||||
))
|
))
|
||||||
.setNegativeButton(R.string.cancel, null)
|
.setNegativeButton(R.string.cancel, null)
|
||||||
.show();
|
.show();
|
||||||
|
Loading…
Reference in New Issue
Block a user