From e12f347ac1f43f268b23cc90be30184a44ca3ab3 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 20 Apr 2018 23:34:02 +0200 Subject: [PATCH] prepare createion of verified groups --- cmdline/cmdline.c | 2 +- src/mrmailbox.c | 5 +++-- src/mrmailbox.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmdline/cmdline.c b/cmdline/cmdline.c index 50f7b067..4a592d15 100644 --- a/cmdline/cmdline.c +++ b/cmdline/cmdline.c @@ -814,7 +814,7 @@ char* mrmailbox_cmdline(mrmailbox_t* mailbox, const char* cmdline) else if( strcmp(cmd, "creategroup")==0 ) { if( arg1 ) { - int chat_id = mrmailbox_create_group_chat(mailbox, arg1); + int chat_id = mrmailbox_create_group_chat(mailbox, 0, arg1); ret = chat_id!=0? mr_mprintf("Groupchat#%lu created successfully.", chat_id) : COMMAND_FAILED; } else { diff --git a/src/mrmailbox.c b/src/mrmailbox.c index 1f15a67c..d1708344 100644 --- a/src/mrmailbox.c +++ b/src/mrmailbox.c @@ -2962,14 +2962,15 @@ int mrmailbox_add_contact_to_chat__(mrmailbox_t* mailbox, uint32_t chat_id, uint * @memberof mrmailbox_t * * @param mailbox Mailbox object as created by mrmailbox_new(). - * + * @param verified If set to 1 the function creates a secure verfied group. + * Only secure-verified members are allowd in these groups and end-to-end-encryption is always enabled. * @param chat_name The name of the group chat to create. * The name may be changed later using mrmailbox_set_chat_name(). * To find out the name of a group later, see mrchat_t::m_name * * @return The chat ID of the new group chat, 0 on errors. */ -uint32_t mrmailbox_create_group_chat(mrmailbox_t* mailbox, const char* chat_name) +uint32_t mrmailbox_create_group_chat(mrmailbox_t* mailbox, int verified, const char* chat_name) { uint32_t chat_id = 0; int locked = 0; diff --git a/src/mrmailbox.h b/src/mrmailbox.h index 37b0138d..99b92f55 100644 --- a/src/mrmailbox.h +++ b/src/mrmailbox.h @@ -257,7 +257,7 @@ mrchat_t* mrmailbox_get_chat (mrmailbox_t*, uint32_t chat_id); /* Handle group chats */ -uint32_t mrmailbox_create_group_chat (mrmailbox_t*, const char* name); +uint32_t mrmailbox_create_group_chat (mrmailbox_t*, int verified, const char* name); int mrmailbox_is_contact_in_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id); int mrmailbox_add_contact_to_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id); int mrmailbox_remove_contact_from_chat (mrmailbox_t*, uint32_t chat_id, uint32_t contact_id);