1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 10:16:45 +02:00

implement read receipts

This commit is contained in:
Jfreegman
2014-09-07 02:43:53 -04:00
parent 3c2c1f15ce
commit 5b9bd603ea
10 changed files with 141 additions and 35 deletions

View File

@ -20,17 +20,14 @@
*
*/
enum {
QMESSAGE,
QACTION,
} MESSAGE_TYPE;
struct cqueue_msg {
char message[MAX_STR_SIZE];
int len;
int line_id;
uint8_t type;
uint32_t receipt;
uint64_t last_send_try;
struct cqueue_msg *prev;
struct cqueue_msg *next;
};
@ -42,5 +39,9 @@ struct chat_queue {
void cqueue_cleanup(struct chat_queue *q);
void cqueue_add(struct chat_queue *q, const char *msg, int len, uint8_t type, uint32_t line_id);
void cqueue_check(Tox *m);
void cqueue_try_send(Tox *m, struct chat_queue *q);
/* Tries to send oldest message in queue once every CQUEUE_TRY_SEND_INTERVAL seconds */
void cqueue_try_send(ToxWindow *self, Tox *m);
/* removes the message with the same receipt number from queue and updates line to show the message was received*/
void cqueue_remove(ToxWindow *self, struct chat_queue *q, uint32_t receipt);