mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-26 08:37:29 +00:00
small fixes
This commit is contained in:
parent
4b055c8050
commit
3f09de05f3
@ -169,6 +169,21 @@ public class DirectMessageThreadFragment extends Fragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMediaClick(final Media media) {
|
public void onMediaClick(final Media media) {
|
||||||
|
if (media.isReelMedia()) {
|
||||||
|
final String pk = media.getPk();
|
||||||
|
try {
|
||||||
|
final long mediaId = Long.parseLong(pk);
|
||||||
|
final User user = media.getUser();
|
||||||
|
if (user == null) return;
|
||||||
|
final String username = user.getUsername();
|
||||||
|
final NavDirections action = DirectMessageThreadFragmentDirections
|
||||||
|
.actionThreadToStory(StoryViewerOptions.forStory(mediaId, username));
|
||||||
|
NavHostFragment.findNavController(DirectMessageThreadFragment.this).navigate(action);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
Log.e(TAG, "onMediaClick (story): ", e);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
final PostViewV2Fragment.Builder builder = PostViewV2Fragment.builder(media);
|
final PostViewV2Fragment.Builder builder = PostViewV2Fragment.builder(media);
|
||||||
builder.build().show(getChildFragmentManager(), "post_view");
|
builder.build().show(getChildFragmentManager(), "post_view");
|
||||||
}
|
}
|
||||||
|
@ -56,10 +56,9 @@ public final class Constants {
|
|||||||
|
|
||||||
// spoof
|
// spoof
|
||||||
public static final String USER_AGENT = "Mozilla/5.0 (Linux; Android 8.1.0; motorola one Build/OPKS28.63-18-3; wv) " +
|
public static final String USER_AGENT = "Mozilla/5.0 (Linux; Android 8.1.0; motorola one Build/OPKS28.63-18-3; wv) " +
|
||||||
"AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36 " +
|
"AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36";
|
||||||
"Instagram 169.1.0.29.135 Android (27/8.1.0; 320dpi; 720x1362; motorola; motorola one; deen_sprout; qcom; pt_BR; 262886998)";
|
|
||||||
public static final String I_USER_AGENT =
|
public static final String I_USER_AGENT =
|
||||||
"Instagram 169.1.0.29.135 Android (27/8.1.0; 320dpi; 720x1362; motorola; motorola one; deen_sprout; qcom; pt_BR; 262886998)";
|
"Instagram 169.3.0.30.135 Android (27/8.1.0; 320dpi; 720x1362; motorola; motorola one; deen_sprout; qcom; pt_BR; 264009054)";
|
||||||
public static final String A_USER_AGENT = "https://Barinsta.AustinHuang.me / mailto:Barinsta@AustinHuang.me";
|
public static final String A_USER_AGENT = "https://Barinsta.AustinHuang.me / mailto:Barinsta@AustinHuang.me";
|
||||||
// see https://github.com/dilame/instagram-private-api/blob/master/src/core/constants.ts
|
// see https://github.com/dilame/instagram-private-api/blob/master/src/core/constants.ts
|
||||||
public static final String SUPPORTED_CAPABILITIES = "[ { \"name\": \"SUPPORTED_SDK_VERSIONS\", \"value\":" +
|
public static final String SUPPORTED_CAPABILITIES = "[ { \"name\": \"SUPPORTED_SDK_VERSIONS\", \"value\":" +
|
||||||
|
@ -56,7 +56,6 @@ public class FeedService extends BaseService {
|
|||||||
form.put("device_id", UUID.randomUUID().toString());
|
form.put("device_id", UUID.randomUUID().toString());
|
||||||
form.put("client_session_id", UUID.randomUUID().toString());
|
form.put("client_session_id", UUID.randomUUID().toString());
|
||||||
form.put("is_prefetch", "0");
|
form.put("is_prefetch", "0");
|
||||||
form.put("timezone_offset", String.valueOf(TimeZone.getDefault().getRawOffset() / 1000));
|
|
||||||
if (!TextUtils.isEmpty(cursor)) {
|
if (!TextUtils.isEmpty(cursor)) {
|
||||||
form.put("max_id", cursor);
|
form.put("max_id", cursor);
|
||||||
form.put("reason", "pagination");
|
form.put("reason", "pagination");
|
||||||
@ -110,7 +109,6 @@ public class FeedService extends BaseService {
|
|||||||
final List<Media> allPosts = new ArrayList<>();
|
final List<Media> allPosts = new ArrayList<>();
|
||||||
final List<Media> items = feedFetchResponse.getItems();
|
final List<Media> items = feedFetchResponse.getItems();
|
||||||
for (final Media media : items) {
|
for (final Media media : items) {
|
||||||
if (media.isInjected() || media.getMediaType() == null) continue;
|
|
||||||
if (needNewMaxId && media.getEndOfFeedDemarcator() != null) {
|
if (needNewMaxId && media.getEndOfFeedDemarcator() != null) {
|
||||||
final EndOfFeedDemarcator endOfFeedDemarcator = media.getEndOfFeedDemarcator();
|
final EndOfFeedDemarcator endOfFeedDemarcator = media.getEndOfFeedDemarcator();
|
||||||
final EndOfFeedGroupSet groupSet = endOfFeedDemarcator.getGroupSet();
|
final EndOfFeedGroupSet groupSet = endOfFeedDemarcator.getGroupSet();
|
||||||
@ -129,6 +127,7 @@ public class FeedService extends BaseService {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (media.isInjected() || media.getMediaType() == null) continue;
|
||||||
allPosts.add(media);
|
allPosts.add(media);
|
||||||
}
|
}
|
||||||
return new PostsFetchResponse(allPosts, moreAvailable, nextMaxId);
|
return new PostsFetchResponse(allPosts, moreAvailable, nextMaxId);
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="0dp"
|
android:paddingStart="0dp"
|
||||||
android:paddingEnd="8dp"
|
android:paddingEnd="8dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/mute_mentions"
|
app:layout_constraintBottom_toTopOf="@id/mute_mentions"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/title_edit_input_layout" />
|
app:layout_constraintTop_toBottomOf="@id/title_edit_input_layout" />
|
||||||
@ -98,6 +99,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="0dp"
|
android:paddingStart="0dp"
|
||||||
android:paddingEnd="8dp"
|
android:paddingEnd="8dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/leave"
|
app:layout_constraintBottom_toTopOf="@id/leave"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/mute_messages" />
|
app:layout_constraintTop_toBottomOf="@id/mute_messages" />
|
||||||
|
Loading…
Reference in New Issue
Block a user