aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2021-12-21 00:32:18 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2021-12-21 00:32:18 +0100
commita7308b22bf24131c5a0bf715e4f79e375e4bcfa2 (patch)
tree588700e7142966008f329caf8f871eea65ad9988
parent9cb19e10c1912fa3140098e86763ecd042997d03 (diff)
downloadlibgnunetchat-a7308b22bf24131c5a0bf715e4f79e375e4bcfa2.tar.gz
libgnunetchat-a7308b22bf24131c5a0bf715e4f79e375e4bcfa2.zip
Fixed contexts to re-check for being contact related when unknown type
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r--include/gnunet_chat_lib.h2
-rw-r--r--src/gnunet_chat_handle.c5
-rw-r--r--src/gnunet_chat_lib.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/include/gnunet_chat_lib.h b/include/gnunet_chat_lib.h
index aa9b456..cc08662 100644
--- 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);
517 * @param[in,out] contact Contact 517 * @param[in,out] contact Contact
518 */ 518 */
519void 519void
520GNUNET_CHAT_group_invite_contact (struct GNUNET_CHAT_Group *group, 520GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group,
521 struct GNUNET_CHAT_Contact *contact); 521 struct GNUNET_CHAT_Contact *contact);
522 522
523/** 523/**
diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c
index 0a0b743..1456acb 100644
--- 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,
221 221
222 struct GNUNET_CHAT_CheckHandleRoomMembers check; 222 struct GNUNET_CHAT_CheckHandleRoomMembers check;
223 223
224 if (context) 224 if ((context) && (context->type == GNUNET_CHAT_CONTEXT_TYPE_UNKNOWN))
225 goto check_type;
226 else if (context)
225 return GNUNET_OK; 227 return GNUNET_OK;
226 228
227 context = context_create_from_room(handle, room); 229 context = context_create_from_room(handle, room);
@@ -238,6 +240,7 @@ handle_request_context_by_room (struct GNUNET_CHAT_Handle *handle,
238 if (GNUNET_CHAT_CONTEXT_TYPE_GROUP == context->type) 240 if (GNUNET_CHAT_CONTEXT_TYPE_GROUP == context->type)
239 goto setup_group; 241 goto setup_group;
240 242
243check_type:
241 check.ignore_key = GNUNET_MESSENGER_get_key(handle->messenger); 244 check.ignore_key = GNUNET_MESSENGER_get_key(handle->messenger);
242 check.contact = NULL; 245 check.contact = NULL;
243 246
diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c
index 87692ec..0e86499 100644
--- 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)
410 410
411 411
412void 412void
413GNUNET_CHAT_group_invite_contact (struct GNUNET_CHAT_Group *group, 413GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group,
414 struct GNUNET_CHAT_Contact *contact) 414 struct GNUNET_CHAT_Contact *contact)
415{ 415{
416 if ((!group) || (!contact)) 416 if ((!group) || (!contact))