diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2022-02-13 18:15:43 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2022-02-13 18:15:43 +0100 |
commit | 77e4525e6477ddda9b025261be2e1c73d86a1fe9 (patch) | |
tree | 801a3842070f4e5f6b055a9ba6cd625c086b5a16 /include | |
parent | ccdeafaf88627aa274c2d6090e4231ed51b56c63 (diff) | |
download | libgnunetchat-77e4525e6477ddda9b025261be2e1c73d86a1fe9.tar.gz libgnunetchat-77e4525e6477ddda9b025261be2e1c73d86a1fe9.zip |
Added user pointer and name access to accounts
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gnunet_chat_lib.h | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/include/gnunet_chat_lib.h b/include/gnunet_chat_lib.h index 0d2a848..a0d57d9 100644 --- a/include/gnunet_chat_lib.h +++ b/include/gnunet_chat_lib.h | |||
@@ -150,13 +150,13 @@ struct GNUNET_CHAT_Invitation; | |||
150 | * | 150 | * |
151 | * @param[in,out] cls Closure from #GNUNET_CHAT_iterate_accounts | 151 | * @param[in,out] cls Closure from #GNUNET_CHAT_iterate_accounts |
152 | * @param[in] handle Chat handle | 152 | * @param[in] handle Chat handle |
153 | * @param[in] account Chat account | 153 | * @param[in,out] account Chat account |
154 | * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. | 154 | * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. |
155 | */ | 155 | */ |
156 | typedef int | 156 | typedef int |
157 | (*GNUNET_CHAT_AccountCallback) (void *cls, | 157 | (*GNUNET_CHAT_AccountCallback) (void *cls, |
158 | const struct GNUNET_CHAT_Handle *handle, | 158 | const struct GNUNET_CHAT_Handle *handle, |
159 | const struct GNUNET_CHAT_Account *account); | 159 | struct GNUNET_CHAT_Account *account); |
160 | 160 | ||
161 | /** | 161 | /** |
162 | * Iterator over chat contacts of a specific chat handle. | 162 | * Iterator over chat contacts of a specific chat handle. |
@@ -320,9 +320,9 @@ GNUNET_CHAT_stop (struct GNUNET_CHAT_Handle *handle); | |||
320 | * @return Amount of accounts iterated or #GNUNET_SYSERR on failure | 320 | * @return Amount of accounts iterated or #GNUNET_SYSERR on failure |
321 | */ | 321 | */ |
322 | int | 322 | int |
323 | GNUNET_CHAT_iterate_accounts(const struct GNUNET_CHAT_Handle *handle, | 323 | GNUNET_CHAT_iterate_accounts (const struct GNUNET_CHAT_Handle *handle, |
324 | GNUNET_CHAT_AccountCallback callback, | 324 | GNUNET_CHAT_AccountCallback callback, |
325 | void *cls); | 325 | void *cls); |
326 | 326 | ||
327 | /** | 327 | /** |
328 | * Connects a chat <i>handle</i> to a selected chat <i>account</i>. | 328 | * Connects a chat <i>handle</i> to a selected chat <i>account</i>. |
@@ -349,7 +349,7 @@ GNUNET_CHAT_disconnect (struct GNUNET_CHAT_Handle *handle); | |||
349 | * @return Account used by the handle or NULL | 349 | * @return Account used by the handle or NULL |
350 | */ | 350 | */ |
351 | const struct GNUNET_CHAT_Account* | 351 | const struct GNUNET_CHAT_Account* |
352 | GNUNET_CHAT_get_connected(const struct GNUNET_CHAT_Handle *handle); | 352 | GNUNET_CHAT_get_connected (const struct GNUNET_CHAT_Handle *handle); |
353 | 353 | ||
354 | /** | 354 | /** |
355 | * Updates a chat handle to renew the used ego to sign sent messages in active | 355 | * Updates a chat handle to renew the used ego to sign sent messages in active |
@@ -409,6 +409,36 @@ GNUNET_CHAT_iterate_contacts (struct GNUNET_CHAT_Handle *handle, | |||
409 | void *cls); | 409 | void *cls); |
410 | 410 | ||
411 | /** | 411 | /** |
412 | * Returns the provided name of a given <i>account</i> or NULL on failure. | ||
413 | * | ||
414 | * @param account Chat account | ||
415 | * @return Name or NULL | ||
416 | */ | ||
417 | const char* | ||
418 | GNUNET_CHAT_account_get_name (const struct GNUNET_CHAT_Account *account); | ||
419 | |||
420 | /** | ||
421 | * Sets a custom <i>user pointer</i> to a given chat <i>account</i> so it can | ||
422 | * be accessed in account related callbacks. | ||
423 | * | ||
424 | * @param[in,out] account Chat account | ||
425 | * @param[in] user_pointer Custom user pointer | ||
426 | */ | ||
427 | void | ||
428 | GNUNET_CHAT_account_set_user_pointer (struct GNUNET_CHAT_Account *account, | ||
429 | void *user_pointer); | ||
430 | |||
431 | /** | ||
432 | * Returns the custom user pointer of a given <i>contact</i> or NULL if it was | ||
433 | * not set any. | ||
434 | * | ||
435 | * @param[in] account Chat account | ||
436 | * @return Custom user pointer or NULL | ||
437 | */ | ||
438 | void* | ||
439 | GNUNET_CHAT_account_get_user_pointer (const struct GNUNET_CHAT_Account *account); | ||
440 | |||
441 | /** | ||
412 | * Creates a new group chat to use with a given chat <i>handle</i> with an | 442 | * Creates a new group chat to use with a given chat <i>handle</i> with an |
413 | * optional public <i>topic</i>. | 443 | * optional public <i>topic</i>. |
414 | * | 444 | * |