commit a7308b22bf24131c5a0bf715e4f79e375e4bcfa2
parent 9cb19e10c1912fa3140098e86763ecd042997d03
Author: TheJackiMonster <thejackimonster@gmail.com>
Date: Tue, 21 Dec 2021 00:32:18 +0100
Fixed contexts to re-check for being contact related when unknown type
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat:
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/gnunet_chat_lib.h b/include/gnunet_chat_lib.h
@@ -517,7 +517,7 @@ GNUNET_CHAT_group_get_user_pointer (const struct GNUNET_CHAT_Group *group);
* @param[in,out] contact Contact
*/
void
-GNUNET_CHAT_group_invite_contact (struct GNUNET_CHAT_Group *group,
+GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group,
struct GNUNET_CHAT_Contact *contact);
/**
diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c
@@ -221,7 +221,9 @@ handle_request_context_by_room (struct GNUNET_CHAT_Handle *handle,
struct GNUNET_CHAT_CheckHandleRoomMembers check;
- if (context)
+ if ((context) && (context->type == GNUNET_CHAT_CONTEXT_TYPE_UNKNOWN))
+ goto check_type;
+ else if (context)
return GNUNET_OK;
context = context_create_from_room(handle, room);
@@ -238,6 +240,7 @@ handle_request_context_by_room (struct GNUNET_CHAT_Handle *handle,
if (GNUNET_CHAT_CONTEXT_TYPE_GROUP == context->type)
goto setup_group;
+check_type:
check.ignore_key = GNUNET_MESSENGER_get_key(handle->messenger);
check.contact = NULL;
diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c
@@ -410,7 +410,7 @@ GNUNET_CHAT_group_get_user_pointer (const struct GNUNET_CHAT_Group *group)
void
-GNUNET_CHAT_group_invite_contact (struct GNUNET_CHAT_Group *group,
+GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group,
struct GNUNET_CHAT_Contact *contact)
{
if ((!group) || (!contact))