diff options
Diffstat (limited to 'src/service/messenger/messenger_api_room.h')
-rw-r--r-- | src/service/messenger/messenger_api_room.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/service/messenger/messenger_api_room.h b/src/service/messenger/messenger_api_room.h index 855405337..79571bc2e 100644 --- a/src/service/messenger/messenger_api_room.h +++ b/src/service/messenger/messenger_api_room.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #ifndef GNUNET_MESSENGER_API_ROOM_H | 26 | #ifndef GNUNET_MESSENGER_API_ROOM_H |
27 | #define GNUNET_MESSENGER_API_ROOM_H | 27 | #define GNUNET_MESSENGER_API_ROOM_H |
28 | 28 | ||
29 | #include "gnunet_common.h" | ||
30 | #include "gnunet_time_lib.h" | ||
29 | #include "gnunet_util_lib.h" | 31 | #include "gnunet_util_lib.h" |
30 | 32 | ||
31 | #include "gnunet_messenger_service.h" | 33 | #include "gnunet_messenger_service.h" |
@@ -58,10 +60,15 @@ struct GNUNET_MESSENGER_Room | |||
58 | 60 | ||
59 | struct GNUNET_CONTAINER_MultiHashMap *messages; | 61 | struct GNUNET_CONTAINER_MultiHashMap *messages; |
60 | struct GNUNET_CONTAINER_MultiShortmap *members; | 62 | struct GNUNET_CONTAINER_MultiShortmap *members; |
63 | struct GNUNET_CONTAINER_MultiHashMap *links; | ||
61 | 64 | ||
62 | struct GNUNET_MESSENGER_QueueMessages queue; | 65 | struct GNUNET_MESSENGER_QueueMessages queue; |
63 | }; | 66 | }; |
64 | 67 | ||
68 | typedef void (*GNUNET_MESSENGER_RoomLinkDeletion) (struct GNUNET_MESSENGER_Room *room, | ||
69 | const struct GNUNET_HashCode *hash, | ||
70 | const struct GNUNET_TIME_Relative delay); | ||
71 | |||
65 | /** | 72 | /** |
66 | * Creates and allocates a new room for a <i>handle</i> with a given <i>key</i> for the client API. | 73 | * Creates and allocates a new room for a <i>handle</i> with a given <i>key</i> for the client API. |
67 | * | 74 | * |
@@ -194,4 +201,33 @@ enum GNUNET_GenericReturnValue | |||
194 | find_room_member (const struct GNUNET_MESSENGER_Room *room, | 201 | find_room_member (const struct GNUNET_MESSENGER_Room *room, |
195 | const struct GNUNET_MESSENGER_Contact *contact); | 202 | const struct GNUNET_MESSENGER_Contact *contact); |
196 | 203 | ||
204 | /** | ||
205 | * Links a message identified by its <i>hash</i> inside a given <i>room</i> with another | ||
206 | * message identified by its <i>other</i> hash. Linked messages will be deleted automatically, | ||
207 | * if any linked message to it gets deleted. | ||
208 | * | ||
209 | * @param[in,out] room Room | ||
210 | * @param[in] hash Hash of message | ||
211 | * @param[in] other Hash of other message | ||
212 | */ | ||
213 | void | ||
214 | link_room_message (struct GNUNET_MESSENGER_Room *room, | ||
215 | const struct GNUNET_HashCode *hash, | ||
216 | const struct GNUNET_HashCode *other); | ||
217 | |||
218 | /** | ||
219 | * Delete all remaining links to a certain message identified by its <i>hash</i> inside a given | ||
220 | * <i>room</i> and cause a <i>deletion</i> process to all of the linked messages. | ||
221 | * | ||
222 | * @param[in,out] room Room | ||
223 | * @param[in] hash Hash of message | ||
224 | * @param[in] delay Delay for linked deletion | ||
225 | * @param[in] deletion Function called for each linked deletion | ||
226 | */ | ||
227 | void | ||
228 | link_room_deletion (struct GNUNET_MESSENGER_Room *room, | ||
229 | const struct GNUNET_HashCode *hash, | ||
230 | const struct GNUNET_TIME_Relative delay, | ||
231 | GNUNET_MESSENGER_RoomLinkDeletion deletion); | ||
232 | |||
197 | #endif //GNUNET_MESSENGER_API_ROOM_H | 233 | #endif //GNUNET_MESSENGER_API_ROOM_H |