From 77bbded42c50c6d18b4389b0f3672b36e30f86fa Mon Sep 17 00:00:00 2001 From: Jacki Date: Wed, 10 Apr 2024 02:14:28 +0200 Subject: Implement functionality for attribute and ticket usage Signed-off-by: Jacki --- include/gnunet/gnunet_chat_lib.h | 49 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/gnunet/gnunet_chat_lib.h b/include/gnunet/gnunet_chat_lib.h index 574f661..3958dba 100644 --- a/include/gnunet/gnunet_chat_lib.h +++ b/include/gnunet/gnunet_chat_lib.h @@ -195,7 +195,7 @@ typedef enum GNUNET_GenericReturnValue * Iterator over attributes of a specific chat handle. * * @param[in,out] cls Closure from #GNUNET_CHAT_get_attributes - * @param[in] handle Chat handle + * @param[in,out] handle Chat handle * @param[in] name Attribute name * @param[in] value Attribute value * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. @@ -516,11 +516,11 @@ void GNUNET_CHAT_set_attribute (struct GNUNET_CHAT_Handle *handle, const char *name, const char *value, - const struct GNUNET_TIME_Relative *expires); + struct GNUNET_TIME_Relative expires); /** - * Deletes an attribute of a chat handle for related communication under a given - * name. + * Deletes an attribute of a chat handle for related communication + * under a given name. * * @param[in,out] handle Chat handle * @param[in] name Attribute name @@ -542,6 +542,47 @@ GNUNET_CHAT_get_attributes (struct GNUNET_CHAT_Handle *handle, GNUNET_CHAT_AttributeCallback callback, void *cls); +/** + * Share an attribute of a chat handle under a given name + * with a specific chat contact. + * + * @param[in,out] handle Chat handle + * @param[in,out] contact Chat contact + * @param[in] name Attribute name + */ +void +GNUNET_CHAT_share_attribute_with (struct GNUNET_CHAT_Handle *handle, + struct GNUNET_CHAT_Contact *contact, + const char *name); + +/** + * Unshare an attribute of a chat handle under a given name + * from a specific chat contact. + * + * @param[in,out] handle Chat handle + * @param[in,out] contact Chat contact + * @param[in] name Attribute name + */ +void +GNUNET_CHAT_unshare_attribute_from (struct GNUNET_CHAT_Handle *handle, + struct GNUNET_CHAT_Contact *contact, + const char *name); + +/** + * Calls an optional callback for each attribute of a given chat + * handle shared with a specific chat contact. + * + * @param[in,out] handle Chat handle + * @param[in] contact Chat contact + * @param[in] callback Callback for attribute iteration (optional) + * @param[in,out] cls Closure for attribute iteration (optional) + */ +void +GNUNET_CHAT_get_shared_attributes (struct GNUNET_CHAT_Handle *handle, + const struct GNUNET_CHAT_Contact *contact, + GNUNET_CHAT_ContactAttributeCallback callback, + void *cls); + /** * Convert an UTF-8 String to a chat URI which will be newly allocated. * -- cgit v1.2.3