diff options
Diffstat (limited to 'toxcore/group.h')
-rw-r--r-- | toxcore/group.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/toxcore/group.h b/toxcore/group.h index 5adde463..e307bec9 100644 --- a/toxcore/group.h +++ b/toxcore/group.h | |||
@@ -108,6 +108,11 @@ typedef struct { | |||
108 | void *action_callback_userdata; | 108 | void *action_callback_userdata; |
109 | void (*peer_namelistchange)(Messenger *m, int, int, uint8_t, void *); | 109 | void (*peer_namelistchange)(Messenger *m, int, int, uint8_t, void *); |
110 | void *group_namelistchange_userdata; | 110 | void *group_namelistchange_userdata; |
111 | |||
112 | struct { | ||
113 | int (*function)(Messenger *m, int, int, const uint8_t *, uint16_t, void *); | ||
114 | void *userdata; | ||
115 | } lossy_packethandlers[256]; | ||
111 | } Group_Chats; | 116 | } Group_Chats; |
112 | 117 | ||
113 | /* Set the callback for group invites. | 118 | /* Set the callback for group invites. |
@@ -216,6 +221,20 @@ unsigned int group_peernumber_is_ours(const Group_Chats *g_c, int groupnumber, i | |||
216 | int group_names(const Group_Chats *g_c, int groupnumber, uint8_t names[][MAX_NAME_LENGTH], uint16_t lengths[], | 221 | int group_names(const Group_Chats *g_c, int groupnumber, uint8_t names[][MAX_NAME_LENGTH], uint16_t lengths[], |
217 | uint16_t length); | 222 | uint16_t length); |
218 | 223 | ||
224 | /* Set handlers for custom lossy packets. | ||
225 | * | ||
226 | * NOTE: Handler must return 0 if packet is to be relayed, -1 if the packet should not be relayed. | ||
227 | */ | ||
228 | void group_lossy_packet_registerhandler(Group_Chats *g_c, uint8_t byte, int (*function)(Messenger *m, int, int, | ||
229 | const uint8_t *, uint16_t, void *), void *userdata); | ||
230 | |||
231 | /* High level function to send custom lossy packets. | ||
232 | * | ||
233 | * return -1 on failure. | ||
234 | * return 0 on success. | ||
235 | */ | ||
236 | int send_group_lossy_packet(const Group_Chats *g_c, int groupnumber, const uint8_t *data, uint16_t length); | ||
237 | |||
219 | /* Return the number of chats in the instance m. | 238 | /* Return the number of chats in the instance m. |
220 | * You should use this to determine how much memory to allocate | 239 | * You should use this to determine how much memory to allocate |
221 | * for copy_chatlist. | 240 | * for copy_chatlist. |