No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
98 changed files with 727 additions and 3210 deletions
-
2app/build.gradle
-
4app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectInboxItemViewHolder.java
-
9app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemActionLogViewHolder.java
-
6app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemVideoCallEventViewHolder.java
-
7app/src/main/java/awais/instagrabber/adapters/viewholder/directmessages/DirectItemXmaViewHolder.java
-
11app/src/main/java/awais/instagrabber/db/Converters.java
-
159app/src/main/java/awais/instagrabber/fragments/FavoritesFragment.java
-
102app/src/main/java/awais/instagrabber/fragments/FavoritesFragment.kt
-
7app/src/main/java/awais/instagrabber/managers/InboxManager.java
-
33app/src/main/java/awais/instagrabber/managers/ThreadManager.java
-
2app/src/main/java/awais/instagrabber/models/UploadVideoOptions.kt
-
114app/src/main/java/awais/instagrabber/repositories/requests/UploadFinishOptions.java
-
27app/src/main/java/awais/instagrabber/repositories/requests/UploadFinishOptions.kt
-
7app/src/main/java/awais/instagrabber/repositories/responses/Caption.kt
-
31app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectBadgeCount.java
-
8app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectBadgeCount.kt
-
62app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInbox.java
-
15app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInbox.kt
-
64app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInboxResponse.java
-
14app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInboxResponse.kt
-
92app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemActionLog.java
-
9app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemActionLog.kt
-
53app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemAnimatedMedia.java
-
11app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemAnimatedMedia.kt
-
31app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemClip.java
-
6app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemClip.kt
-
60app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemEmojiReaction.java
-
10app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemEmojiReaction.kt
-
31app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemFelixShare.java
-
6app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemFelixShare.kt
-
53app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemLink.java
-
10app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemLink.kt
-
53app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemLinkContext.java
-
10app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemLinkContext.kt
-
45app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemPlaceholder.java
-
9app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemPlaceholder.kt
-
62app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemReactions.java
-
13app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemReactions.kt
-
87app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemReelShare.java
-
15app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemReelShare.kt
-
36app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemReelShareReactionInfo.java
-
8app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemReelShareReactionInfo.kt
-
95app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemSeenResponse.java
-
7app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemSeenResponse.kt
-
3app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemSeenResponsePayload.kt
-
79app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemStoryShare.java
-
14app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemStoryShare.kt
-
62app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemVideoCallEvent.java
-
11app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemVideoCallEvent.kt
-
90app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemVisualMedia.java
-
16app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemVisualMedia.kt
-
45app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemVoiceMedia.java
-
10app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemVoiceMedia.kt
-
104app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemXma.java
-
15app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectItemXma.kt
-
372app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThread.java
-
49app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThread.kt
-
57app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadBroadcastResponse.java
-
9app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadBroadcastResponse.kt
-
55app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadBroadcastResponseMessageMetadata.java
-
9app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadBroadcastResponseMessageMetadata.kt
-
44app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadBroadcastResponsePayload.java
-
8app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadBroadcastResponsePayload.kt
-
19app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadDetailsChangeResponse.java
-
6app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadDetailsChangeResponse.kt
-
37app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadDirectStory.java
-
8app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadDirectStory.kt
-
19app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadFeedResponse.java
-
6app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadFeedResponse.kt
-
36app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadLastSeenAt.java
-
8app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadLastSeenAt.kt
-
70app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadParticipantRequestsResponse.java
-
16app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectThreadParticipantRequestsResponse.kt
-
46app/src/main/java/awais/instagrabber/repositories/responses/directmessages/RankedRecipient.java
-
21app/src/main/java/awais/instagrabber/repositories/responses/directmessages/RankedRecipient.kt
-
50app/src/main/java/awais/instagrabber/repositories/responses/directmessages/RankedRecipientsResponse.java
-
10app/src/main/java/awais/instagrabber/repositories/responses/directmessages/RankedRecipientsResponse.kt
-
69app/src/main/java/awais/instagrabber/repositories/responses/directmessages/RavenExpiringMediaActionSummary.java
-
43app/src/main/java/awais/instagrabber/repositories/responses/directmessages/RavenExpiringMediaActionSummary.kt
-
10app/src/main/java/awais/instagrabber/repositories/responses/directmessages/TextRange.kt
-
36app/src/main/java/awais/instagrabber/repositories/responses/directmessages/ThreadContext.java
-
8app/src/main/java/awais/instagrabber/repositories/responses/directmessages/ThreadContext.kt
-
2app/src/main/java/awais/instagrabber/repositories/serializers/CaptionDeserializer.java
-
2app/src/main/java/awais/instagrabber/services/DMSyncService.java
-
13app/src/main/java/awais/instagrabber/utils/BitmapUtils.java
-
3app/src/main/java/awais/instagrabber/utils/DMUtils.java
-
41app/src/main/java/awais/instagrabber/utils/MediaUploadHelper.kt
-
1app/src/main/java/awais/instagrabber/utils/MediaUploader.java
-
668app/src/main/java/awais/instagrabber/utils/ResponseBodyUtils.java
-
33app/src/main/java/awais/instagrabber/utils/TextUtils.kt
-
2app/src/main/java/awais/instagrabber/viewmodels/DirectSettingsViewModel.java
-
19app/src/main/java/awais/instagrabber/viewmodels/FavoritesViewModel.java
-
48app/src/main/java/awais/instagrabber/viewmodels/FavoritesViewModel.kt
-
2app/src/main/java/awais/instagrabber/viewmodels/PostViewV2ViewModel.java
-
4app/src/main/java/awais/instagrabber/webservices/DiscoverService.java
-
6app/src/main/java/awais/instagrabber/webservices/GraphQLService.java
-
12app/src/main/java/awais/instagrabber/webservices/MediaService.java
-
15app/src/main/java/awais/instagrabber/webservices/interceptors/IgErrorsInterceptor.java
@ -1,159 +0,0 @@ |
|||||
package awais.instagrabber.fragments; |
|
||||
|
|
||||
import android.content.Context; |
|
||||
import android.os.Bundle; |
|
||||
import android.util.Log; |
|
||||
import android.view.LayoutInflater; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
import androidx.annotation.Nullable; |
|
||||
import androidx.fragment.app.Fragment; |
|
||||
import androidx.lifecycle.ViewModelProvider; |
|
||||
import androidx.navigation.NavController; |
|
||||
import androidx.navigation.fragment.NavHostFragment; |
|
||||
import androidx.recyclerview.widget.LinearLayoutManager; |
|
||||
import androidx.recyclerview.widget.RecyclerView; |
|
||||
|
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
import awais.instagrabber.R; |
|
||||
import awais.instagrabber.adapters.FavoritesAdapter; |
|
||||
import awais.instagrabber.databinding.FragmentFavoritesBinding; |
|
||||
import awais.instagrabber.db.datasources.FavoriteDataSource; |
|
||||
import awais.instagrabber.db.entities.Favorite; |
|
||||
import awais.instagrabber.db.repositories.FavoriteRepository; |
|
||||
import awais.instagrabber.db.repositories.RepositoryCallback; |
|
||||
import awais.instagrabber.viewmodels.FavoritesViewModel; |
|
||||
|
|
||||
public class FavoritesFragment extends Fragment { |
|
||||
private static final String TAG = "FavoritesFragment"; |
|
||||
|
|
||||
private boolean shouldRefresh = true; |
|
||||
private FragmentFavoritesBinding binding; |
|
||||
private RecyclerView root; |
|
||||
private FavoritesViewModel favoritesViewModel; |
|
||||
private FavoritesAdapter adapter; |
|
||||
private FavoriteRepository favoriteRepository; |
|
||||
|
|
||||
@Override |
|
||||
public void onCreate(@Nullable final Bundle savedInstanceState) { |
|
||||
super.onCreate(savedInstanceState); |
|
||||
final Context context = getContext(); |
|
||||
if (context == null) return; |
|
||||
favoriteRepository = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(context)); |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public View onCreateView(@NonNull final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) { |
|
||||
if (root != null) { |
|
||||
shouldRefresh = false; |
|
||||
return root; |
|
||||
} |
|
||||
binding = FragmentFavoritesBinding.inflate(getLayoutInflater()); |
|
||||
root = binding.getRoot(); |
|
||||
binding.favoriteList.setLayoutManager(new LinearLayoutManager(getContext())); |
|
||||
return root; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) { |
|
||||
if (!shouldRefresh) return; |
|
||||
init(); |
|
||||
shouldRefresh = false; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onResume() { |
|
||||
super.onResume(); |
|
||||
if (favoritesViewModel == null || adapter == null) return; |
|
||||
// refresh list every time in onViewStateRestored since it is cheaper than implementing pull down to refresh |
|
||||
favoritesViewModel.getList().observe(getViewLifecycleOwner(), adapter::submitList); |
|
||||
favoriteRepository.getAllFavorites(new RepositoryCallback<List<Favorite>>() { |
|
||||
@Override |
|
||||
public void onSuccess(final List<Favorite> favorites) { |
|
||||
favoritesViewModel.getList().postValue(favorites); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDataNotAvailable() {} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
private void init() { |
|
||||
favoritesViewModel = new ViewModelProvider(this).get(FavoritesViewModel.class); |
|
||||
adapter = new FavoritesAdapter(model -> { |
|
||||
// navigate |
|
||||
switch (model.getType()) { |
|
||||
case USER: { |
|
||||
final String username = model.getQuery(); |
|
||||
// Log.d(TAG, "username: " + username); |
|
||||
final NavController navController = NavHostFragment.findNavController(this); |
|
||||
final Bundle bundle = new Bundle(); |
|
||||
bundle.putString("username", "@" + username); |
|
||||
navController.navigate(R.id.action_global_profileFragment, bundle); |
|
||||
break; |
|
||||
} |
|
||||
case LOCATION: { |
|
||||
final String locationId = model.getQuery(); |
|
||||
// Log.d(TAG, "locationId: " + locationId); |
|
||||
final NavController navController = NavHostFragment.findNavController(this); |
|
||||
final Bundle bundle = new Bundle(); |
|
||||
try { |
|
||||
bundle.putLong("locationId", Long.parseLong(locationId)); |
|
||||
navController.navigate(R.id.action_global_locationFragment, bundle); |
|
||||
} catch (Exception e) { |
|
||||
Log.e(TAG, "init: ", e); |
|
||||
return; |
|
||||
} |
|
||||
break; |
|
||||
} |
|
||||
case HASHTAG: { |
|
||||
final String hashtag = model.getQuery(); |
|
||||
// Log.d(TAG, "hashtag: " + hashtag); |
|
||||
final NavController navController = NavHostFragment.findNavController(this); |
|
||||
final Bundle bundle = new Bundle(); |
|
||||
bundle.putString("hashtag", "#" + hashtag); |
|
||||
navController.navigate(R.id.action_global_hashTagFragment, bundle); |
|
||||
break; |
|
||||
} |
|
||||
default: |
|
||||
// do nothing |
|
||||
} |
|
||||
}, model -> { |
|
||||
// delete |
|
||||
final Context context = getContext(); |
|
||||
if (context == null) return false; |
|
||||
new MaterialAlertDialogBuilder(context) |
|
||||
.setMessage(getString(R.string.quick_access_confirm_delete, model.getQuery())) |
|
||||
.setPositiveButton(R.string.yes, (d, which) -> favoriteRepository |
|
||||
.deleteFavorite(model.getQuery(), model.getType(), new RepositoryCallback<Void>() { |
|
||||
@Override |
|
||||
public void onSuccess(final Void result) { |
|
||||
d.dismiss(); |
|
||||
favoriteRepository.getAllFavorites(new RepositoryCallback<List<Favorite>>() { |
|
||||
@Override |
|
||||
public void onSuccess(final List<Favorite> result) { |
|
||||
favoritesViewModel.getList().postValue(result); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDataNotAvailable() {} |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public void onDataNotAvailable() {} |
|
||||
})) |
|
||||
.setNegativeButton(R.string.no, null) |
|
||||
.show(); |
|
||||
return true; |
|
||||
}); |
|
||||
binding.favoriteList.setAdapter(adapter); |
|
||||
|
|
||||
} |
|
||||
} |
|
@ -0,0 +1,102 @@ |
|||||
|
package awais.instagrabber.fragments |
||||
|
|
||||
|
import android.content.DialogInterface |
||||
|
import android.os.Bundle |
||||
|
import android.util.Log |
||||
|
import android.view.LayoutInflater |
||||
|
import android.view.View |
||||
|
import android.view.ViewGroup |
||||
|
import androidx.fragment.app.Fragment |
||||
|
import androidx.fragment.app.viewModels |
||||
|
import androidx.navigation.fragment.NavHostFragment |
||||
|
import androidx.recyclerview.widget.LinearLayoutManager |
||||
|
import androidx.recyclerview.widget.RecyclerView |
||||
|
import awais.instagrabber.R |
||||
|
import awais.instagrabber.adapters.FavoritesAdapter |
||||
|
import awais.instagrabber.databinding.FragmentFavoritesBinding |
||||
|
import awais.instagrabber.db.entities.Favorite |
||||
|
import awais.instagrabber.models.enums.FavoriteType |
||||
|
import awais.instagrabber.utils.extensions.TAG |
||||
|
import awais.instagrabber.viewmodels.FavoritesViewModel |
||||
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder |
||||
|
|
||||
|
class FavoritesFragment : Fragment() { |
||||
|
private var shouldRefresh = true |
||||
|
|
||||
|
private lateinit var binding: FragmentFavoritesBinding |
||||
|
private lateinit var root: RecyclerView |
||||
|
private lateinit var adapter: FavoritesAdapter |
||||
|
|
||||
|
private val favoritesViewModel: FavoritesViewModel by viewModels() |
||||
|
|
||||
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { |
||||
|
if (this::root.isInitialized) { |
||||
|
shouldRefresh = false |
||||
|
return root |
||||
|
} |
||||
|
binding = FragmentFavoritesBinding.inflate(layoutInflater) |
||||
|
root = binding.root |
||||
|
binding.favoriteList.layoutManager = LinearLayoutManager(context) |
||||
|
return root |
||||
|
} |
||||
|
|
||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||
|
if (!shouldRefresh) return |
||||
|
init() |
||||
|
shouldRefresh = false |
||||
|
} |
||||
|
|
||||
|
override fun onResume() { |
||||
|
super.onResume() |
||||
|
if (!this::adapter.isInitialized) return |
||||
|
// refresh list every time in onViewStateRestored since it is cheaper than implementing pull down to refresh |
||||
|
favoritesViewModel.list.observe(viewLifecycleOwner, { list: List<Favorite?>? -> adapter.submitList(list) }) |
||||
|
} |
||||
|
|
||||
|
private fun init() { |
||||
|
adapter = FavoritesAdapter({ model: Favorite -> |
||||
|
when (model.type) { |
||||
|
FavoriteType.USER -> { |
||||
|
val username = model.query |
||||
|
// Log.d(TAG, "username: " + username); |
||||
|
val navController = NavHostFragment.findNavController(this) |
||||
|
val bundle = Bundle() |
||||
|
bundle.putString("username", "@$username") |
||||
|
navController.navigate(R.id.action_global_profileFragment, bundle) |
||||
|
} |
||||
|
FavoriteType.LOCATION -> { |
||||
|
val locationId = model.query |
||||
|
// Log.d(TAG, "locationId: " + locationId); |
||||
|
val navController = NavHostFragment.findNavController(this) |
||||
|
val bundle = Bundle() |
||||
|
try { |
||||
|
bundle.putLong("locationId", locationId.toLong()) |
||||
|
navController.navigate(R.id.action_global_locationFragment, bundle) |
||||
|
} catch (e: Exception) { |
||||
|
Log.e(TAG, "init: ", e) |
||||
|
} |
||||
|
} |
||||
|
FavoriteType.HASHTAG -> { |
||||
|
val hashtag = model.query |
||||
|
// Log.d(TAG, "hashtag: " + hashtag); |
||||
|
val navController = NavHostFragment.findNavController(this) |
||||
|
val bundle = Bundle() |
||||
|
bundle.putString("hashtag", "#$hashtag") |
||||
|
navController.navigate(R.id.action_global_hashTagFragment, bundle) |
||||
|
} |
||||
|
else -> { |
||||
|
} |
||||
|
} |
||||
|
}, { model: Favorite -> |
||||
|
// delete |
||||
|
val context = context ?: return@FavoritesAdapter false |
||||
|
MaterialAlertDialogBuilder(context) |
||||
|
.setMessage(getString(R.string.quick_access_confirm_delete, model.query)) |
||||
|
.setPositiveButton(R.string.yes) { d: DialogInterface, _: Int -> favoritesViewModel.delete(model) { d.dismiss() } } |
||||
|
.setNegativeButton(R.string.no, null) |
||||
|
.show() |
||||
|
true |
||||
|
}) |
||||
|
binding.favoriteList.adapter = adapter |
||||
|
} |
||||
|
} |
@ -1,114 +0,0 @@ |
|||||
package awais.instagrabber.repositories.requests; |
|
||||
|
|
||||
import com.google.common.collect.ImmutableMap; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
public class UploadFinishOptions { |
|
||||
private String uploadId; |
|
||||
private String sourceType; |
|
||||
private VideoOptions videoOptions; |
|
||||
|
|
||||
public String getUploadId() { |
|
||||
return uploadId; |
|
||||
} |
|
||||
|
|
||||
public UploadFinishOptions setUploadId(final String uploadId) { |
|
||||
this.uploadId = uploadId; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public String getSourceType() { |
|
||||
return sourceType; |
|
||||
} |
|
||||
|
|
||||
public UploadFinishOptions setSourceType(final String sourceType) { |
|
||||
this.sourceType = sourceType; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions getVideoOptions() { |
|
||||
return videoOptions; |
|
||||
} |
|
||||
|
|
||||
public UploadFinishOptions setVideoOptions(final VideoOptions videoOptions) { |
|
||||
this.videoOptions = videoOptions; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public static class VideoOptions { |
|
||||
private float length; |
|
||||
private List<Clip> clips; |
|
||||
private int posterFrameIndex; |
|
||||
private boolean audioMuted; |
|
||||
|
|
||||
public float getLength() { |
|
||||
return length; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setLength(final float length) { |
|
||||
this.length = length; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public List<Clip> getClips() { |
|
||||
return clips; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setClips(final List<Clip> clips) { |
|
||||
this.clips = clips; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public int getPosterFrameIndex() { |
|
||||
return posterFrameIndex; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setPosterFrameIndex(final int posterFrameIndex) { |
|
||||
this.posterFrameIndex = posterFrameIndex; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public boolean isAudioMuted() { |
|
||||
return audioMuted; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setAudioMuted(final boolean audioMuted) { |
|
||||
this.audioMuted = audioMuted; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public Map<String, Object> getMap() { |
|
||||
return ImmutableMap.of( |
|
||||
"length", length, |
|
||||
"clips", clips, |
|
||||
"poster_frame_index", posterFrameIndex, |
|
||||
"audio_muted", audioMuted |
|
||||
); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public static class Clip { |
|
||||
private float length; |
|
||||
private String sourceType; |
|
||||
|
|
||||
public float getLength() { |
|
||||
return length; |
|
||||
} |
|
||||
|
|
||||
public Clip setLength(final float length) { |
|
||||
this.length = length; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public String getSourceType() { |
|
||||
return sourceType; |
|
||||
} |
|
||||
|
|
||||
public Clip setSourceType(final String sourceType) { |
|
||||
this.sourceType = sourceType; |
|
||||
return this; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,27 @@ |
|||||
|
package awais.instagrabber.repositories.requests |
||||
|
|
||||
|
data class UploadFinishOptions( |
||||
|
val uploadId: String, |
||||
|
val sourceType: String, |
||||
|
val videoOptions: VideoOptions? = null |
||||
|
) |
||||
|
|
||||
|
data class VideoOptions( |
||||
|
val length: Float = 0f, |
||||
|
var clips: List<Clip> = emptyList(), |
||||
|
val posterFrameIndex: Int = 0, |
||||
|
val isAudioMuted: Boolean = false |
||||
|
) { |
||||
|
val map: Map<String, Any> |
||||
|
get() = mapOf( |
||||
|
"length" to length, |
||||
|
"clips" to clips, |
||||
|
"poster_frame_index" to posterFrameIndex, |
||||
|
"audio_muted" to isAudioMuted |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
data class Clip( |
||||
|
val length: Float = 0f, |
||||
|
val sourceType: String |
||||
|
) |
@ -1,31 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
public class DirectBadgeCount { |
|
||||
private final long userId; |
|
||||
private final int badgeCount; |
|
||||
private final long badgeCountAtMs; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectBadgeCount(final long userId, final int badgeCount, final long badgeCountAtMs, final String status) { |
|
||||
this.userId = userId; |
|
||||
this.badgeCount = badgeCount; |
|
||||
this.badgeCountAtMs = badgeCountAtMs; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public long getUserId() { |
|
||||
return userId; |
|
||||
} |
|
||||
|
|
||||
public int getBadgeCount() { |
|
||||
return badgeCount; |
|
||||
} |
|
||||
|
|
||||
public long getBadgeCountAtMs() { |
|
||||
return badgeCountAtMs; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,8 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectBadgeCount( |
||||
|
val userId: Long = 0, |
||||
|
val badgeCount: Int = 0, |
||||
|
val badgeCountAtMs: Long = 0, |
||||
|
val status: String? = null |
||||
|
) |
@ -1,62 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
public class DirectInbox implements Cloneable { |
|
||||
private List<DirectThread> threads; |
|
||||
private final boolean hasOlder; |
|
||||
private final int unseenCount; |
|
||||
private final String unseenCountTs; |
|
||||
private final String oldestCursor; |
|
||||
private final boolean blendedInboxEnabled; |
|
||||
|
|
||||
public DirectInbox(final List<DirectThread> threads, |
|
||||
final boolean hasOlder, |
|
||||
final int unseenCount, |
|
||||
final String unseenCountTs, |
|
||||
final String oldestCursor, |
|
||||
final boolean blendedInboxEnabled) { |
|
||||
this.threads = threads; |
|
||||
this.hasOlder = hasOlder; |
|
||||
this.unseenCount = unseenCount; |
|
||||
this.unseenCountTs = unseenCountTs; |
|
||||
this.oldestCursor = oldestCursor; |
|
||||
this.blendedInboxEnabled = blendedInboxEnabled; |
|
||||
} |
|
||||
|
|
||||
public List<DirectThread> getThreads() { |
|
||||
return threads; |
|
||||
} |
|
||||
|
|
||||
public void setThreads(final List<DirectThread> threads) { |
|
||||
this.threads = threads; |
|
||||
} |
|
||||
|
|
||||
public boolean hasOlder() { |
|
||||
return hasOlder; |
|
||||
} |
|
||||
|
|
||||
public int getUnseenCount() { |
|
||||
return unseenCount; |
|
||||
} |
|
||||
|
|
||||
public String getUnseenCountTs() { |
|
||||
return unseenCountTs; |
|
||||
} |
|
||||
|
|
||||
public String getOldestCursor() { |
|
||||
return oldestCursor; |
|
||||
} |
|
||||
|
|
||||
public boolean isBlendedInboxEnabled() { |
|
||||
return blendedInboxEnabled; |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public Object clone() throws CloneNotSupportedException { |
|
||||
return super.clone(); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,15 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectInbox( |
||||
|
var threads: List<DirectThread>? = emptyList(), |
||||
|
val hasOlder: Boolean = false, |
||||
|
val unseenCount: Int = 0, |
||||
|
val unseenCountTs: String? = null, |
||||
|
val oldestCursor: String? = null, |
||||
|
val blendedInboxEnabled: Boolean |
||||
|
) : Cloneable { |
||||
|
@Throws(CloneNotSupportedException::class) |
||||
|
public override fun clone(): Any { |
||||
|
return super.clone() |
||||
|
} |
||||
|
} |
@ -1,64 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.User; |
|
||||
|
|
||||
public class DirectInboxResponse { |
|
||||
private final User viewer; |
|
||||
private final DirectInbox inbox; |
|
||||
private final long seqId; |
|
||||
private final long snapshotAtMs; |
|
||||
private final int pendingRequestsTotal; |
|
||||
private final boolean hasPendingTopRequests; |
|
||||
private final User mostRecentInviter; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectInboxResponse(final User viewer, |
|
||||
final DirectInbox inbox, |
|
||||
final long seqId, |
|
||||
final long snapshotAtMs, |
|
||||
final int pendingRequestsTotal, |
|
||||
final boolean hasPendingTopRequests, |
|
||||
final User mostRecentInviter, |
|
||||
final String status) { |
|
||||
this.viewer = viewer; |
|
||||
this.inbox = inbox; |
|
||||
this.seqId = seqId; |
|
||||
this.snapshotAtMs = snapshotAtMs; |
|
||||
this.pendingRequestsTotal = pendingRequestsTotal; |
|
||||
this.hasPendingTopRequests = hasPendingTopRequests; |
|
||||
this.mostRecentInviter = mostRecentInviter; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public User getViewer() { |
|
||||
return viewer; |
|
||||
} |
|
||||
|
|
||||
public DirectInbox getInbox() { |
|
||||
return inbox; |
|
||||
} |
|
||||
|
|
||||
public long getSeqId() { |
|
||||
return seqId; |
|
||||
} |
|
||||
|
|
||||
public long getSnapshotAtMs() { |
|
||||
return snapshotAtMs; |
|
||||
} |
|
||||
|
|
||||
public int getPendingRequestsTotal() { |
|
||||
return pendingRequestsTotal; |
|
||||
} |
|
||||
|
|
||||
public boolean hasPendingTopRequests() { |
|
||||
return hasPendingTopRequests; |
|
||||
} |
|
||||
|
|
||||
public User getMostRecentInviter() { |
|
||||
return mostRecentInviter; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,14 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.User |
||||
|
|
||||
|
data class DirectInboxResponse( |
||||
|
val viewer: User? = null, |
||||
|
val inbox: DirectInbox? = null, |
||||
|
val seqId: Long = 0, |
||||
|
val snapshotAtMs: Long = 0, |
||||
|
val pendingRequestsTotal: Int = 0, |
||||
|
val hasPendingTopRequests: Boolean = false, |
||||
|
val mostRecentInviter: User? = null, |
||||
|
val status: String? = null, |
||||
|
) |
@ -1,92 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemActionLog implements Serializable { |
|
||||
private final String description; |
|
||||
private final List<TextRange> bold; |
|
||||
private final List<TextRange> textAttributes; |
|
||||
|
|
||||
public DirectItemActionLog(final String description, |
|
||||
final List<TextRange> bold, |
|
||||
final List<TextRange> textAttributes) { |
|
||||
this.description = description; |
|
||||
this.bold = bold; |
|
||||
this.textAttributes = textAttributes; |
|
||||
} |
|
||||
|
|
||||
public String getDescription() { |
|
||||
return description; |
|
||||
} |
|
||||
|
|
||||
public List<TextRange> getBold() { |
|
||||
return bold; |
|
||||
} |
|
||||
|
|
||||
public List<TextRange> getTextAttributes() { |
|
||||
return textAttributes; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemActionLog that = (DirectItemActionLog) o; |
|
||||
return Objects.equals(description, that.description) && |
|
||||
Objects.equals(bold, that.bold) && |
|
||||
Objects.equals(textAttributes, that.textAttributes); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(description, bold, textAttributes); |
|
||||
} |
|
||||
|
|
||||
public static class TextRange implements Serializable { |
|
||||
private final int start; |
|
||||
private final int end; |
|
||||
private final String color; |
|
||||
private final String intent; |
|
||||
|
|
||||
public TextRange(final int start, final int end, final String color, final String intent) { |
|
||||
this.start = start; |
|
||||
this.end = end; |
|
||||
this.color = color; |
|
||||
this.intent = intent; |
|
||||
} |
|
||||
|
|
||||
public int getStart() { |
|
||||
return start; |
|
||||
} |
|
||||
|
|
||||
public int getEnd() { |
|
||||
return end; |
|
||||
} |
|
||||
|
|
||||
public String getColor() { |
|
||||
return color; |
|
||||
} |
|
||||
|
|
||||
public String getIntent() { |
|
||||
return intent; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final TextRange textRange = (TextRange) o; |
|
||||
return start == textRange.start && |
|
||||
end == textRange.end && |
|
||||
Objects.equals(color, textRange.color) && |
|
||||
Objects.equals(intent, textRange.intent); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(start, end, color, intent); |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,9 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemActionLog( |
||||
|
val description: String? = null, |
||||
|
val bold: List<TextRange>? = null, |
||||
|
val textAttributes: List<TextRange>? = null |
||||
|
) : Serializable |
@ -1,53 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.AnimatedMediaImages; |
|
||||
|
|
||||
public final class DirectItemAnimatedMedia implements Serializable { |
|
||||
private final String id; |
|
||||
private final AnimatedMediaImages images; |
|
||||
private final boolean isRandom; |
|
||||
private final boolean isSticker; |
|
||||
|
|
||||
public DirectItemAnimatedMedia(final String id, final AnimatedMediaImages images, final boolean isRandom, final boolean isSticker) { |
|
||||
|
|
||||
this.id = id; |
|
||||
this.images = images; |
|
||||
this.isRandom = isRandom; |
|
||||
this.isSticker = isSticker; |
|
||||
} |
|
||||
|
|
||||
public String getId() { |
|
||||
return id; |
|
||||
} |
|
||||
|
|
||||
public AnimatedMediaImages getImages() { |
|
||||
return images; |
|
||||
} |
|
||||
|
|
||||
public boolean isRandom() { |
|
||||
return isRandom; |
|
||||
} |
|
||||
|
|
||||
public boolean isSticker() { |
|
||||
return isSticker; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemAnimatedMedia that = (DirectItemAnimatedMedia) o; |
|
||||
return isRandom == that.isRandom && |
|
||||
isSticker == that.isSticker && |
|
||||
Objects.equals(id, that.id) && |
|
||||
Objects.equals(images, that.images); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(id, images, isRandom, isSticker); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,11 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.AnimatedMediaImages |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemAnimatedMedia( |
||||
|
val id: String? = null, |
||||
|
val images: AnimatedMediaImages? = null, |
||||
|
val isRandom: Boolean = false, |
||||
|
val isSticker: Boolean = false, |
||||
|
) : Serializable |
@ -1,31 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.Media; |
|
||||
|
|
||||
public class DirectItemClip implements Serializable { |
|
||||
private final Media clip; |
|
||||
|
|
||||
public DirectItemClip(final Media clip) { |
|
||||
this.clip = clip; |
|
||||
} |
|
||||
|
|
||||
public Media getClip() { |
|
||||
return clip; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemClip that = (DirectItemClip) o; |
|
||||
return Objects.equals(clip, that.clip); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(clip); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,6 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.Media |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemClip(val clip: Media? = null) : Serializable |
@ -1,60 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemEmojiReaction implements Serializable { |
|
||||
private final long senderId; |
|
||||
private final long timestamp; |
|
||||
private final String emoji; |
|
||||
private final String superReactType; |
|
||||
|
|
||||
public DirectItemEmojiReaction(final long senderId, final long timestamp, final String emoji, final String superReactType) { |
|
||||
this.senderId = senderId; |
|
||||
this.timestamp = timestamp; |
|
||||
this.emoji = emoji; |
|
||||
this.superReactType = superReactType; |
|
||||
} |
|
||||
|
|
||||
public long getSenderId() { |
|
||||
return senderId; |
|
||||
} |
|
||||
|
|
||||
public long getTimestamp() { |
|
||||
return timestamp; |
|
||||
} |
|
||||
|
|
||||
public String getEmoji() { |
|
||||
return emoji; |
|
||||
} |
|
||||
|
|
||||
public String getSuperReactType() { |
|
||||
return superReactType; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemEmojiReaction that = (DirectItemEmojiReaction) o; |
|
||||
return senderId == that.senderId && |
|
||||
timestamp == that.timestamp && |
|
||||
Objects.equals(emoji, that.emoji) && |
|
||||
Objects.equals(superReactType, that.superReactType); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(senderId, timestamp, emoji, superReactType); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectItemEmojiReaction{" + |
|
||||
"senderId=" + senderId + |
|
||||
", timestamp=" + timestamp + |
|
||||
", emoji='" + emoji + '\'' + |
|
||||
", superReactType='" + superReactType + '\'' + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,10 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemEmojiReaction( |
||||
|
val senderId: Long = 0, |
||||
|
val timestamp: Long = 0, |
||||
|
val emoji: String? = null, |
||||
|
val superReactType: String? = null |
||||
|
) : Serializable |
@ -1,31 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.Media; |
|
||||
|
|
||||
public class DirectItemFelixShare implements Serializable { |
|
||||
private final Media video; |
|
||||
|
|
||||
public DirectItemFelixShare(final Media video) { |
|
||||
this.video = video; |
|
||||
} |
|
||||
|
|
||||
public Media getVideo() { |
|
||||
return video; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemFelixShare that = (DirectItemFelixShare) o; |
|
||||
return Objects.equals(video, that.video); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(video); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,6 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.Media |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemFelixShare(val video: Media? = null) : Serializable |
@ -1,53 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemLink implements Serializable { |
|
||||
private final String text; |
|
||||
private final DirectItemLinkContext linkContext; |
|
||||
private final String clientContext; |
|
||||
private final String mutationToken; |
|
||||
|
|
||||
public DirectItemLink(final String text, |
|
||||
final DirectItemLinkContext linkContext, |
|
||||
final String clientContext, |
|
||||
final String mutationToken) { |
|
||||
this.text = text; |
|
||||
this.linkContext = linkContext; |
|
||||
this.clientContext = clientContext; |
|
||||
this.mutationToken = mutationToken; |
|
||||
} |
|
||||
|
|
||||
public String getText() { |
|
||||
return text; |
|
||||
} |
|
||||
|
|
||||
public DirectItemLinkContext getLinkContext() { |
|
||||
return linkContext; |
|
||||
} |
|
||||
|
|
||||
public String getClientContext() { |
|
||||
return clientContext; |
|
||||
} |
|
||||
|
|
||||
public String getMutationToken() { |
|
||||
return mutationToken; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemLink that = (DirectItemLink) o; |
|
||||
return Objects.equals(text, that.text) && |
|
||||
Objects.equals(linkContext, that.linkContext) && |
|
||||
Objects.equals(clientContext, that.clientContext) && |
|
||||
Objects.equals(mutationToken, that.mutationToken); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(text, linkContext, clientContext, mutationToken); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,10 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemLink( |
||||
|
val text: String? = null, |
||||
|
val linkContext: DirectItemLinkContext? = null, |
||||
|
val clientContext: String? = null, |
||||
|
val mutationToken: String? = null, |
||||
|
) : Serializable |
@ -1,53 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemLinkContext implements Serializable { |
|
||||
private final String linkUrl; |
|
||||
private final String linkTitle; |
|
||||
private final String linkSummary; |
|
||||
private final String linkImageUrl; |
|
||||
|
|
||||
public DirectItemLinkContext(final String linkUrl, |
|
||||
final String linkTitle, |
|
||||
final String linkSummary, |
|
||||
final String linkImageUrl) { |
|
||||
this.linkUrl = linkUrl; |
|
||||
this.linkTitle = linkTitle; |
|
||||
this.linkSummary = linkSummary; |
|
||||
this.linkImageUrl = linkImageUrl; |
|
||||
} |
|
||||
|
|
||||
public String getLinkUrl() { |
|
||||
return linkUrl; |
|
||||
} |
|
||||
|
|
||||
public String getLinkTitle() { |
|
||||
return linkTitle; |
|
||||
} |
|
||||
|
|
||||
public String getLinkSummary() { |
|
||||
return linkSummary; |
|
||||
} |
|
||||
|
|
||||
public String getLinkImageUrl() { |
|
||||
return linkImageUrl; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemLinkContext that = (DirectItemLinkContext) o; |
|
||||
return Objects.equals(linkUrl, that.linkUrl) && |
|
||||
Objects.equals(linkTitle, that.linkTitle) && |
|
||||
Objects.equals(linkSummary, that.linkSummary) && |
|
||||
Objects.equals(linkImageUrl, that.linkImageUrl); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(linkUrl, linkTitle, linkSummary, linkImageUrl); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,10 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemLinkContext( |
||||
|
val linkUrl: String? = null, |
||||
|
val linkTitle: String? = null, |
||||
|
val linkSummary: String? = null, |
||||
|
val linkImageUrl: String? = null |
||||
|
) : Serializable |
@ -1,45 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemPlaceholder implements Serializable { |
|
||||
private final boolean isLinked; |
|
||||
private final String title; |
|
||||
private final String message; |
|
||||
|
|
||||
public DirectItemPlaceholder(final boolean isLinked, |
|
||||
final String title, |
|
||||
final String message) { |
|
||||
this.isLinked = isLinked; |
|
||||
this.title = title; |
|
||||
this.message = message; |
|
||||
} |
|
||||
|
|
||||
public boolean isLinked() { |
|
||||
return isLinked; |
|
||||
} |
|
||||
|
|
||||
public String getTitle() { |
|
||||
return title; |
|
||||
} |
|
||||
|
|
||||
public String getMessage() { |
|
||||
return message; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemPlaceholder that = (DirectItemPlaceholder) o; |
|
||||
return isLinked == that.isLinked && |
|
||||
Objects.equals(title, that.title) && |
|
||||
Objects.equals(message, that.message); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(isLinked, title, message); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,9 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemPlaceholder( |
||||
|
val isLinked: Boolean = false, |
||||
|
val title: String? = null, |
||||
|
val message: String? = null, |
||||
|
) : Serializable |
@ -1,62 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemReactions implements Cloneable, Serializable { |
|
||||
private List<DirectItemEmojiReaction> emojis; |
|
||||
private List<DirectItemEmojiReaction> likes; |
|
||||
|
|
||||
public DirectItemReactions(final List<DirectItemEmojiReaction> emojis, |
|
||||
final List<DirectItemEmojiReaction> likes) { |
|
||||
this.emojis = emojis; |
|
||||
this.likes = likes; |
|
||||
} |
|
||||
|
|
||||
public List<DirectItemEmojiReaction> getEmojis() { |
|
||||
return emojis; |
|
||||
} |
|
||||
|
|
||||
public List<DirectItemEmojiReaction> getLikes() { |
|
||||
return likes; |
|
||||
} |
|
||||
|
|
||||
public void setLikes(final List<DirectItemEmojiReaction> likes) { |
|
||||
this.likes = likes; |
|
||||
} |
|
||||
|
|
||||
public void setEmojis(final List<DirectItemEmojiReaction> emojis) { |
|
||||
this.emojis = emojis; |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public Object clone() throws CloneNotSupportedException { |
|
||||
return super.clone(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemReactions that = (DirectItemReactions) o; |
|
||||
return Objects.equals(emojis, that.emojis) && |
|
||||
Objects.equals(likes, that.likes); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(emojis, likes); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectItemReactions{" + |
|
||||
"emojis=" + emojis + |
|
||||
", likes=" + likes + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,13 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemReactions( |
||||
|
var emojis: List<DirectItemEmojiReaction>? = null, |
||||
|
var likes: List<DirectItemEmojiReaction>? = null, |
||||
|
) : Cloneable, Serializable { |
||||
|
@Throws(CloneNotSupportedException::class) |
||||
|
public override fun clone(): Any { |
||||
|
return super.clone() |
||||
|
} |
||||
|
} |
@ -1,87 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.Media; |
|
||||
|
|
||||
public class DirectItemReelShare implements Serializable { |
|
||||
private final String text; |
|
||||
private final String type; |
|
||||
private final long reelOwnerId; |
|
||||
private final long mentionedUserId; |
|
||||
private final boolean isReelPersisted; |
|
||||
private final String reelType; |
|
||||
private final Media media; |
|
||||
private final DirectItemReelShareReactionInfo reactionInfo; |
|
||||
|
|
||||
public DirectItemReelShare(final String text, |
|
||||
final String type, |
|
||||
final long reelOwnerId, |
|
||||
final long mentionedUserId, |
|
||||
final boolean isReelPersisted, |
|
||||
final String reelType, |
|
||||
final Media media, |
|
||||
final DirectItemReelShareReactionInfo reactionInfo) { |
|
||||
this.text = text; |
|
||||
this.type = type; |
|
||||
this.reelOwnerId = reelOwnerId; |
|
||||
this.mentionedUserId = mentionedUserId; |
|
||||
this.isReelPersisted = isReelPersisted; |
|
||||
this.reelType = reelType; |
|
||||
this.media = media; |
|
||||
this.reactionInfo = reactionInfo; |
|
||||
} |
|
||||
|
|
||||
public String getText() { |
|
||||
return text; |
|
||||
} |
|
||||
|
|
||||
public String getType() { |
|
||||
return type; |
|
||||
} |
|
||||
|
|
||||
public long getReelOwnerId() { |
|
||||
return reelOwnerId; |
|
||||
} |
|
||||
|
|
||||
public boolean isReelPersisted() { |
|
||||
return isReelPersisted; |
|
||||
} |
|
||||
|
|
||||
public String getReelType() { |
|
||||
return reelType; |
|
||||
} |
|
||||
|
|
||||
public Media getMedia() { |
|
||||
return media; |
|
||||
} |
|
||||
|
|
||||
public DirectItemReelShareReactionInfo getReactionInfo() { |
|
||||
return reactionInfo; |
|
||||
} |
|
||||
|
|
||||
public long getMentionedUserId() { |
|
||||
return mentionedUserId; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemReelShare that = (DirectItemReelShare) o; |
|
||||
return reelOwnerId == that.reelOwnerId && |
|
||||
mentionedUserId == that.mentionedUserId && |
|
||||
isReelPersisted == that.isReelPersisted && |
|
||||
Objects.equals(text, that.text) && |
|
||||
Objects.equals(type, that.type) && |
|
||||
Objects.equals(reelType, that.reelType) && |
|
||||
Objects.equals(media, that.media) && |
|
||||
Objects.equals(reactionInfo, that.reactionInfo); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(text, type, reelOwnerId, mentionedUserId, isReelPersisted, reelType, media, reactionInfo); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,15 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.Media |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemReelShare( |
||||
|
val text: String? = null, |
||||
|
val type: String? = null, |
||||
|
val reelOwnerId: Long = 0, |
||||
|
val mentionedUserId: Long = 0, |
||||
|
val isReelPersisted: Boolean = false, |
||||
|
val reelType: String? = null, |
||||
|
val media: Media? = null, |
||||
|
val reactionInfo: DirectItemReelShareReactionInfo? = null, |
||||
|
) : Serializable |
@ -1,36 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemReelShareReactionInfo implements Serializable { |
|
||||
private final String emoji; |
|
||||
private final String intensity; |
|
||||
|
|
||||
public DirectItemReelShareReactionInfo(final String emoji, final String intensity) { |
|
||||
this.emoji = emoji; |
|
||||
this.intensity = intensity; |
|
||||
} |
|
||||
|
|
||||
public String getEmoji() { |
|
||||
return emoji; |
|
||||
} |
|
||||
|
|
||||
public String getIntensity() { |
|
||||
return intensity; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemReelShareReactionInfo that = (DirectItemReelShareReactionInfo) o; |
|
||||
return Objects.equals(emoji, that.emoji) && |
|
||||
Objects.equals(intensity, that.intensity); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(emoji, intensity); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,8 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemReelShareReactionInfo( |
||||
|
val emoji: String? = null, |
||||
|
val intensity: String? = null, |
||||
|
) : Serializable |
@ -1,95 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
|
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemSeenResponse { |
|
||||
private final String action; |
|
||||
private final DirectItemSeenResponsePayload payload; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectItemSeenResponse(final String action, final DirectItemSeenResponsePayload payload, final String status) { |
|
||||
this.action = action; |
|
||||
this.payload = payload; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public String getAction() { |
|
||||
return action; |
|
||||
} |
|
||||
|
|
||||
public DirectItemSeenResponsePayload getPayload() { |
|
||||
return payload; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemSeenResponse that = (DirectItemSeenResponse) o; |
|
||||
return Objects.equals(action, that.action) && |
|
||||
Objects.equals(payload, that.payload) && |
|
||||
Objects.equals(status, that.status); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(action, payload, status); |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectItemSeenResponse{" + |
|
||||
"action='" + action + '\'' + |
|
||||
", payload=" + payload + |
|
||||
", status='" + status + '\'' + |
|
||||
'}'; |
|
||||
} |
|
||||
|
|
||||
public static class DirectItemSeenResponsePayload { |
|
||||
private final int count; |
|
||||
private final String timestamp; |
|
||||
|
|
||||
public DirectItemSeenResponsePayload(final int count, final String timestamp) { |
|
||||
this.count = count; |
|
||||
this.timestamp = timestamp; |
|
||||
} |
|
||||
|
|
||||
public int getCount() { |
|
||||
return count; |
|
||||
} |
|
||||
|
|
||||
public String getTimestamp() { |
|
||||
return timestamp; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemSeenResponsePayload that = (DirectItemSeenResponsePayload) o; |
|
||||
return count == that.count && |
|
||||
Objects.equals(timestamp, that.timestamp); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(count, timestamp); |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectItemSeenResponsePayload{" + |
|
||||
"count=" + count + |
|
||||
", timestamp='" + timestamp + '\'' + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,7 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectItemSeenResponse( |
||||
|
val action: String? = null, |
||||
|
val payload: DirectItemSeenResponsePayload? = null, |
||||
|
val status: String? = null, |
||||
|
) |
@ -0,0 +1,3 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectItemSeenResponsePayload(val count: Int = 0, val timestamp: String? = null) |
@ -1,79 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.Media; |
|
||||
|
|
||||
public class DirectItemStoryShare implements Serializable { |
|
||||
private final String reelId; |
|
||||
private final String reelType; |
|
||||
private final String text; |
|
||||
private final boolean isReelPersisted; |
|
||||
private final Media media; |
|
||||
private final String title; |
|
||||
private final String message; |
|
||||
|
|
||||
public DirectItemStoryShare(final String reelId, |
|
||||
final String reelType, |
|
||||
final String text, |
|
||||
final boolean isReelPersisted, |
|
||||
final Media media, |
|
||||
final String title, |
|
||||
final String message) { |
|
||||
this.reelId = reelId; |
|
||||
this.reelType = reelType; |
|
||||
this.text = text; |
|
||||
this.isReelPersisted = isReelPersisted; |
|
||||
this.media = media; |
|
||||
this.title = title; |
|
||||
this.message = message; |
|
||||
} |
|
||||
|
|
||||
public String getReelId() { |
|
||||
return reelId; |
|
||||
} |
|
||||
|
|
||||
public String getReelType() { |
|
||||
return reelType; |
|
||||
} |
|
||||
|
|
||||
public String getText() { |
|
||||
return text; |
|
||||
} |
|
||||
|
|
||||
public boolean isReelPersisted() { |
|
||||
return isReelPersisted; |
|
||||
} |
|
||||
|
|
||||
public Media getMedia() { |
|
||||
return media; |
|
||||
} |
|
||||
|
|
||||
public String getTitle() { |
|
||||
return title; |
|
||||
} |
|
||||
|
|
||||
public String getMessage() { |
|
||||
return message; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemStoryShare that = (DirectItemStoryShare) o; |
|
||||
return isReelPersisted == that.isReelPersisted && |
|
||||
Objects.equals(reelId, that.reelId) && |
|
||||
Objects.equals(reelType, that.reelType) && |
|
||||
Objects.equals(text, that.text) && |
|
||||
Objects.equals(media, that.media) && |
|
||||
Objects.equals(title, that.title) && |
|
||||
Objects.equals(message, that.message); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(reelId, reelType, text, isReelPersisted, media, title, message); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,14 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.Media |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemStoryShare( |
||||
|
val reelId: String? = null, |
||||
|
val reelType: String? = null, |
||||
|
val text: String? = null, |
||||
|
val isReelPersisted: Boolean = false, |
||||
|
val media: Media? = null, |
||||
|
val title: String? = null, |
||||
|
val message: String? = null, |
||||
|
) : Serializable |
@ -1,62 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public final class DirectItemVideoCallEvent implements Serializable { |
|
||||
private final String action; |
|
||||
private final String encodedServerDataInfo; |
|
||||
private final String description; |
|
||||
private final boolean threadHasAudioOnlyCall; |
|
||||
private final List<DirectItemActionLog.TextRange> textAttributes; |
|
||||
|
|
||||
public DirectItemVideoCallEvent(final String action, |
|
||||
final String encodedServerDataInfo, |
|
||||
final String description, |
|
||||
final boolean threadHasAudioOnlyCall, |
|
||||
final List<DirectItemActionLog.TextRange> textAttributes) { |
|
||||
this.action = action; |
|
||||
this.encodedServerDataInfo = encodedServerDataInfo; |
|
||||
this.description = description; |
|
||||
this.threadHasAudioOnlyCall = threadHasAudioOnlyCall; |
|
||||
this.textAttributes = textAttributes; |
|
||||
} |
|
||||
|
|
||||
public String getAction() { |
|
||||
return action; |
|
||||
} |
|
||||
|
|
||||
public String getEncodedServerDataInfo() { |
|
||||
return encodedServerDataInfo; |
|
||||
} |
|
||||
|
|
||||
public String getDescription() { |
|
||||
return description; |
|
||||
} |
|
||||
|
|
||||
public boolean isThreadHasAudioOnlyCall() { |
|
||||
return threadHasAudioOnlyCall; |
|
||||
} |
|
||||
|
|
||||
public List<DirectItemActionLog.TextRange> getTextAttributes() { |
|
||||
return textAttributes; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemVideoCallEvent that = (DirectItemVideoCallEvent) o; |
|
||||
return threadHasAudioOnlyCall == that.threadHasAudioOnlyCall && |
|
||||
Objects.equals(action, that.action) && |
|
||||
Objects.equals(encodedServerDataInfo, that.encodedServerDataInfo) && |
|
||||
Objects.equals(description, that.description) && |
|
||||
Objects.equals(textAttributes, that.textAttributes); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(action, encodedServerDataInfo, description, threadHasAudioOnlyCall, textAttributes); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,11 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemVideoCallEvent( |
||||
|
val action: String? = null, |
||||
|
val encodedServerDataInfo: String? = null, |
||||
|
val description: String? = null, |
||||
|
val threadHasAudioOnlyCall: Boolean = false, |
||||
|
val textAttributes: List<TextRange>? = null, |
||||
|
) : Serializable |
@ -1,90 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.models.enums.RavenMediaViewMode; |
|
||||
import awais.instagrabber.repositories.responses.Media; |
|
||||
|
|
||||
public class DirectItemVisualMedia implements Serializable { |
|
||||
private final long urlExpireAtSecs; |
|
||||
private final int playbackDurationSecs; |
|
||||
private final List<Long> seenUserIds; |
|
||||
private final RavenMediaViewMode viewMode; |
|
||||
private final int seenCount; |
|
||||
private final long replayExpiringAtUs; |
|
||||
private final RavenExpiringMediaActionSummary expiringMediaActionSummary; |
|
||||
private final Media media; |
|
||||
|
|
||||
public DirectItemVisualMedia(final long urlExpireAtSecs, |
|
||||
final int playbackDurationSecs, |
|
||||
final List<Long> seenUserIds, |
|
||||
final RavenMediaViewMode viewMode, |
|
||||
final int seenCount, |
|
||||
final long replayExpiringAtUs, |
|
||||
final RavenExpiringMediaActionSummary expiringMediaActionSummary, |
|
||||
final Media media) { |
|
||||
this.urlExpireAtSecs = urlExpireAtSecs; |
|
||||
this.playbackDurationSecs = playbackDurationSecs; |
|
||||
this.seenUserIds = seenUserIds; |
|
||||
this.viewMode = viewMode; |
|
||||
this.seenCount = seenCount; |
|
||||
this.replayExpiringAtUs = replayExpiringAtUs; |
|
||||
this.expiringMediaActionSummary = expiringMediaActionSummary; |
|
||||
this.media = media; |
|
||||
} |
|
||||
|
|
||||
public long getUrlExpireAtSecs() { |
|
||||
return urlExpireAtSecs; |
|
||||
} |
|
||||
|
|
||||
public int getPlaybackDurationSecs() { |
|
||||
return playbackDurationSecs; |
|
||||
} |
|
||||
|
|
||||
public List<Long> getSeenUserIds() { |
|
||||
return seenUserIds; |
|
||||
} |
|
||||
|
|
||||
public RavenMediaViewMode getViewMode() { |
|
||||
return viewMode; |
|
||||
} |
|
||||
|
|
||||
public int getSeenCount() { |
|
||||
return seenCount; |
|
||||
} |
|
||||
|
|
||||
public long getReplayExpiringAtUs() { |
|
||||
return replayExpiringAtUs; |
|
||||
} |
|
||||
|
|
||||
public RavenExpiringMediaActionSummary getExpiringMediaActionSummary() { |
|
||||
return expiringMediaActionSummary; |
|
||||
} |
|
||||
|
|
||||
public Media getMedia() { |
|
||||
return media; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemVisualMedia media1 = (DirectItemVisualMedia) o; |
|
||||
return urlExpireAtSecs == media1.urlExpireAtSecs && |
|
||||
playbackDurationSecs == media1.playbackDurationSecs && |
|
||||
seenCount == media1.seenCount && |
|
||||
replayExpiringAtUs == media1.replayExpiringAtUs && |
|
||||
Objects.equals(seenUserIds, media1.seenUserIds) && |
|
||||
viewMode == media1.viewMode && |
|
||||
Objects.equals(expiringMediaActionSummary, media1.expiringMediaActionSummary) && |
|
||||
Objects.equals(media, media1.media); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects |
|
||||
.hash(urlExpireAtSecs, playbackDurationSecs, seenUserIds, viewMode, seenCount, replayExpiringAtUs, expiringMediaActionSummary, media); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,16 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.models.enums.RavenMediaViewMode |
||||
|
import awais.instagrabber.repositories.responses.Media |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemVisualMedia( |
||||
|
val urlExpireAtSecs: Long = 0, |
||||
|
val playbackDurationSecs: Int = 0, |
||||
|
val seenUserIds: List<Long>? = null, |
||||
|
val viewMode: RavenMediaViewMode? = null, |
||||
|
val seenCount: Int = 0, |
||||
|
val replayExpiringAtUs: Long = 0, |
||||
|
val expiringMediaActionSummary: RavenExpiringMediaActionSummary? = null, |
||||
|
val media: Media? = null, |
||||
|
) : Serializable |
@ -1,45 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.Media; |
|
||||
|
|
||||
public class DirectItemVoiceMedia implements Serializable { |
|
||||
private final Media media; |
|
||||
private final int seenCount; |
|
||||
private final String viewMode; |
|
||||
|
|
||||
public DirectItemVoiceMedia(final Media media, final int seenCount, final String viewMode) { |
|
||||
this.media = media; |
|
||||
this.seenCount = seenCount; |
|
||||
this.viewMode = viewMode; |
|
||||
} |
|
||||
|
|
||||
public Media getMedia() { |
|
||||
return media; |
|
||||
} |
|
||||
|
|
||||
public int getSeenCount() { |
|
||||
return seenCount; |
|
||||
} |
|
||||
|
|
||||
public String getViewMode() { |
|
||||
return viewMode; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemVoiceMedia that = (DirectItemVoiceMedia) o; |
|
||||
return seenCount == that.seenCount && |
|
||||
Objects.equals(media, that.media) && |
|
||||
Objects.equals(viewMode, that.viewMode); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(media, seenCount, viewMode); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,10 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.Media |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemVoiceMedia( |
||||
|
val media: Media? = null, |
||||
|
val seenCount: Int = 0, |
||||
|
val viewMode: String? = null, |
||||
|
) : Serializable |
@ -1,104 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectItemXma { |
|
||||
private final XmaUrlInfo previewUrlInfo; |
|
||||
private final XmaUrlInfo playableUrlInfo; |
|
||||
|
|
||||
public DirectItemXma(final XmaUrlInfo previewUrlInfo, final XmaUrlInfo playableUrlInfo) { |
|
||||
this.previewUrlInfo = previewUrlInfo; |
|
||||
this.playableUrlInfo = playableUrlInfo; |
|
||||
} |
|
||||
|
|
||||
public XmaUrlInfo getPreviewUrlInfo() { |
|
||||
return previewUrlInfo; |
|
||||
} |
|
||||
|
|
||||
public XmaUrlInfo getPlayableUrlInfo() { |
|
||||
return playableUrlInfo; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectItemXma that = (DirectItemXma) o; |
|
||||
return Objects.equals(previewUrlInfo, that.previewUrlInfo) && |
|
||||
Objects.equals(playableUrlInfo, that.playableUrlInfo); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(previewUrlInfo, playableUrlInfo); |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectItemXma{" + |
|
||||
"previewUrlInfo=" + previewUrlInfo + |
|
||||
", playableUrlInfo=" + playableUrlInfo + |
|
||||
'}'; |
|
||||
} |
|
||||
|
|
||||
public static class XmaUrlInfo implements Serializable { |
|
||||
private final String url; |
|
||||
private final long urlExpirationTimestampUs; |
|
||||
private final int width; |
|
||||
private final int height; |
|
||||
|
|
||||
public XmaUrlInfo(final String url, final long urlExpirationTimestampUs, final int width, final int height) { |
|
||||
this.url = url; |
|
||||
this.urlExpirationTimestampUs = urlExpirationTimestampUs; |
|
||||
this.width = width; |
|
||||
this.height = height; |
|
||||
} |
|
||||
|
|
||||
public String getUrl() { |
|
||||
return url; |
|
||||
} |
|
||||
|
|
||||
public long getUrlExpirationTimestampUs() { |
|
||||
return urlExpirationTimestampUs; |
|
||||
} |
|
||||
|
|
||||
public int getWidth() { |
|
||||
return width; |
|
||||
} |
|
||||
|
|
||||
public int getHeight() { |
|
||||
return height; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final XmaUrlInfo that = (XmaUrlInfo) o; |
|
||||
return urlExpirationTimestampUs == that.urlExpirationTimestampUs && |
|
||||
width == that.width && |
|
||||
height == that.height && |
|
||||
Objects.equals(url, that.url); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(url, urlExpirationTimestampUs, width, height); |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "XmaUrlInfo{" + |
|
||||
"url='" + url + '\'' + |
|
||||
", urlExpirationTimestampUs=" + urlExpirationTimestampUs + |
|
||||
", width=" + width + |
|
||||
", height=" + height + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,15 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectItemXma( |
||||
|
val previewUrlInfo: XmaUrlInfo? = null, |
||||
|
val playableUrlInfo: XmaUrlInfo? = null, |
||||
|
) : Serializable |
||||
|
|
||||
|
data class XmaUrlInfo( |
||||
|
val url: String? = null, |
||||
|
val urlExpirationTimestampUs: Long = 0, |
||||
|
val width: Int = 0, |
||||
|
val height: Int = 0, |
||||
|
) : Serializable |
@ -1,372 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
import androidx.annotation.Nullable; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.User; |
|
||||
|
|
||||
public class DirectThread implements Serializable, Cloneable { |
|
||||
private final String threadId; |
|
||||
private final String threadV2Id; |
|
||||
private List<User> users; |
|
||||
private List<User> leftUsers; |
|
||||
private List<Long> adminUserIds; |
|
||||
private List<DirectItem> items; |
|
||||
private final long lastActivityAt; |
|
||||
private boolean muted; |
|
||||
private final boolean isPin; |
|
||||
private final boolean named; |
|
||||
private final boolean canonical; |
|
||||
private boolean pending; |
|
||||
private final boolean archived; |
|
||||
private final boolean valuedRequest; |
|
||||
private final String threadType; |
|
||||
private final long viewerId; |
|
||||
private final String threadTitle; |
|
||||
private final String pendingScore; |
|
||||
private final long folder; |
|
||||
private final boolean vcMuted; |
|
||||
private final boolean isGroup; |
|
||||
private boolean mentionsMuted; |
|
||||
private final User inviter; |
|
||||
private final boolean hasOlder; |
|
||||
private final boolean hasNewer; |
|
||||
private Map<Long, DirectThreadLastSeenAt> lastSeenAt; |
|
||||
private final String newestCursor; |
|
||||
private final String oldestCursor; |
|
||||
private final boolean isSpam; |
|
||||
private final DirectItem lastPermanentItem; |
|
||||
private final DirectThreadDirectStory directStory; |
|
||||
private boolean approvalRequiredForNewMembers; |
|
||||
private int inputMode; |
|
||||
private final List<ThreadContext> threadContextItems; |
|
||||
private boolean isTemp; |
|
||||
|
|
||||
public DirectThread(final String threadId, |
|
||||
final String threadV2Id, |
|
||||
final List<User> users, |
|
||||
final List<User> leftUsers, |
|
||||
final List<Long> adminUserIds, |
|
||||
final List<DirectItem> items, |
|
||||
final long lastActivityAt, |
|
||||
final boolean muted, |
|
||||
final boolean isPin, |
|
||||
final boolean named, |
|
||||
final boolean canonical, |
|
||||
final boolean pending, |
|
||||
final boolean archived, |
|
||||
final boolean valuedRequest, |
|
||||
final String threadType, |
|
||||
final long viewerId, |
|
||||
final String threadTitle, |
|
||||
final String pendingScore, |
|
||||
final long folder, |
|
||||
final boolean vcMuted, |
|
||||
final boolean isGroup, |
|
||||
final boolean mentionsMuted, |
|
||||
final User inviter, |
|
||||
final boolean hasOlder, |
|
||||
final boolean hasNewer, |
|
||||
final Map<Long, DirectThreadLastSeenAt> lastSeenAt, |
|
||||
final String newestCursor, |
|
||||
final String oldestCursor, |
|
||||
final boolean isSpam, |
|
||||
final DirectItem lastPermanentItem, |
|
||||
final DirectThreadDirectStory directStory, |
|
||||
final boolean approvalRequiredForNewMembers, |
|
||||
final int inputMode, |
|
||||
final List<ThreadContext> threadContextItems) { |
|
||||
this.threadId = threadId; |
|
||||
this.threadV2Id = threadV2Id; |
|
||||
this.users = users; |
|
||||
this.leftUsers = leftUsers; |
|
||||
this.adminUserIds = adminUserIds; |
|
||||
this.items = items; |
|
||||
this.lastActivityAt = lastActivityAt; |
|
||||
this.muted = muted; |
|
||||
this.isPin = isPin; |
|
||||
this.named = named; |
|
||||
this.canonical = canonical; |
|
||||
this.pending = pending; |
|
||||
this.archived = archived; |
|
||||
this.valuedRequest = valuedRequest; |
|
||||
this.threadType = threadType; |
|
||||
this.viewerId = viewerId; |
|
||||
this.threadTitle = threadTitle; |
|
||||
this.pendingScore = pendingScore; |
|
||||
this.folder = folder; |
|
||||
this.vcMuted = vcMuted; |
|
||||
this.isGroup = isGroup; |
|
||||
this.mentionsMuted = mentionsMuted; |
|
||||
this.inviter = inviter; |
|
||||
this.hasOlder = hasOlder; |
|
||||
this.hasNewer = hasNewer; |
|
||||
this.lastSeenAt = lastSeenAt; |
|
||||
this.newestCursor = newestCursor; |
|
||||
this.oldestCursor = oldestCursor; |
|
||||
this.isSpam = isSpam; |
|
||||
this.lastPermanentItem = lastPermanentItem; |
|
||||
this.directStory = directStory; |
|
||||
this.approvalRequiredForNewMembers = approvalRequiredForNewMembers; |
|
||||
this.inputMode = inputMode; |
|
||||
this.threadContextItems = threadContextItems; |
|
||||
} |
|
||||
|
|
||||
public String getThreadId() { |
|
||||
return threadId; |
|
||||
} |
|
||||
|
|
||||
public String getThreadV2Id() { |
|
||||
return threadV2Id; |
|
||||
} |
|
||||
|
|
||||
public List<User> getUsers() { |
|
||||
return users; |
|
||||
} |
|
||||
|
|
||||
public void setUsers(final List<User> users) { |
|
||||
this.users = users; |
|
||||
} |
|
||||
|
|
||||
public List<User> getLeftUsers() { |
|
||||
return leftUsers; |
|
||||
} |
|
||||
|
|
||||
public void setLeftUsers(final List<User> leftUsers) { |
|
||||
this.leftUsers = leftUsers; |
|
||||
} |
|
||||
|
|
||||
public List<Long> getAdminUserIds() { |
|
||||
return adminUserIds; |
|
||||
} |
|
||||
|
|
||||
public void setAdminUserIds(final List<Long> adminUserIds) { |
|
||||
this.adminUserIds = adminUserIds; |
|
||||
} |
|
||||
|
|
||||
public List<DirectItem> getItems() { |
|
||||
return items; |
|
||||
} |
|
||||
|
|
||||
public void setItems(final List<DirectItem> items) { |
|
||||
this.items = items; |
|
||||
} |
|
||||
|
|
||||
public long getLastActivityAt() { |
|
||||
return lastActivityAt; |
|
||||
} |
|
||||
|
|
||||
public boolean isMuted() { |
|
||||
return muted; |
|
||||
} |
|
||||
|
|
||||
public void setMuted(final boolean muted) { |
|
||||
this.muted = muted; |
|
||||
} |
|
||||
|
|
||||
public boolean isPin() { |
|
||||
return isPin; |
|
||||
} |
|
||||
|
|
||||
public boolean isNamed() { |
|
||||
return named; |
|
||||
} |
|
||||
|
|
||||
public boolean isCanonical() { |
|
||||
return canonical; |
|
||||
} |
|
||||
|
|
||||
public boolean isPending() { |
|
||||
return pending; |
|
||||
} |
|
||||
|
|
||||
public void setPending(final boolean pending) { |
|
||||
this.pending = pending; |
|
||||
} |
|
||||
|
|
||||
public boolean isArchived() { |
|
||||
return archived; |
|
||||
} |
|
||||
|
|
||||
public boolean isValuedRequest() { |
|
||||
return valuedRequest; |
|
||||
} |
|
||||
|
|
||||
public String getThreadType() { |
|
||||
return threadType; |
|
||||
} |
|
||||
|
|
||||
public long getViewerId() { |
|
||||
return viewerId; |
|
||||
} |
|
||||
|
|
||||
public String getThreadTitle() { |
|
||||
return threadTitle; |
|
||||
} |
|
||||
|
|
||||
public String getPendingScore() { |
|
||||
return pendingScore; |
|
||||
} |
|
||||
|
|
||||
public long getFolder() { |
|
||||
return folder; |
|
||||
} |
|
||||
|
|
||||
public boolean isVcMuted() { |
|
||||
return vcMuted; |
|
||||
} |
|
||||
|
|
||||
public boolean isGroup() { |
|
||||
return isGroup; |
|
||||
} |
|
||||
|
|
||||
public boolean isMentionsMuted() { |
|
||||
return mentionsMuted; |
|
||||
} |
|
||||
|
|
||||
public void setMentionsMuted(final boolean mentionsMuted) { |
|
||||
this.mentionsMuted = mentionsMuted; |
|
||||
} |
|
||||
|
|
||||
public User getInviter() { |
|
||||
return inviter; |
|
||||
} |
|
||||
|
|
||||
public boolean hasOlder() { |
|
||||
return hasOlder; |
|
||||
} |
|
||||
|
|
||||
public boolean hasNewer() { |
|
||||
return hasNewer; |
|
||||
} |
|
||||
|
|
||||
public Map<Long, DirectThreadLastSeenAt> getLastSeenAt() { |
|
||||
return lastSeenAt; |
|
||||
} |
|
||||
|
|
||||
public void setLastSeenAt(final Map<Long, DirectThreadLastSeenAt> lastSeenAt) { |
|
||||
this.lastSeenAt = lastSeenAt; |
|
||||
} |
|
||||
|
|
||||
public String getNewestCursor() { |
|
||||
return newestCursor; |
|
||||
} |
|
||||
|
|
||||
public String getOldestCursor() { |
|
||||
return oldestCursor; |
|
||||
} |
|
||||
|
|
||||
public boolean isSpam() { |
|
||||
return isSpam; |
|
||||
} |
|
||||
|
|
||||
public DirectItem getLastPermanentItem() { |
|
||||
return lastPermanentItem; |
|
||||
} |
|
||||
|
|
||||
public DirectThreadDirectStory getDirectStory() { |
|
||||
return directStory; |
|
||||
} |
|
||||
|
|
||||
public boolean isApprovalRequiredForNewMembers() { |
|
||||
return approvalRequiredForNewMembers; |
|
||||
} |
|
||||
|
|
||||
public void setApprovalRequiredForNewMembers(final boolean approvalRequiredForNewMembers) { |
|
||||
this.approvalRequiredForNewMembers = approvalRequiredForNewMembers; |
|
||||
} |
|
||||
|
|
||||
public int getInputMode() { |
|
||||
return inputMode; |
|
||||
} |
|
||||
|
|
||||
public void setInputMode(final int inputMode) { |
|
||||
this.inputMode = inputMode; |
|
||||
} |
|
||||
|
|
||||
public List<ThreadContext> getThreadContextItems() { |
|
||||
return threadContextItems; |
|
||||
} |
|
||||
|
|
||||
public boolean isTemp() { |
|
||||
return isTemp; |
|
||||
} |
|
||||
|
|
||||
public void setTemp(final boolean isTemp) { |
|
||||
this.isTemp = isTemp; |
|
||||
} |
|
||||
|
|
||||
@Nullable |
|
||||
public DirectItem getFirstDirectItem() { |
|
||||
DirectItem firstItem = null; |
|
||||
if (!items.isEmpty()) { |
|
||||
int position = 0; |
|
||||
while (firstItem == null && position < items.size()) { |
|
||||
firstItem = items.get(position); |
|
||||
position++; |
|
||||
} |
|
||||
} |
|
||||
return firstItem; |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public Object clone() throws CloneNotSupportedException { |
|
||||
return super.clone(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectThread that = (DirectThread) o; |
|
||||
return lastActivityAt == that.lastActivityAt && |
|
||||
muted == that.muted && |
|
||||
isPin == that.isPin && |
|
||||
named == that.named && |
|
||||
canonical == that.canonical && |
|
||||
pending == that.pending && |
|
||||
archived == that.archived && |
|
||||
valuedRequest == that.valuedRequest && |
|
||||
viewerId == that.viewerId && |
|
||||
folder == that.folder && |
|
||||
vcMuted == that.vcMuted && |
|
||||
isGroup == that.isGroup && |
|
||||
mentionsMuted == that.mentionsMuted && |
|
||||
hasOlder == that.hasOlder && |
|
||||
hasNewer == that.hasNewer && |
|
||||
isSpam == that.isSpam && |
|
||||
approvalRequiredForNewMembers == that.approvalRequiredForNewMembers && |
|
||||
inputMode == that.inputMode && |
|
||||
Objects.equals(threadId, that.threadId) && |
|
||||
Objects.equals(threadV2Id, that.threadV2Id) && |
|
||||
Objects.equals(users, that.users) && |
|
||||
Objects.equals(leftUsers, that.leftUsers) && |
|
||||
Objects.equals(adminUserIds, that.adminUserIds) && |
|
||||
Objects.equals(items, that.items) && |
|
||||
Objects.equals(threadType, that.threadType) && |
|
||||
Objects.equals(threadTitle, that.threadTitle) && |
|
||||
Objects.equals(pendingScore, that.pendingScore) && |
|
||||
Objects.equals(inviter, that.inviter) && |
|
||||
Objects.equals(lastSeenAt, that.lastSeenAt) && |
|
||||
Objects.equals(newestCursor, that.newestCursor) && |
|
||||
Objects.equals(oldestCursor, that.oldestCursor) && |
|
||||
Objects.equals(lastPermanentItem, that.lastPermanentItem) && |
|
||||
Objects.equals(directStory, that.directStory) && |
|
||||
Objects.equals(threadContextItems, that.threadContextItems); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects |
|
||||
.hash(threadId, threadV2Id, users, leftUsers, adminUserIds, items, lastActivityAt, muted, isPin, named, canonical, pending, archived, |
|
||||
valuedRequest, threadType, viewerId, threadTitle, pendingScore, folder, vcMuted, isGroup, mentionsMuted, inviter, hasOlder, |
|
||||
hasNewer, lastSeenAt, newestCursor, oldestCursor, isSpam, lastPermanentItem, directStory, approvalRequiredForNewMembers, |
|
||||
inputMode, threadContextItems); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,49 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.User |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectThread( |
||||
|
val threadId: String? = null, |
||||
|
val threadV2Id: String? = null, |
||||
|
var users: List<User>? = null, |
||||
|
var leftUsers: List<User>? = null, |
||||
|
var adminUserIds: List<Long>? = null, |
||||
|
var items: List<DirectItem>? = null, |
||||
|
val lastActivityAt: Long = 0, |
||||
|
var muted: Boolean = false, |
||||
|
val isPin: Boolean = false, |
||||
|
val named: Boolean = false, |
||||
|
val canonical: Boolean = false, |
||||
|
var pending: Boolean = false, |
||||
|
val archived: Boolean = false, |
||||
|
val valuedRequest: Boolean = false, |
||||
|
val threadType: String? = null, |
||||
|
val viewerId: Long = 0, |
||||
|
val threadTitle: String? = null, |
||||
|
val pendingScore: String? = null, |
||||
|
val folder: Long = 0, |
||||
|
val vcMuted: Boolean = false, |
||||
|
val isGroup: Boolean = false, |
||||
|
var mentionsMuted: Boolean = false, |
||||
|
val inviter: User? = null, |
||||
|
val hasOlder: Boolean = false, |
||||
|
val hasNewer: Boolean = false, |
||||
|
var lastSeenAt: Map<Long, DirectThreadLastSeenAt>? = null, |
||||
|
val newestCursor: String? = null, |
||||
|
val oldestCursor: String? = null, |
||||
|
val isSpam: Boolean = false, |
||||
|
val lastPermanentItem: DirectItem? = null, |
||||
|
val directStory: DirectThreadDirectStory? = null, |
||||
|
var approvalRequiredForNewMembers: Boolean = false, |
||||
|
var inputMode: Int = 0, |
||||
|
val threadContextItems: List<ThreadContext>? = null |
||||
|
) : Serializable, Cloneable { |
||||
|
var isTemp = false |
||||
|
|
||||
|
val firstDirectItem: DirectItem? |
||||
|
get() = items?.firstNotNullOfOrNull { it } |
||||
|
|
||||
|
@Throws(CloneNotSupportedException::class) |
||||
|
public override fun clone(): Any = super.clone() |
||||
|
} |
@ -1,57 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
public class DirectThreadBroadcastResponse { |
|
||||
private final String action; |
|
||||
private final String statusCode; |
|
||||
private final DirectThreadBroadcastResponsePayload payload; |
|
||||
private final List<DirectThreadBroadcastResponseMessageMetadata> messageMetadata; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectThreadBroadcastResponse(final String action, |
|
||||
final String statusCode, |
|
||||
final DirectThreadBroadcastResponsePayload payload, |
|
||||
final List<DirectThreadBroadcastResponseMessageMetadata> messageMetadata, |
|
||||
final String status) { |
|
||||
this.action = action; |
|
||||
this.statusCode = statusCode; |
|
||||
this.payload = payload; |
|
||||
this.messageMetadata = messageMetadata; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public String getAction() { |
|
||||
return action; |
|
||||
} |
|
||||
|
|
||||
public String getStatusCode() { |
|
||||
return statusCode; |
|
||||
} |
|
||||
|
|
||||
public DirectThreadBroadcastResponsePayload getPayload() { |
|
||||
return payload; |
|
||||
} |
|
||||
|
|
||||
public List<DirectThreadBroadcastResponseMessageMetadata> getMessageMetadata() { |
|
||||
return messageMetadata; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectThreadBroadcastResponse{" + |
|
||||
"action='" + action + '\'' + |
|
||||
", statusCode='" + statusCode + '\'' + |
|
||||
", payload=" + payload + |
|
||||
", messageMetadata=" + messageMetadata + |
|
||||
", status='" + status + '\'' + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,9 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectThreadBroadcastResponse( |
||||
|
val action: String? = null, |
||||
|
val statusCode: String? = null, |
||||
|
val payload: DirectThreadBroadcastResponsePayload? = null, |
||||
|
val messageMetadata: List<DirectThreadBroadcastResponseMessageMetadata>? = null, |
||||
|
val status: String? = null |
||||
|
) |
@ -1,55 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
public class DirectThreadBroadcastResponseMessageMetadata { |
|
||||
private final String clientContext; |
|
||||
private final String itemId; |
|
||||
private final long timestamp; |
|
||||
private final String threadId; |
|
||||
private final List<String> participantIds; |
|
||||
|
|
||||
|
|
||||
public DirectThreadBroadcastResponseMessageMetadata(final String clientContext, |
|
||||
final String itemId, |
|
||||
final long timestamp, |
|
||||
final String threadId, |
|
||||
final List<String> participantIds) { |
|
||||
this.clientContext = clientContext; |
|
||||
this.itemId = itemId; |
|
||||
this.timestamp = timestamp; |
|
||||
this.threadId = threadId; |
|
||||
this.participantIds = participantIds; |
|
||||
} |
|
||||
|
|
||||
public String getClientContext() { |
|
||||
return clientContext; |
|
||||
} |
|
||||
|
|
||||
public String getItemId() { |
|
||||
return itemId; |
|
||||
} |
|
||||
|
|
||||
public long getTimestamp() { |
|
||||
return timestamp; |
|
||||
} |
|
||||
|
|
||||
public String getThreadId() { |
|
||||
return threadId; |
|
||||
} |
|
||||
|
|
||||
public List<String> getParticipantIds() { |
|
||||
return participantIds; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectThreadBroadcastResponseMessageMetadata{" + |
|
||||
"clientContext='" + clientContext + '\'' + |
|
||||
", itemId='" + itemId + '\'' + |
|
||||
", timestamp=" + timestamp + |
|
||||
", threadId='" + threadId + '\'' + |
|
||||
", participantIds=" + participantIds + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,9 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectThreadBroadcastResponseMessageMetadata( |
||||
|
val clientContext: String? = null, |
||||
|
val itemId: String? = null, |
||||
|
val timestamp: Long = 0, |
||||
|
val threadId: String? = null, |
||||
|
val participantIds: List<String>? = null, |
||||
|
) |
@ -1,44 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
public class DirectThreadBroadcastResponsePayload { |
|
||||
private final String clientContext; |
|
||||
private final String itemId; |
|
||||
private final long timestamp; |
|
||||
private final String threadId; |
|
||||
|
|
||||
public DirectThreadBroadcastResponsePayload(final String clientContext, |
|
||||
final String itemId, |
|
||||
final long timestamp, |
|
||||
final String threadId) { |
|
||||
this.clientContext = clientContext; |
|
||||
this.itemId = itemId; |
|
||||
this.timestamp = timestamp; |
|
||||
this.threadId = threadId; |
|
||||
} |
|
||||
|
|
||||
public String getClientContext() { |
|
||||
return clientContext; |
|
||||
} |
|
||||
|
|
||||
public String getItemId() { |
|
||||
return itemId; |
|
||||
} |
|
||||
|
|
||||
public long getTimestamp() { |
|
||||
return timestamp; |
|
||||
} |
|
||||
|
|
||||
public String getThreadId() { |
|
||||
return threadId; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
return "DirectThreadBroadcastResponsePayload{" + |
|
||||
"clientContext='" + clientContext + '\'' + |
|
||||
", itemId='" + itemId + '\'' + |
|
||||
", timestamp=" + timestamp + |
|
||||
", threadId='" + threadId + '\'' + |
|
||||
'}'; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,8 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectThreadBroadcastResponsePayload( |
||||
|
val clientContext: String? = null, |
||||
|
val itemId: String? = null, |
||||
|
val timestamp: Long = 0, |
||||
|
val threadId: String? = null, |
||||
|
) |
@ -1,19 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
public class DirectThreadDetailsChangeResponse { |
|
||||
private final DirectThread thread; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectThreadDetailsChangeResponse(final DirectThread thread, final String status) { |
|
||||
this.thread = thread; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public DirectThread getThread() { |
|
||||
return thread; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,6 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectThreadDetailsChangeResponse( |
||||
|
val thread: DirectThread? = null, |
||||
|
val status: String? = null |
||||
|
) |
@ -1,37 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectThreadDirectStory implements Serializable { |
|
||||
private final List<DirectItem> items; |
|
||||
private final int unseenCount; |
|
||||
|
|
||||
public DirectThreadDirectStory(final List<DirectItem> items, final int unseenCount) { |
|
||||
this.items = items; |
|
||||
this.unseenCount = unseenCount; |
|
||||
} |
|
||||
|
|
||||
public List<DirectItem> getItems() { |
|
||||
return items; |
|
||||
} |
|
||||
|
|
||||
public int getUnseenCount() { |
|
||||
return unseenCount; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectThreadDirectStory that = (DirectThreadDirectStory) o; |
|
||||
return unseenCount == that.unseenCount && |
|
||||
Objects.equals(items, that.items); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(items, unseenCount); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,8 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectThreadDirectStory( |
||||
|
val items: List<DirectItem>? = null, |
||||
|
val unseenCount: Int = 0, |
||||
|
) : Serializable |
@ -1,19 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
public class DirectThreadFeedResponse { |
|
||||
private final DirectThread thread; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectThreadFeedResponse(final DirectThread thread, final String status) { |
|
||||
this.thread = thread; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public DirectThread getThread() { |
|
||||
return thread; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,6 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectThreadFeedResponse( |
||||
|
val thread: DirectThread? = null, |
||||
|
val status: String? = null, |
||||
|
) |
@ -1,36 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class DirectThreadLastSeenAt implements Serializable { |
|
||||
private final String timestamp; |
|
||||
private final String itemId; |
|
||||
|
|
||||
public DirectThreadLastSeenAt(final String timestamp, final String itemId) { |
|
||||
this.timestamp = timestamp; |
|
||||
this.itemId = itemId; |
|
||||
} |
|
||||
|
|
||||
public String getTimestamp() { |
|
||||
return timestamp; |
|
||||
} |
|
||||
|
|
||||
public String getItemId() { |
|
||||
return itemId; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final DirectThreadLastSeenAt that = (DirectThreadLastSeenAt) o; |
|
||||
return Objects.equals(timestamp, that.timestamp) && |
|
||||
Objects.equals(itemId, that.itemId); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(timestamp, itemId); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,8 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectThreadLastSeenAt( |
||||
|
val timestamp: String? = null, |
||||
|
val itemId: String? = null, |
||||
|
) : Serializable |
@ -1,70 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.User; |
|
||||
|
|
||||
public class DirectThreadParticipantRequestsResponse implements Serializable, Cloneable { |
|
||||
private List<User> users; |
|
||||
private final Map<Long, String> requesterUsernames; |
|
||||
private final String cursor; |
|
||||
private final int totalThreadParticipants; |
|
||||
private int totalParticipantRequests; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectThreadParticipantRequestsResponse(final List<User> users, |
|
||||
final Map<Long, String> requesterUsernames, |
|
||||
final String cursor, |
|
||||
final int totalThreadParticipants, |
|
||||
final int totalParticipantRequests, |
|
||||
final String status) { |
|
||||
this.users = users; |
|
||||
this.requesterUsernames = requesterUsernames; |
|
||||
this.cursor = cursor; |
|
||||
this.totalThreadParticipants = totalThreadParticipants; |
|
||||
this.totalParticipantRequests = totalParticipantRequests; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public List<User> getUsers() { |
|
||||
return users; |
|
||||
} |
|
||||
|
|
||||
public void setUsers(final List<User> users) { |
|
||||
this.users = users; |
|
||||
} |
|
||||
|
|
||||
public Map<Long, String> getRequesterUsernames() { |
|
||||
return requesterUsernames; |
|
||||
} |
|
||||
|
|
||||
public String getCursor() { |
|
||||
return cursor; |
|
||||
} |
|
||||
|
|
||||
public int getTotalThreadParticipants() { |
|
||||
return totalThreadParticipants; |
|
||||
} |
|
||||
|
|
||||
public int getTotalParticipantRequests() { |
|
||||
return totalParticipantRequests; |
|
||||
} |
|
||||
|
|
||||
public void setTotalParticipantRequests(final int totalParticipantRequests) { |
|
||||
this.totalParticipantRequests = totalParticipantRequests; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public Object clone() throws CloneNotSupportedException { |
|
||||
return super.clone(); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,16 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.User |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class DirectThreadParticipantRequestsResponse( |
||||
|
var users: List<User>? = null, |
||||
|
val requesterUsernames: Map<Long, String>? = null, |
||||
|
val cursor: String? = null, |
||||
|
val totalThreadParticipants: Int = 0, |
||||
|
var totalParticipantRequests: Int = 0, |
||||
|
val status: String? = null, |
||||
|
) : Serializable, Cloneable { |
||||
|
@Throws(CloneNotSupportedException::class) |
||||
|
public override fun clone(): Any = super.clone() |
||||
|
} |
@ -1,46 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.User; |
|
||||
|
|
||||
public class RankedRecipient implements Serializable { |
|
||||
private final User user; |
|
||||
private final DirectThread thread; |
|
||||
|
|
||||
public RankedRecipient(final User user, final DirectThread thread) { |
|
||||
this.user = user; |
|
||||
this.thread = thread; |
|
||||
} |
|
||||
|
|
||||
public User getUser() { |
|
||||
return user; |
|
||||
} |
|
||||
|
|
||||
public DirectThread getThread() { |
|
||||
return thread; |
|
||||
} |
|
||||
|
|
||||
public static RankedRecipient of(final User user) { |
|
||||
return new RankedRecipient(user, null); |
|
||||
} |
|
||||
|
|
||||
public static RankedRecipient of(final DirectThread thread) { |
|
||||
return new RankedRecipient(null, thread); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final RankedRecipient that = (RankedRecipient) o; |
|
||||
return Objects.equals(user, that.user) && |
|
||||
Objects.equals(thread, that.thread); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(user, thread); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,21 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.User |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class RankedRecipient( |
||||
|
val user: User? = null, |
||||
|
val thread: DirectThread? = null, |
||||
|
) : Serializable { |
||||
|
companion object { |
||||
|
@JvmStatic |
||||
|
fun of(user: User): RankedRecipient { |
||||
|
return RankedRecipient(user = user) |
||||
|
} |
||||
|
|
||||
|
@JvmStatic |
||||
|
fun of(thread: DirectThread): RankedRecipient { |
||||
|
return RankedRecipient(thread = thread) |
||||
|
} |
||||
|
} |
||||
|
} |
@ -1,50 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
public class RankedRecipientsResponse { |
|
||||
private final List<RankedRecipient> rankedRecipients; |
|
||||
private final long expires; |
|
||||
private final boolean filtered; |
|
||||
private final String requestId; |
|
||||
private final String rankToken; |
|
||||
private final String status; |
|
||||
|
|
||||
public RankedRecipientsResponse(final List<RankedRecipient> rankedRecipients, |
|
||||
final long expires, |
|
||||
final boolean filtered, |
|
||||
final String requestId, |
|
||||
final String rankToken, |
|
||||
final String status) { |
|
||||
this.rankedRecipients = rankedRecipients; |
|
||||
this.expires = expires; |
|
||||
this.filtered = filtered; |
|
||||
this.requestId = requestId; |
|
||||
this.rankToken = rankToken; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public List<RankedRecipient> getRankedRecipients() { |
|
||||
return rankedRecipients; |
|
||||
} |
|
||||
|
|
||||
public long getExpires() { |
|
||||
return expires; |
|
||||
} |
|
||||
|
|
||||
public boolean isFiltered() { |
|
||||
return filtered; |
|
||||
} |
|
||||
|
|
||||
public String getRequestId() { |
|
||||
return requestId; |
|
||||
} |
|
||||
|
|
||||
public String getRankToken() { |
|
||||
return rankToken; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,10 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class RankedRecipientsResponse( |
||||
|
val rankedRecipients: List<RankedRecipient>? = null, |
||||
|
val expires: Long = 0, |
||||
|
val filtered: Boolean = false, |
||||
|
val requestId: String? = null, |
||||
|
val rankToken: String? = null, |
||||
|
val status: String? = null, |
||||
|
) |
@ -1,69 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import com.google.gson.annotations.SerializedName; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public final class RavenExpiringMediaActionSummary implements Serializable { |
|
||||
private final ActionType type; |
|
||||
private final long timestamp; |
|
||||
private final int count; |
|
||||
|
|
||||
public RavenExpiringMediaActionSummary(final long timestamp, final int count, final ActionType type) { |
|
||||
this.timestamp = timestamp; |
|
||||
this.count = count; |
|
||||
this.type = type; |
|
||||
} |
|
||||
|
|
||||
public long getTimestamp() { |
|
||||
return timestamp; |
|
||||
} |
|
||||
|
|
||||
public int getCount() { |
|
||||
return count; |
|
||||
} |
|
||||
|
|
||||
public ActionType getType() { |
|
||||
return type; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final RavenExpiringMediaActionSummary that = (RavenExpiringMediaActionSummary) o; |
|
||||
return timestamp == that.timestamp && |
|
||||
count == that.count && |
|
||||
type == that.type; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(type, timestamp, count); |
|
||||
} |
|
||||
|
|
||||
// thanks to http://github.com/warifp/InstagramAutoPostImageUrl/blob/master/vendor/mgp25/instagram-php/src/Response/Model/ActionBadge.php |
|
||||
public enum ActionType { |
|
||||
@SerializedName("raven_delivered") |
|
||||
DELIVERED, |
|
||||
@SerializedName("raven_sent") |
|
||||
SENT, |
|
||||
@SerializedName("raven_opened") |
|
||||
OPENED, |
|
||||
@SerializedName("raven_screenshot") |
|
||||
SCREENSHOT, |
|
||||
@SerializedName("raven_replayed") |
|
||||
REPLAYED, |
|
||||
@SerializedName("raven_cannot_deliver") |
|
||||
CANNOT_DELIVER, |
|
||||
@SerializedName("raven_sending") |
|
||||
SENDING, |
|
||||
@SerializedName("raven_blocked") |
|
||||
BLOCKED, |
|
||||
@SerializedName("raven_unknown") |
|
||||
UNKNOWN, |
|
||||
@SerializedName("raven_suggested") |
|
||||
SUGGESTED, |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,43 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import com.google.gson.annotations.SerializedName |
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class RavenExpiringMediaActionSummary( |
||||
|
val timestamp: Long = 0, |
||||
|
val count: Int = 0, |
||||
|
val type: ActionType? = null, |
||||
|
) : Serializable |
||||
|
|
||||
|
// thanks to http://github.com/warifp/InstagramAutoPostImageUrl/blob/master/vendor/mgp25/instagram-php/src/Response/Model/ActionBadge.php |
||||
|
enum class ActionType { |
||||
|
@SerializedName("raven_delivered") |
||||
|
DELIVERED, |
||||
|
|
||||
|
@SerializedName("raven_sent") |
||||
|
SENT, |
||||
|
|
||||
|
@SerializedName("raven_opened") |
||||
|
OPENED, |
||||
|
|
||||
|
@SerializedName("raven_screenshot") |
||||
|
SCREENSHOT, |
||||
|
|
||||
|
@SerializedName("raven_replayed") |
||||
|
REPLAYED, |
||||
|
|
||||
|
@SerializedName("raven_cannot_deliver") |
||||
|
CANNOT_DELIVER, |
||||
|
|
||||
|
@SerializedName("raven_sending") |
||||
|
SENDING, |
||||
|
|
||||
|
@SerializedName("raven_blocked") |
||||
|
BLOCKED, |
||||
|
|
||||
|
@SerializedName("raven_unknown") |
||||
|
UNKNOWN, |
||||
|
|
||||
|
@SerializedName("raven_suggested") |
||||
|
SUGGESTED, |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class TextRange( |
||||
|
val start: Int = 0, |
||||
|
val end: Int = 0, |
||||
|
val color: String? = null, |
||||
|
val intent: String? = null, |
||||
|
) : Serializable |
@ -1,36 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Objects; |
|
||||
|
|
||||
public class ThreadContext implements Serializable { |
|
||||
private final int type; |
|
||||
private final String text; |
|
||||
|
|
||||
public ThreadContext(final int type, final String text) { |
|
||||
this.type = type; |
|
||||
this.text = text; |
|
||||
} |
|
||||
|
|
||||
public int getType() { |
|
||||
return type; |
|
||||
} |
|
||||
|
|
||||
public String getText() { |
|
||||
return text; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public boolean equals(final Object o) { |
|
||||
if (this == o) return true; |
|
||||
if (o == null || getClass() != o.getClass()) return false; |
|
||||
final ThreadContext that = (ThreadContext) o; |
|
||||
return type == that.type && |
|
||||
Objects.equals(text, that.text); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public int hashCode() { |
|
||||
return Objects.hash(type, text); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,8 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import java.io.Serializable |
||||
|
|
||||
|
data class ThreadContext( |
||||
|
val type: Int = 0, |
||||
|
val text: String? = null, |
||||
|
) : Serializable |
@ -1,19 +0,0 @@ |
|||||
package awais.instagrabber.viewmodels; |
|
||||
|
|
||||
import androidx.lifecycle.MutableLiveData; |
|
||||
import androidx.lifecycle.ViewModel; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
import awais.instagrabber.db.entities.Favorite; |
|
||||
|
|
||||
public class FavoritesViewModel extends ViewModel { |
|
||||
private MutableLiveData<List<Favorite>> list; |
|
||||
|
|
||||
public MutableLiveData<List<Favorite>> getList() { |
|
||||
if (list == null) { |
|
||||
list = new MutableLiveData<>(); |
|
||||
} |
|
||||
return list; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,48 @@ |
|||||
|
package awais.instagrabber.viewmodels |
||||
|
|
||||
|
import android.app.Application |
||||
|
import androidx.lifecycle.AndroidViewModel |
||||
|
import androidx.lifecycle.LiveData |
||||
|
import androidx.lifecycle.MutableLiveData |
||||
|
import awais.instagrabber.db.datasources.FavoriteDataSource |
||||
|
import awais.instagrabber.db.entities.Favorite |
||||
|
import awais.instagrabber.db.repositories.FavoriteRepository |
||||
|
import awais.instagrabber.db.repositories.RepositoryCallback |
||||
|
|
||||
|
class FavoritesViewModel(application: Application) : AndroidViewModel(application) { |
||||
|
private val _list = MutableLiveData<List<Favorite>>() |
||||
|
val list: LiveData<List<Favorite>> = _list |
||||
|
|
||||
|
private val favoriteRepository: FavoriteRepository = FavoriteRepository.getInstance(FavoriteDataSource.getInstance(application)) |
||||
|
|
||||
|
init { |
||||
|
fetch() |
||||
|
} |
||||
|
|
||||
|
fun fetch() { |
||||
|
favoriteRepository.getAllFavorites(object : RepositoryCallback<List<Favorite>> { |
||||
|
override fun onSuccess(favorites: List<Favorite>?) { |
||||
|
_list.postValue(favorites ?: emptyList()) |
||||
|
} |
||||
|
|
||||
|
override fun onDataNotAvailable() {} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
fun delete(favorite: Favorite, onSuccess: () -> Unit) { |
||||
|
favoriteRepository.deleteFavorite(favorite.query, favorite.type, object : RepositoryCallback<Void> { |
||||
|
override fun onSuccess(result: Void?) { |
||||
|
onSuccess() |
||||
|
favoriteRepository.getAllFavorites(object : RepositoryCallback<List<Favorite>> { |
||||
|
override fun onSuccess(result: List<Favorite>?) { |
||||
|
_list.postValue(result ?: emptyList()) |
||||
|
} |
||||
|
|
||||
|
override fun onDataNotAvailable() {} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
override fun onDataNotAvailable() {} |
||||
|
}) |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue