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

increase time between message send retries

This commit is contained in:
Jfreegman
2014-09-10 16:18:37 -04:00
parent 21f8e7f398
commit 13c5de5531
7 changed files with 26 additions and 25 deletions

View File

@ -73,18 +73,19 @@ static void cqueue_mark_read(ToxWindow *self, uint32_t id, uint8_t type)
struct line_info *line = self->chatwin->hst->line_end;
while (line) {
if (line->id == id) {
line->type = type == OUT_ACTION ? OUT_ACTION_READ : OUT_MSG_READ;
if (line->noread_flag == true) {
line->len -= 2;
line->noread_flag = false;
}
return;
if (line->id != id) {
line = line->prev;
continue;
}
line = line->prev;
line->type = type == OUT_ACTION ? OUT_ACTION_READ : OUT_MSG_READ;
if (line->noread_flag == true) {
line->len -= 2;
line->noread_flag = false;
}
return;
}
}
@ -118,8 +119,10 @@ void cqueue_remove(ToxWindow *self, struct chat_queue *q, uint32_t receipt)
}
}
#define CQUEUE_TRY_SEND_INTERVAL 10
/* Tries to send the oldest unsent message in queue. */
void cqueue_try_send(ToxWindow *self, Tox *m, int32_t friendnum)
void cqueue_try_send(ToxWindow *self, Tox *m)
{
struct chat_queue *q = self->chatwin->cqueue;
struct cqueue_msg *msg = q->root;
@ -134,9 +137,9 @@ void cqueue_try_send(ToxWindow *self, Tox *m, int32_t friendnum)
uint32_t receipt = 0;
if (msg->type == OUT_MSG)
receipt = tox_send_message(m, friendnum, (uint8_t *) msg->message, msg->len);
receipt = tox_send_message(m, self->num, (uint8_t *) msg->message, msg->len);
else
receipt = tox_send_action(m, friendnum, (uint8_t *) msg->message, msg->len);
receipt = tox_send_action(m, self->num, (uint8_t *) msg->message, msg->len);
msg->last_send_try = curtime;
msg->receipt = receipt;