1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-05 10:39:27 +02:00

tweak showing contact request

This commit is contained in:
B. Petersen 2019-02-26 21:11:56 +01:00
parent b50cd54121
commit c4091b9af1
No known key found for this signature in database
GPG key ID: 3B88E92DEA8E9AFC

View file

@ -1268,15 +1268,13 @@ void dc_receive_imf(dc_context_t* context, const char* imf_raw_not_terminated, s
chat_id = DC_CHAT_ID_TRASH; chat_id = DC_CHAT_ID_TRASH;
} }
/* degrade state for unknown senders and non-delta messages /* if the chat_id is blocked,
(the latter may be removed if we run into spam problems, currently this is fine) for unknown senders and non-delta messages set the state to NOTICED
(noticed messages do count as being unread; therefore, the deaddrop will not popup in the chatlist) */ to not result in a contact request (this would require the state FRESH) */
if (chat_id_blocked && state==DC_STATE_IN_FRESH) if (chat_id_blocked && state==DC_STATE_IN_FRESH)
{ {
if (incoming_origin < DC_ORIGIN_MIN_VERIFIED if (incoming_origin < DC_ORIGIN_MIN_VERIFIED
&& mime_parser->is_send_by_messenger == 0 && msgrmsg==0) {
&& !dc_is_mvbox(context, server_folder))
{
state = DC_STATE_IN_NOTICED; state = DC_STATE_IN_NOTICED;
} }
} }
@ -1299,7 +1297,7 @@ void dc_receive_imf(dc_context_t* context, const char* imf_raw_not_terminated, s
if (chat_id==0) if (chat_id==0)
{ {
int create_blocked = (mime_parser->is_send_by_messenger && !dc_is_contact_blocked(context, to_id))? DC_CHAT_NOT_BLOCKED : DC_CHAT_DEADDROP_BLOCKED; int create_blocked = (msgrmsg && !dc_is_contact_blocked(context, to_id))? DC_CHAT_NOT_BLOCKED : DC_CHAT_DEADDROP_BLOCKED;
dc_create_or_lookup_nchat_by_contact_id(context, to_id, create_blocked, &chat_id, &chat_id_blocked); dc_create_or_lookup_nchat_by_contact_id(context, to_id, create_blocked, &chat_id, &chat_id_blocked);
if (chat_id && chat_id_blocked && !create_blocked) { if (chat_id && chat_id_blocked && !create_blocked) {
dc_unblock_chat(context, chat_id); dc_unblock_chat(context, chat_id);