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

drive handshake by contact_id instead of chat_id, which is ambiguous in Chat-Group-Member-Added

This commit is contained in:
B. Petersen 2018-05-01 00:54:33 +02:00
parent 4ae0ab32e6
commit 842daceaa1
3 changed files with 6 additions and 6 deletions

View file

@ -171,7 +171,7 @@ void mrmailbox_free_ongoing (mrmailbox_t*);
#define MR_IS_HANDSHAKE_STOP_NORMAL_PROCESSING 2
int mrmailbox_is_securejoin_handshake__ (mrmailbox_t*, mrmimeparser_t*); /* must be called from lock */
void mrmailbox_handle_securejoin_handshake(mrmailbox_t*, mrmimeparser_t*, uint32_t chat_id); /* must not be called from lock */
void mrmailbox_handle_securejoin_handshake(mrmailbox_t*, mrmimeparser_t*, uint32_t contact_id); /* must not be called from lock */
#define OPENPGP4FPR_SCHEME "OPENPGP4FPR:" /* yes: uppercase */

View file

@ -1485,7 +1485,7 @@ cleanup:
if( db_locked ) { mrsqlite3_unlock(mailbox->m_sql); }
if( is_handshake_message ) {
mrmailbox_handle_securejoin_handshake(mailbox, mime_parser, chat_id); /* must be called after unlocking before deletion of mime_parser */
mrmailbox_handle_securejoin_handshake(mailbox, mime_parser, from_id); /* must be called after unlocking before deletion of mime_parser */
}
else if( mime_parser->m_e2ee_helper->m_degrade_event ) {
mailbox->m_cb(mailbox, MR_EVENT_MSGS_CHANGED, chat_id, degrade_msg_id);

View file

@ -561,7 +561,7 @@ int mrmailbox_is_securejoin_handshake__(mrmailbox_t* mailbox, mrmimeparser_t* mi
}
void mrmailbox_handle_securejoin_handshake(mrmailbox_t* mailbox, mrmimeparser_t* mimeparser, uint32_t contact_chat_id)
void mrmailbox_handle_securejoin_handshake(mrmailbox_t* mailbox, mrmimeparser_t* mimeparser, uint32_t contact_id)
{
int locked = 0;
#define LOCK mrsqlite3_lock (mailbox->m_sql); locked = 1;
@ -571,10 +571,10 @@ void mrmailbox_handle_securejoin_handshake(mrmailbox_t* mailbox, mrmimeparser_t*
char* scanned_fingerprint_of_alice = NULL;
char* auth = NULL;
char* own_fingerprint = NULL;
uint32_t contact_id = 0;
uint32_t contact_chat_id = 0;
char* grpid = NULL;
if( mailbox == NULL || mimeparser == NULL || contact_chat_id <= MR_CHAT_ID_LAST_SPECIAL ) {
if( mailbox == NULL || mimeparser == NULL || contact_id <= MR_CONTACT_ID_LAST_SPECIAL ) {
goto cleanup;
}
@ -584,7 +584,7 @@ void mrmailbox_handle_securejoin_handshake(mrmailbox_t* mailbox, mrmimeparser_t*
mrmailbox_log_info(mailbox, 0, ">>>>>>>>>>>>>>>>>>>>>>>>> secure-join message '%s' received", step);
join_vg = (strncmp(step, "vg-", 3)==0);
contact_id = chat_id_2_contact_id(mailbox, contact_chat_id);
mrmailbox_lookup_real_nchat_by_contact_id__(mailbox, contact_id, &contact_chat_id, NULL);
if( strcmp(step, "vg-request")==0 || strcmp(step, "vc-request")==0 )
{