commit 739d82c43844686f19c7f933b39abc63c710ffdf
parent a0f79813e63a52eec8d8b843df2d7c76b0993851
Author: Jacki <jacki@thejackimonster.de>
Date: Fri, 13 Dec 2024 05:35:42 +0100
Make adjustments for compatibility with service 0.6 changes
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat:
5 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/include/gnunet/gnunet_chat_lib.h b/include/gnunet/gnunet_chat_lib.h
@@ -55,7 +55,7 @@ struct GNUNET_CONFIGURATION_Handle;
* the #GNUNET_MESSENGER_VERSION of the GNUnet Messenger
* service while the patch version is independent.
*/
-#define GNUNET_CHAT_VERSION 0x000000050001L
+#define GNUNET_CHAT_VERSION 0x000000060000L
#define GNUNET_CHAT_VERSION_MAJOR ((GNUNET_CHAT_VERSION >> 32L) & 0xFFFFL)
#define GNUNET_CHAT_VERSION_MINOR ((GNUNET_CHAT_VERSION >> 16L) & 0xFFFFL)
diff --git a/src/gnunet_chat_handle_intern.c b/src/gnunet_chat_handle_intern.c
@@ -742,7 +742,7 @@ on_handle_message_callback(void *cls)
struct GNUNET_TIME_Relative task_delay;
switch (message->msg->header.kind)
{
- case GNUNET_MESSENGER_KIND_DELETE:
+ case GNUNET_MESSENGER_KIND_DELETION:
{
const struct GNUNET_TIME_Relative delay = GNUNET_TIME_relative_ntoh(
message->msg->body.deletion.delay
@@ -927,9 +927,9 @@ skip_msg_handing:
);
break;
}
- case GNUNET_MESSENGER_KIND_SUBSCRIBE:
+ case GNUNET_MESSENGER_KIND_SUBSCRIBTION:
{
- const struct GNUNET_ShortHashCode *sid = &(message->msg->body.subscribe.discourse);
+ const struct GNUNET_ShortHashCode *sid = &(message->msg->body.subscribtion.discourse);
struct GNUNET_CHAT_Discourse *discourse = GNUNET_CONTAINER_multishortmap_get(
context->discourses, sid
);
@@ -951,19 +951,19 @@ skip_msg_handing:
enum GNUNET_GenericReturnValue subscribtion_update = GNUNET_NO;
- if (GNUNET_MESSENGER_FLAG_SUBSCRIPTION_UNSUBSCRIBE & message->msg->body.subscribe.flags)
+ if (GNUNET_MESSENGER_FLAG_SUBSCRIPTION_UNSUBSCRIBE & message->msg->body.subscribtion.flags)
discourse_unsubscribe(
discourse,
contact,
GNUNET_TIME_absolute_ntoh(message->msg->header.timestamp),
- GNUNET_TIME_relative_ntoh(message->msg->body.subscribe.time)
+ GNUNET_TIME_relative_ntoh(message->msg->body.subscribtion.time)
);
else
subscribtion_update = discourse_subscribe(
discourse,
contact,
GNUNET_TIME_absolute_ntoh(message->msg->header.timestamp),
- GNUNET_TIME_relative_ntoh(message->msg->body.subscribe.time)
+ GNUNET_TIME_relative_ntoh(message->msg->body.subscribtion.time)
);
if (GNUNET_YES == subscribtion_update)
@@ -1095,7 +1095,7 @@ on_handle_message (void *cls,
handle_callback:
switch (msg->header.kind)
{
- case GNUNET_MESSENGER_KIND_DELETE:
+ case GNUNET_MESSENGER_KIND_DELETION:
{
dependency = &(msg->body.deletion.hash);
break;
diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c
@@ -1977,9 +1977,9 @@ GNUNET_CHAT_context_open_discourse (struct GNUNET_CHAT_Context *context,
struct GNUNET_MESSENGER_Message msg;
memset(&msg, 0, sizeof(msg));
- msg.header.kind = GNUNET_MESSENGER_KIND_SUBSCRIBE;
+ msg.header.kind = GNUNET_MESSENGER_KIND_SUBSCRIBTION;
GNUNET_memcpy(
- &(msg.body.subscribe.discourse),
+ &(msg.body.subscribtion.discourse),
&sid,
sizeof(struct GNUNET_ShortHashCode)
);
@@ -1988,8 +1988,8 @@ GNUNET_CHAT_context_open_discourse (struct GNUNET_CHAT_Context *context,
GNUNET_TIME_relative_get_second_(), 10
);
- msg.body.subscribe.time = GNUNET_TIME_relative_hton(subscribtion_time);
- msg.body.subscribe.flags = GNUNET_MESSENGER_FLAG_SUBSCRIPTION_KEEP_ALIVE;
+ msg.body.subscribtion.time = GNUNET_TIME_relative_hton(subscribtion_time);
+ msg.body.subscribtion.flags = GNUNET_MESSENGER_FLAG_SUBSCRIPTION_KEEP_ALIVE;
GNUNET_MESSENGER_send_message(
context->room,
@@ -2356,10 +2356,10 @@ GNUNET_CHAT_message_get_discourse (const struct GNUNET_CHAT_Message *message)
struct GNUNET_CHAT_Discourse *discourse;
- if (GNUNET_MESSENGER_KIND_SUBSCRIBE == message->msg->header.kind)
+ if (GNUNET_MESSENGER_KIND_SUBSCRIBTION == message->msg->header.kind)
discourse = GNUNET_CONTAINER_multishortmap_get(
message->context->discourses,
- &(message->msg->body.subscribe.discourse));
+ &(message->msg->body.subscribtion.discourse));
else if (GNUNET_MESSENGER_KIND_TALK == message->msg->header.kind)
discourse = GNUNET_CONTAINER_multishortmap_get(
message->context->discourses,
@@ -2382,7 +2382,7 @@ GNUNET_CHAT_message_get_target (const struct GNUNET_CHAT_Message *message)
struct GNUNET_CHAT_Message *target;
- if (GNUNET_MESSENGER_KIND_DELETE == message->msg->header.kind)
+ if (GNUNET_MESSENGER_KIND_DELETION == message->msg->header.kind)
target = GNUNET_CONTAINER_multihashmap_get(
message->context->messages, &(message->msg->body.deletion.hash));
else if (GNUNET_MESSENGER_KIND_TAG == message->msg->header.kind)
@@ -3044,15 +3044,15 @@ GNUNET_CHAT_discourse_close (struct GNUNET_CHAT_Discourse *discourse)
struct GNUNET_MESSENGER_Message msg;
memset(&msg, 0, sizeof(msg));
- msg.header.kind = GNUNET_MESSENGER_KIND_SUBSCRIBE;
+ msg.header.kind = GNUNET_MESSENGER_KIND_SUBSCRIBTION;
util_shorthash_from_discourse_id(
&(discourse->id),
- &(msg.body.subscribe.discourse)
+ &(msg.body.subscribtion.discourse)
);
- msg.body.subscribe.time = GNUNET_TIME_relative_hton(GNUNET_TIME_relative_get_zero_());
- msg.body.subscribe.flags = GNUNET_MESSENGER_FLAG_SUBSCRIPTION_UNSUBSCRIBE;
+ msg.body.subscribtion.time = GNUNET_TIME_relative_hton(GNUNET_TIME_relative_get_zero_());
+ msg.body.subscribtion.flags = GNUNET_MESSENGER_FLAG_SUBSCRIPTION_UNSUBSCRIBE;
GNUNET_MESSENGER_send_message(
discourse->context->room,
diff --git a/src/gnunet_chat_util.c b/src/gnunet_chat_util.c
@@ -483,13 +483,13 @@ util_message_kind_from_kind (enum GNUNET_MESSENGER_MessageKind kind)
return GNUNET_CHAT_KIND_TEXT;
case GNUNET_MESSENGER_KIND_FILE:
return GNUNET_CHAT_KIND_FILE;
- case GNUNET_MESSENGER_KIND_DELETE:
+ case GNUNET_MESSENGER_KIND_DELETION:
return GNUNET_CHAT_KIND_DELETION;
case GNUNET_MESSENGER_KIND_TICKET:
return GNUNET_CHAT_KIND_SHARED_ATTRIBUTES;
case GNUNET_MESSENGER_KIND_TAG:
return GNUNET_CHAT_KIND_TAG;
- case GNUNET_MESSENGER_KIND_SUBSCRIBE:
+ case GNUNET_MESSENGER_KIND_SUBSCRIBTION:
return GNUNET_CHAT_KIND_DISCOURSE;
case GNUNET_MESSENGER_KIND_TALK:
return GNUNET_CHAT_KIND_DATA;
diff --git a/tools/gnunet_messenger_uml.c b/tools/gnunet_messenger_uml.c
@@ -267,11 +267,26 @@ message_callback (void *cls,
if (GNUNET_MESSENGER_KIND_REQUEST == message->header.kind)
add_link(tool, hash, &(message->body.request.hash), true);
- if (GNUNET_MESSENGER_KIND_DELETE == message->header.kind)
+ if (GNUNET_MESSENGER_KIND_DELETION == message->header.kind)
add_link(tool, hash, &(message->body.deletion.hash), true);
if (GNUNET_MESSENGER_KIND_TAG == message->header.kind)
add_link(tool, hash, &(message->body.tag.hash), true);
+
+ if (GNUNET_MESSENGER_KIND_APPEAL == message->header.kind)
+ add_link(tool, hash, &(message->body.appeal.event), true);
+
+ if (GNUNET_MESSENGER_KIND_ACCESS == message->header.kind)
+ add_link(tool, hash, &(message->body.access.event), true);
+
+ if (GNUNET_MESSENGER_KIND_GROUP == message->header.kind)
+ {
+ add_link(tool, hash, &(message->body.group.initiator), true);
+ add_link(tool, hash, &(message->body.group.partner), true);
+ }
+
+ if (GNUNET_MESSENGER_KIND_AUTHORIZATION == message->header.kind)
+ add_link(tool, hash, &(message->body.authorization.event), true);
}
add_link(tool, hash, &(message->header.previous), false);