summaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_room.c
diff options
context:
space:
mode:
authorTheJackiMonster <thejackimonster@gmail.com>2021-11-19 20:18:07 +0100
committerTheJackiMonster <thejackimonster@gmail.com>2021-11-19 20:18:07 +0100
commit020bc56abfb923fa2f4c770be71eb8b26adfbb89 (patch)
tree7c4f8e8d6bd6fc97041fa4a1de1a0f8d3039e163 /src/messenger/gnunet-service-messenger_room.c
parent7e5fdf07515b4a921de564adc67b2808e6ad28e2 (diff)
-fix missing own member session during room opening
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/messenger/gnunet-service-messenger_room.c')
-rw-r--r--src/messenger/gnunet-service-messenger_room.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/messenger/gnunet-service-messenger_room.c b/src/messenger/gnunet-service-messenger_room.c
index 920abb10e..77657591e 100644
--- a/src/messenger/gnunet-service-messenger_room.c
+++ b/src/messenger/gnunet-service-messenger_room.c
@@ -212,7 +212,9 @@ join_room (struct GNUNET_MESSENGER_SrvRoom *room,
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Joining room: %s (%s)\n", GNUNET_h2s (get_room_key (room)),
GNUNET_sh2s (get_member_id(member)));
- if (GNUNET_OK != change_handle_member_id (handle, get_room_key(room), get_member_id(member)))
+ const struct GNUNET_ShortHashCode *member_id = get_member_id(member);
+
+ if (GNUNET_OK != change_handle_member_id (handle, get_room_key(room), member_id))
return GNUNET_NO;
struct GNUNET_MESSENGER_Message *message = create_message_join (get_handle_ego (handle));
@@ -224,6 +226,7 @@ join_room (struct GNUNET_MESSENGER_SrvRoom *room,
return GNUNET_NO;
}
+ GNUNET_memcpy(&(message->header.sender_id), member_id, sizeof(*member_id));
return send_room_message (room, handle, message);
}
@@ -262,7 +265,7 @@ notify_about_members (struct GNUNET_MESSENGER_MemberNotify *notify,
const struct GNUNET_MESSENGER_Message *message = get_store_message(message_store, &(element->hash));
if (message)
- notify_handle_message (notify->handle, get_room_key(notify->room), session, message, &(element->hash));
+ notify_handle_message (notify->handle, notify->room, session, message, &(element->hash));
}
}
@@ -377,7 +380,9 @@ open_room (struct GNUNET_MESSENGER_SrvRoom *room,
}
exit_open_room:
- return (room->port ? send_room_message (room, handle, create_message_peer (room->service)) : GNUNET_NO);
+ struct GNUNET_MESSENGER_Message *peer_msg = create_message_peer (room->service);
+ GNUNET_memcpy(&(peer_msg->header.sender_id), member_id, sizeof(*member_id));
+ return (room->port ? send_room_message (room, handle, peer_msg) : GNUNET_NO);
}
int