diff options
author | Jacki <jacki@thejackimonster.de> | 2024-01-05 00:37:18 +0100 |
---|---|---|
committer | Jacki <jacki@thejackimonster.de> | 2024-01-05 00:37:18 +0100 |
commit | 2825c2b3391e1f65d58b6754ea603b83fd6959f1 (patch) | |
tree | 6190b440d417e48ce8b495c12a62882f8d30d11c /include | |
parent | c11052c64b020d3913014b6065c9b16a8cac4547 (diff) | |
download | libgnunetchat-2825c2b3391e1f65d58b6754ea603b83fd6959f1.tar.gz libgnunetchat-2825c2b3391e1f65d58b6754ea603b83fd6959f1.zip |
Implement functions to consume tickets from contacts
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/gnunet/gnunet_chat_lib.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/gnunet/gnunet_chat_lib.h b/include/gnunet/gnunet_chat_lib.h index 12bf244..0a2fd7c 100644 --- a/include/gnunet/gnunet_chat_lib.h +++ b/include/gnunet/gnunet_chat_lib.h | |||
@@ -338,6 +338,20 @@ typedef void | |||
338 | uint64_t size); | 338 | uint64_t size); |
339 | 339 | ||
340 | /** | 340 | /** |
341 | * Method called during a chat ticket consumption for each of its attributes. | ||
342 | * | ||
343 | * @param[in,out] cls Closure from #GNUNET_CHAT_ticket_consume | ||
344 | * @param[in] ticket Chat ticket | ||
345 | * @param[in] name Attribute name | ||
346 | * @param[in] value Attribute value | ||
347 | */ | ||
348 | typedef void | ||
349 | (*GNUNET_CHAT_TicketAttributeCallback) (void *cls, | ||
350 | const struct GNUNET_CHAT_Ticket *ticket, | ||
351 | const char *name, | ||
352 | const char *value); | ||
353 | |||
354 | /** | ||
341 | * Start a chat handle with a certain configuration. | 355 | * Start a chat handle with a certain configuration. |
342 | * | 356 | * |
343 | * A custom callback for warnings and message events can be provided optionally | 357 | * A custom callback for warnings and message events can be provided optionally |
@@ -1312,6 +1326,27 @@ GNUNET_CHAT_invitation_accept (struct GNUNET_CHAT_Invitation *invitation); | |||
1312 | enum GNUNET_GenericReturnValue | 1326 | enum GNUNET_GenericReturnValue |
1313 | GNUNET_CHAT_invitation_is_accepted (const struct GNUNET_CHAT_Invitation *invitation); | 1327 | GNUNET_CHAT_invitation_is_accepted (const struct GNUNET_CHAT_Invitation *invitation); |
1314 | 1328 | ||
1329 | /** | ||
1330 | * Returns the contact of the issuer from a given chat <i>ticket</i>. | ||
1331 | * | ||
1332 | * @param[in] invitation Chat invitation | ||
1333 | * @return Chat contact | ||
1334 | */ | ||
1335 | const struct GNUNET_CHAT_Contact* | ||
1336 | GNUNET_CHAT_ticket_get_contact (const struct GNUNET_CHAT_Ticket *ticket); | ||
1337 | |||
1338 | /** | ||
1339 | * Consumes a given chat <i>ticket</i>. | ||
1340 | * | ||
1341 | * @param[in,out] ticket Chat ticket | ||
1342 | * @param[in] callback Callback for ticket consumption (optional) | ||
1343 | * @param[in,out] cls Closure for ticket consumption (optional) | ||
1344 | */ | ||
1345 | void | ||
1346 | GNUNET_CHAT_ticket_consume (struct GNUNET_CHAT_Ticket *ticket, | ||
1347 | GNUNET_CHAT_TicketAttributeCallback callback, | ||
1348 | void *cls); | ||
1349 | |||
1315 | /**@}*/ | 1350 | /**@}*/ |
1316 | 1351 | ||
1317 | #endif /* GNUNET_CHAT_LIB_H_ */ | 1352 | #endif /* GNUNET_CHAT_LIB_H_ */ |