mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
abort contect requeste on archive/delete
This commit is contained in:
@@ -183,6 +183,16 @@ class ConversationListAdapter extends RecyclerView.Adapter {
|
||||
this.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
int getDeaddropContactId()
|
||||
{
|
||||
for (int i = 0; i < dcChatlist.getCnt(); i++) {
|
||||
if (dcChatlist.getChatId(i) == DcChat.DC_CHAT_ID_DEADDROP) {
|
||||
return dcContext.getMsg(dcChatlist.getMsgId(i)).getFromId();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
interface ItemClickListener {
|
||||
void onItemClick(ConversationListItem item);
|
||||
void onItemLongClick(ConversationListItem item);
|
||||
|
||||
@@ -244,7 +244,12 @@ public class ConversationListFragment extends Fragment
|
||||
@Override
|
||||
protected void executeAction(@Nullable Void parameter) {
|
||||
for (long threadId : selectedConversations) {
|
||||
dcContext.archiveChat((int)threadId, !archive? 1 : 0);
|
||||
if (threadId==DcChat.DC_CHAT_ID_DEADDROP) {
|
||||
dcContext.marknoticedContact(getListAdapter().getDeaddropContactId());
|
||||
}
|
||||
else {
|
||||
dcContext.archiveChat((int)threadId, !archive? 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +290,12 @@ public class ConversationListFragment extends Fragment
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
for (long threadId : selectedConversations) {
|
||||
dcContext.deleteChat((int)threadId);
|
||||
if (threadId==DcChat.DC_CHAT_ID_DEADDROP) {
|
||||
dcContext.marknoticedContact(getListAdapter().getDeaddropContactId());
|
||||
}
|
||||
else {
|
||||
dcContext.deleteChat((int) threadId);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user