2021-01-02 02:54:32 +00:00
|
|
|
package awais.instagrabber.webservices;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
2021-01-15 18:10:17 +00:00
|
|
|
import androidx.annotation.Nullable;
|
2021-01-02 02:54:32 +00:00
|
|
|
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
|
|
|
|
|
import org.json.JSONArray;
|
|
|
|
|
2021-01-02 04:00:14 +00:00
|
|
|
import java.io.UnsupportedEncodingException;
|
2021-01-03 09:55:19 +00:00
|
|
|
import java.util.Collection;
|
2021-01-02 02:54:32 +00:00
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Objects;
|
2021-01-02 04:00:14 +00:00
|
|
|
import java.util.UUID;
|
2021-01-15 18:10:17 +00:00
|
|
|
import java.util.stream.Collectors;
|
2021-01-02 02:54:32 +00:00
|
|
|
|
|
|
|
import awais.instagrabber.repositories.DirectMessagesRepository;
|
|
|
|
import awais.instagrabber.repositories.requests.directmessages.BroadcastOptions;
|
|
|
|
import awais.instagrabber.repositories.requests.directmessages.BroadcastOptions.ThreadIdOrUserIds;
|
|
|
|
import awais.instagrabber.repositories.requests.directmessages.LinkBroadcastOptions;
|
|
|
|
import awais.instagrabber.repositories.requests.directmessages.PhotoBroadcastOptions;
|
2021-01-13 13:22:25 +00:00
|
|
|
import awais.instagrabber.repositories.requests.directmessages.ReactionBroadcastOptions;
|
2021-01-02 04:00:14 +00:00
|
|
|
import awais.instagrabber.repositories.requests.directmessages.StoryReplyBroadcastOptions;
|
2021-01-02 02:54:32 +00:00
|
|
|
import awais.instagrabber.repositories.requests.directmessages.TextBroadcastOptions;
|
|
|
|
import awais.instagrabber.repositories.requests.directmessages.VideoBroadcastOptions;
|
|
|
|
import awais.instagrabber.repositories.requests.directmessages.VoiceBroadcastOptions;
|
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectBadgeCount;
|
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectInboxResponse;
|
2021-01-15 18:10:17 +00:00
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectThread;
|
2021-01-02 02:54:32 +00:00
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectThreadBroadcastResponse;
|
2021-01-03 09:55:19 +00:00
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectThreadDetailsChangeResponse;
|
2021-01-02 02:54:32 +00:00
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectThreadFeedResponse;
|
2021-01-19 12:46:39 +00:00
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectThreadParticipantRequestsResponse;
|
2021-01-15 18:10:17 +00:00
|
|
|
import awais.instagrabber.repositories.responses.directmessages.RankedRecipientsResponse;
|
2021-01-02 02:54:32 +00:00
|
|
|
import awais.instagrabber.utils.TextUtils;
|
|
|
|
import awais.instagrabber.utils.Utils;
|
|
|
|
import retrofit2.Call;
|
|
|
|
import retrofit2.Retrofit;
|
|
|
|
|
|
|
|
public class DirectMessagesService extends BaseService {
|
|
|
|
private static final String TAG = "DiscoverService";
|
|
|
|
|
|
|
|
private static DirectMessagesService instance;
|
|
|
|
|
|
|
|
private final DirectMessagesRepository repository;
|
|
|
|
private final String csrfToken;
|
2021-01-07 12:36:33 +00:00
|
|
|
private final long userId;
|
2021-01-02 02:54:32 +00:00
|
|
|
private final String deviceUuid;
|
|
|
|
|
|
|
|
private DirectMessagesService(@NonNull final String csrfToken,
|
2021-01-07 12:36:33 +00:00
|
|
|
final long userId,
|
2021-01-02 02:54:32 +00:00
|
|
|
@NonNull final String deviceUuid) {
|
|
|
|
this.csrfToken = csrfToken;
|
|
|
|
this.userId = userId;
|
|
|
|
this.deviceUuid = deviceUuid;
|
|
|
|
final Retrofit retrofit = getRetrofitBuilder()
|
|
|
|
.baseUrl("https://i.instagram.com")
|
|
|
|
.build();
|
|
|
|
repository = retrofit.create(DirectMessagesRepository.class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getCsrfToken() {
|
|
|
|
return csrfToken;
|
|
|
|
}
|
|
|
|
|
2021-01-07 12:36:33 +00:00
|
|
|
public long getUserId() {
|
2021-01-02 02:54:32 +00:00
|
|
|
return userId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getDeviceUuid() {
|
|
|
|
return deviceUuid;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static DirectMessagesService getInstance(@NonNull final String csrfToken,
|
2021-01-07 12:36:33 +00:00
|
|
|
final long userId,
|
2021-01-02 02:54:32 +00:00
|
|
|
@NonNull final String deviceUuid) {
|
|
|
|
if (instance == null
|
|
|
|
|| !Objects.equals(instance.getCsrfToken(), csrfToken)
|
|
|
|
|| !Objects.equals(instance.getUserId(), userId)
|
|
|
|
|| !Objects.equals(instance.getDeviceUuid(), deviceUuid)) {
|
|
|
|
instance = new DirectMessagesService(csrfToken, userId, deviceUuid);
|
|
|
|
}
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectInboxResponse> fetchInbox(final String cursor,
|
|
|
|
final long seqId) {
|
|
|
|
final ImmutableMap.Builder<String, Object> queryMapBuilder = ImmutableMap.<String, Object>builder()
|
|
|
|
.put("visual_message_return_type", "unseen")
|
|
|
|
.put("thread_message_limit", 10)
|
|
|
|
.put("persistentBadging", true)
|
|
|
|
.put("limit", 10);
|
|
|
|
if (!TextUtils.isEmpty(cursor)) {
|
|
|
|
queryMapBuilder.put("cursor", cursor);
|
|
|
|
queryMapBuilder.put("direction", "older");
|
|
|
|
}
|
|
|
|
if (seqId != 0) {
|
|
|
|
queryMapBuilder.put("seq_id", seqId);
|
|
|
|
}
|
|
|
|
return repository.fetchInbox(queryMapBuilder.build());
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadFeedResponse> fetchThread(final String threadId,
|
|
|
|
final String cursor) {
|
|
|
|
final ImmutableMap.Builder<String, Object> queryMapBuilder = ImmutableMap.<String, Object>builder()
|
|
|
|
.put("visual_message_return_type", "unseen")
|
|
|
|
.put("limit", 10)
|
|
|
|
.put("direction", "older");
|
|
|
|
if (!TextUtils.isEmpty(cursor)) {
|
|
|
|
queryMapBuilder.put("cursor", cursor);
|
|
|
|
}
|
|
|
|
return repository.fetchThread(threadId, queryMapBuilder.build());
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectBadgeCount> fetchUnseenCount() {
|
|
|
|
return repository.fetchUnseenCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadBroadcastResponse> broadcastText(final String clientContext,
|
|
|
|
final ThreadIdOrUserIds threadIdOrUserIds,
|
2021-01-16 18:09:07 +00:00
|
|
|
final String text,
|
|
|
|
final String repliedToItemId,
|
|
|
|
final String repliedToClientContext) {
|
2021-01-02 02:54:32 +00:00
|
|
|
final List<String> urls = TextUtils.extractUrls(text);
|
|
|
|
if (!urls.isEmpty()) {
|
2021-01-16 18:09:07 +00:00
|
|
|
return broadcastLink(clientContext, threadIdOrUserIds, text, urls, repliedToItemId, repliedToClientContext);
|
2021-01-02 02:54:32 +00:00
|
|
|
}
|
2021-01-16 18:09:07 +00:00
|
|
|
final TextBroadcastOptions broadcastOptions = new TextBroadcastOptions(clientContext, threadIdOrUserIds, text);
|
|
|
|
broadcastOptions.setRepliedToItemId(repliedToItemId);
|
|
|
|
broadcastOptions.setRepliedToClientContext(repliedToClientContext);
|
|
|
|
return broadcast(broadcastOptions);
|
2021-01-02 02:54:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadBroadcastResponse> broadcastLink(final String clientContext,
|
|
|
|
final ThreadIdOrUserIds threadIdOrUserIds,
|
|
|
|
final String linkText,
|
2021-01-16 18:09:07 +00:00
|
|
|
final List<String> urls,
|
|
|
|
final String repliedToItemId,
|
|
|
|
final String repliedToClientContext) {
|
|
|
|
final LinkBroadcastOptions broadcastOptions = new LinkBroadcastOptions(clientContext, threadIdOrUserIds, linkText, urls);
|
|
|
|
broadcastOptions.setRepliedToItemId(repliedToItemId);
|
|
|
|
broadcastOptions.setRepliedToClientContext(repliedToClientContext);
|
|
|
|
return broadcast(broadcastOptions);
|
2021-01-02 02:54:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadBroadcastResponse> broadcastPhoto(final String clientContext,
|
|
|
|
final ThreadIdOrUserIds threadIdOrUserIds,
|
|
|
|
final String uploadId) {
|
|
|
|
return broadcast(new PhotoBroadcastOptions(clientContext, threadIdOrUserIds, true, uploadId));
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadBroadcastResponse> broadcastVideo(final String clientContext,
|
|
|
|
final ThreadIdOrUserIds threadIdOrUserIds,
|
|
|
|
final String uploadId,
|
|
|
|
final String videoResult,
|
|
|
|
final boolean sampled) {
|
|
|
|
return broadcast(new VideoBroadcastOptions(clientContext, threadIdOrUserIds, videoResult, uploadId, sampled));
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadBroadcastResponse> broadcastVoice(final String clientContext,
|
|
|
|
final ThreadIdOrUserIds threadIdOrUserIds,
|
|
|
|
final String uploadId,
|
|
|
|
final List<Float> waveform,
|
|
|
|
final int samplingFreq) {
|
|
|
|
return broadcast(new VoiceBroadcastOptions(clientContext, threadIdOrUserIds, uploadId, waveform, samplingFreq));
|
|
|
|
}
|
|
|
|
|
2021-01-02 04:00:14 +00:00
|
|
|
public Call<DirectThreadBroadcastResponse> broadcastStoryReply(final ThreadIdOrUserIds threadIdOrUserIds,
|
|
|
|
final String text,
|
2021-01-07 12:36:33 +00:00
|
|
|
final String mediaId,
|
|
|
|
final String reelId) throws UnsupportedEncodingException {
|
2021-01-02 04:00:14 +00:00
|
|
|
return broadcast(new StoryReplyBroadcastOptions(UUID.randomUUID().toString(), threadIdOrUserIds, text, mediaId, reelId));
|
|
|
|
}
|
|
|
|
|
2021-01-13 13:22:25 +00:00
|
|
|
public Call<DirectThreadBroadcastResponse> broadcastReaction(final String clientContext,
|
|
|
|
final ThreadIdOrUserIds threadIdOrUserIds,
|
|
|
|
final String itemId,
|
|
|
|
final String emoji,
|
|
|
|
final boolean delete) {
|
|
|
|
return broadcast(new ReactionBroadcastOptions(clientContext, threadIdOrUserIds, itemId, emoji, delete));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-01-02 02:54:32 +00:00
|
|
|
private Call<DirectThreadBroadcastResponse> broadcast(@NonNull final BroadcastOptions broadcastOptions) {
|
|
|
|
if (TextUtils.isEmpty(broadcastOptions.getClientContext())) {
|
|
|
|
throw new IllegalArgumentException("Broadcast requires a valid client context value");
|
|
|
|
}
|
|
|
|
final Map<String, Object> form = new HashMap<>();
|
|
|
|
if (!TextUtils.isEmpty(broadcastOptions.getThreadId())) {
|
|
|
|
form.put("thread_id", broadcastOptions.getThreadId());
|
|
|
|
} else {
|
|
|
|
form.put("recipient_users", new JSONArray(broadcastOptions.getUserIds()).toString());
|
|
|
|
}
|
|
|
|
form.put("_csrftoken", csrfToken);
|
|
|
|
form.put("_uid", userId);
|
|
|
|
form.put("__uuid", deviceUuid);
|
|
|
|
form.put("client_context", broadcastOptions.getClientContext());
|
|
|
|
form.put("mutation_token", broadcastOptions.getClientContext());
|
2021-01-16 18:09:07 +00:00
|
|
|
if (!TextUtils.isEmpty(broadcastOptions.getRepliedToItemId()) && !TextUtils.isEmpty(broadcastOptions.getRepliedToClientContext())) {
|
|
|
|
form.put("replied_to_item_id", broadcastOptions.getRepliedToItemId());
|
|
|
|
form.put("replied_to_client_context", broadcastOptions.getRepliedToClientContext());
|
|
|
|
}
|
2021-01-02 02:54:32 +00:00
|
|
|
form.putAll(broadcastOptions.getFormMap());
|
|
|
|
form.put("action", "send_item");
|
|
|
|
final Map<String, String> signedForm = Utils.sign(form);
|
|
|
|
return repository.broadcast(broadcastOptions.getItemType().getValue(), signedForm);
|
|
|
|
}
|
2021-01-03 09:55:19 +00:00
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> addUsers(final String threadId,
|
|
|
|
final Collection<Long> userIds) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid,
|
|
|
|
"user_ids", new JSONArray(userIds).toString()
|
|
|
|
);
|
|
|
|
return repository.addUsers(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<String> removeUsers(final String threadId,
|
|
|
|
final Collection<Long> userIds) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid,
|
|
|
|
"user_ids", new JSONArray(userIds).toString()
|
|
|
|
);
|
|
|
|
return repository.removeUsers(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> updateTitle(final String threadId,
|
|
|
|
final String title) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid,
|
|
|
|
"title", title
|
|
|
|
);
|
|
|
|
return repository.updateTitle(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<String> addAdmins(final String threadId,
|
|
|
|
final Collection<Long> userIds) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid,
|
|
|
|
"user_ids", new JSONArray(userIds).toString()
|
|
|
|
);
|
|
|
|
return repository.addAdmins(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<String> removeAdmins(final String threadId,
|
|
|
|
final Collection<Long> userIds) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid,
|
|
|
|
"user_ids", new JSONArray(userIds).toString()
|
|
|
|
);
|
|
|
|
return repository.removeAdmins(threadId, form);
|
|
|
|
}
|
2021-01-14 18:28:30 +00:00
|
|
|
|
|
|
|
public Call<String> deleteItem(final String threadId,
|
|
|
|
final String itemId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.deleteItem(threadId, itemId, form);
|
|
|
|
}
|
2021-01-15 18:10:17 +00:00
|
|
|
|
|
|
|
public Call<RankedRecipientsResponse> rankedRecipients(@Nullable final String mode,
|
|
|
|
@Nullable final Boolean showThreads,
|
|
|
|
@Nullable final String query) {
|
|
|
|
// String correctedMode = mode;
|
|
|
|
// if (TextUtils.isEmpty(mode) || (!mode.equals("raven") && !mode.equals("reshare"))) {
|
|
|
|
// correctedMode = "raven";
|
|
|
|
// }
|
|
|
|
final ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
|
|
|
|
if (mode != null) {
|
|
|
|
builder.put("mode", mode);
|
|
|
|
}
|
|
|
|
if (query != null) {
|
|
|
|
builder.put("query", query);
|
|
|
|
}
|
|
|
|
if (showThreads != null) {
|
|
|
|
builder.put("showThreads", String.valueOf(showThreads));
|
|
|
|
}
|
|
|
|
return repository.rankedRecipients(builder.build());
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadBroadcastResponse> forward(@NonNull final String toThreadId,
|
|
|
|
@NonNull final String itemType,
|
|
|
|
@NonNull final String fromThreadId,
|
|
|
|
@NonNull final String itemId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"action", "forward_item",
|
|
|
|
"thread_id", toThreadId,
|
|
|
|
"item_type", itemType,
|
|
|
|
"forwarded_from_thread_id", fromThreadId,
|
|
|
|
"forwarded_from_thread_item_id", itemId
|
|
|
|
);
|
|
|
|
return repository.forward(form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThread> createThread(@NonNull final List<Long> userIds,
|
|
|
|
@Nullable final String threadTitle) {
|
|
|
|
final List<String> userIdStringList = userIds.stream()
|
|
|
|
.filter(Objects::nonNull)
|
|
|
|
.map(String::valueOf)
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
final ImmutableMap.Builder<String, Object> formBuilder = ImmutableMap.<String, Object>builder()
|
|
|
|
.put("_csrftoken", csrfToken)
|
|
|
|
.put("_uuid", deviceUuid)
|
|
|
|
.put("_uid", userId)
|
|
|
|
.put("recipient_users", new JSONArray(userIdStringList).toString());
|
|
|
|
if (threadTitle != null) {
|
|
|
|
formBuilder.put("thread_title", threadTitle);
|
|
|
|
}
|
|
|
|
final Map<String, String> signedForm = Utils.sign(formBuilder.build());
|
|
|
|
return repository.createThread(signedForm);
|
|
|
|
}
|
2021-01-17 08:02:43 +00:00
|
|
|
|
|
|
|
public Call<String> mute(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.mute(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<String> unmute(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.unmute(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<String> muteMentions(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.muteMentions(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<String> unmuteMentions(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.unmuteMentions(threadId, form);
|
|
|
|
}
|
2021-01-19 12:46:39 +00:00
|
|
|
|
|
|
|
public Call<DirectThreadParticipantRequestsResponse> participantRequests(@NonNull final String threadId,
|
|
|
|
final int pageSize,
|
|
|
|
@Nullable final String cursor) {
|
|
|
|
return repository.participantRequests(threadId, pageSize, cursor);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> approveParticipantRequests(@NonNull final String threadId,
|
|
|
|
@NonNull final List<Long> userIds) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid,
|
|
|
|
"user_ids", new JSONArray(userIds).toString()
|
|
|
|
// , "share_join_chat_story", String.valueOf(true)
|
|
|
|
);
|
|
|
|
return repository.approveParticipantRequests(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> declineParticipantRequests(@NonNull final String threadId,
|
|
|
|
@NonNull final List<Long> userIds) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid,
|
|
|
|
"user_ids", new JSONArray(userIds).toString()
|
|
|
|
);
|
|
|
|
return repository.declineParticipantRequests(threadId, form);
|
|
|
|
}
|
2021-01-19 13:43:51 +00:00
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> approvalRequired(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.approvalRequired(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> approvalNotRequired(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.approvalNotRequired(threadId, form);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> leave(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.leave(threadId, form);
|
|
|
|
}
|
2021-01-19 17:24:49 +00:00
|
|
|
|
|
|
|
public Call<DirectThreadDetailsChangeResponse> end(@NonNull final String threadId) {
|
|
|
|
final ImmutableMap<String, String> form = ImmutableMap.of(
|
|
|
|
"_csrftoken", csrfToken,
|
|
|
|
"_uuid", deviceUuid
|
|
|
|
);
|
|
|
|
return repository.end(threadId, form);
|
|
|
|
}
|
2021-01-02 02:54:32 +00:00
|
|
|
}
|