1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-28 12:26:46 +02:00

message queue improvements

This commit is contained in:
Jfreegman
2014-09-09 14:06:28 -04:00
parent 09f90d095b
commit bcf4a5af90
4 changed files with 55 additions and 37 deletions

View File

@ -30,19 +30,19 @@ struct cqueue_msg {
uint32_t receipt;
uint64_t last_send_try;
struct cqueue_msg *next;
struct cqueue_msg *prev;
};
struct chat_queue {
struct cqueue_msg *root;
struct cqueue_msg *end;
int friendnum;
};
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);
/* Tries to send oldest message in queue. If fails, tries again in CQUEUE_TRY_SEND_INTERVAL seconds */
void cqueue_try_send(ToxWindow *self, Tox *m);
void cqueue_try_send(ToxWindow *self, Tox *m, int32_t friendnum);
/* removes root from queue and updates line to show the message was received.
receipt should always be equal to queue root's receipt */