aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJacki <jacki@thejackimonster.de>2024-01-04 22:40:48 +0100
committerJacki <jacki@thejackimonster.de>2024-01-04 22:40:48 +0100
commit937d01213ab94cd0f4697b81cecc860f36cc7bfb (patch)
tree9bafc2951ecad8306b2a240310060d429a24b1fc /include
parentf20fb24047d2416023425e657cb141acc08065c4 (diff)
downloadlibgnunetchat-937d01213ab94cd0f4697b81cecc860f36cc7bfb.tar.gz
libgnunetchat-937d01213ab94cd0f4697b81cecc860f36cc7bfb.zip
Add function to iterate through tickets from a contact
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat (limited to 'include')
-rw-r--r--include/gnunet/gnunet_chat_lib.h46
1 files changed, 39 insertions, 7 deletions
diff --git a/include/gnunet/gnunet_chat_lib.h b/include/gnunet/gnunet_chat_lib.h
index 8881619..12bf244 100644
--- a/include/gnunet/gnunet_chat_lib.h
+++ b/include/gnunet/gnunet_chat_lib.h
@@ -172,6 +172,11 @@ struct GNUNET_CHAT_File;
172struct GNUNET_CHAT_Invitation; 172struct GNUNET_CHAT_Invitation;
173 173
174/** 174/**
175 * Struct of a chat ticket.
176 */
177struct GNUNET_CHAT_Ticket;
178
179/**
175 * Iterator over chat accounts of a specific chat handle. 180 * Iterator over chat accounts of a specific chat handle.
176 * 181 *
177 * @param[in,out] cls Closure from #GNUNET_CHAT_iterate_accounts 182 * @param[in,out] cls Closure from #GNUNET_CHAT_iterate_accounts
@@ -179,7 +184,7 @@ struct GNUNET_CHAT_Invitation;
179 * @param[in,out] account Chat account 184 * @param[in,out] account Chat account
180 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 185 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
181 */ 186 */
182typedef int 187typedef enum GNUNET_GenericReturnValue
183(*GNUNET_CHAT_AccountCallback) (void *cls, 188(*GNUNET_CHAT_AccountCallback) (void *cls,
184 const struct GNUNET_CHAT_Handle *handle, 189 const struct GNUNET_CHAT_Handle *handle,
185 struct GNUNET_CHAT_Account *account); 190 struct GNUNET_CHAT_Account *account);
@@ -202,12 +207,25 @@ typedef void
202 * @param[in,out] contact Chat contact 207 * @param[in,out] contact Chat contact
203 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 208 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
204 */ 209 */
205typedef int 210typedef enum GNUNET_GenericReturnValue
206(*GNUNET_CHAT_ContactCallback) (void *cls, 211(*GNUNET_CHAT_ContactCallback) (void *cls,
207 struct GNUNET_CHAT_Handle *handle, 212 struct GNUNET_CHAT_Handle *handle,
208 struct GNUNET_CHAT_Contact *contact); 213 struct GNUNET_CHAT_Contact *contact);
209 214
210/** 215/**
216 * Iterator over chat tickets of a specific chat contact.
217 *
218 * @param[in,out] cls Closure
219 * @param[in] contact Chat contact
220 * @param[in,out] ticket Chat ticket
221 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
222 */
223typedef enum GNUNET_GenericReturnValue
224(*GNUNET_CHAT_ContactTicketCallback) (void *cls,
225 const struct GNUNET_CHAT_Contact *contact,
226 struct GNUNET_CHAT_Ticket *ticket);
227
228/**
211 * Iterator over chat groups of a specific chat handle. 229 * Iterator over chat groups of a specific chat handle.
212 * 230 *
213 * @param[in,out] cls Closure from #GNUNET_CHAT_iterate_groups 231 * @param[in,out] cls Closure from #GNUNET_CHAT_iterate_groups
@@ -215,7 +233,7 @@ typedef int
215 * @param[in,out] group Chat group 233 * @param[in,out] group Chat group
216 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 234 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
217 */ 235 */
218typedef int 236typedef enum GNUNET_GenericReturnValue
219(*GNUNET_CHAT_GroupCallback) (void *cls, 237(*GNUNET_CHAT_GroupCallback) (void *cls,
220 struct GNUNET_CHAT_Handle *handle, 238 struct GNUNET_CHAT_Handle *handle,
221 struct GNUNET_CHAT_Group *group); 239 struct GNUNET_CHAT_Group *group);
@@ -228,7 +246,7 @@ typedef int
228 * @param[in,out] contact Chat contact 246 * @param[in,out] contact Chat contact
229 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 247 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
230 */ 248 */
231typedef int 249typedef enum GNUNET_GenericReturnValue
232(*GNUNET_CHAT_GroupContactCallback) (void *cls, 250(*GNUNET_CHAT_GroupContactCallback) (void *cls,
233 const struct GNUNET_CHAT_Group *group, 251 const struct GNUNET_CHAT_Group *group,
234 struct GNUNET_CHAT_Contact *contact); 252 struct GNUNET_CHAT_Contact *contact);
@@ -241,7 +259,7 @@ typedef int
241 * @param[in] message Chat message 259 * @param[in] message Chat message
242 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 260 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
243 */ 261 */
244typedef int 262typedef enum GNUNET_GenericReturnValue
245(*GNUNET_CHAT_ContextMessageCallback) (void *cls, 263(*GNUNET_CHAT_ContextMessageCallback) (void *cls,
246 struct GNUNET_CHAT_Context *context, 264 struct GNUNET_CHAT_Context *context,
247 const struct GNUNET_CHAT_Message *message); 265 const struct GNUNET_CHAT_Message *message);
@@ -254,7 +272,7 @@ typedef int
254 * @param[in,out] file Chat file 272 * @param[in,out] file Chat file
255 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 273 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
256 */ 274 */
257typedef int 275typedef enum GNUNET_GenericReturnValue
258(*GNUNET_CHAT_ContextFileCallback) (void *cls, 276(*GNUNET_CHAT_ContextFileCallback) (void *cls,
259 struct GNUNET_CHAT_Context *context, 277 struct GNUNET_CHAT_Context *context,
260 struct GNUNET_CHAT_File *file); 278 struct GNUNET_CHAT_File *file);
@@ -270,7 +288,7 @@ typedef int
270 * #GNUNET_NO otherwise 288 * #GNUNET_NO otherwise
271 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. 289 * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise.
272 */ 290 */
273typedef int 291typedef enum GNUNET_GenericReturnValue
274(*GNUNET_CHAT_MessageReadReceiptCallback) (void *cls, 292(*GNUNET_CHAT_MessageReadReceiptCallback) (void *cls,
275 const struct GNUNET_CHAT_Message *message, 293 const struct GNUNET_CHAT_Message *message,
276 const struct GNUNET_CHAT_Contact *contact, 294 const struct GNUNET_CHAT_Contact *contact,
@@ -718,6 +736,20 @@ enum GNUNET_GenericReturnValue
718GNUNET_CHAT_contact_is_blocked (const struct GNUNET_CHAT_Contact *contact); 736GNUNET_CHAT_contact_is_blocked (const struct GNUNET_CHAT_Contact *contact);
719 737
720/** 738/**
739 * Iterates through the tickets of a given <i>contact</i> with a selected
740 * callback and custom closure.
741 *
742 * @param[in,out] contact Contact
743 * @param[in] callback Callback for ticket iteration (optional)
744 * @param[in,out] cls Closure for ticket iteration (optional)
745 * @return Amount of tickets iterated
746 */
747int
748GNUNET_CHAT_contact_iterate_tickets (const struct GNUNET_CHAT_Contact *contact,
749 GNUNET_CHAT_ContactTicketCallback callback,
750 void *cls);
751
752/**
721 * Leaves a specific <i>group</i> chat and frees its memory if it is not shared 753 * Leaves a specific <i>group</i> chat and frees its memory if it is not shared
722 * with other groups or contacts. 754 * with other groups or contacts.
723 * 755 *