mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed the bug when receipts for messages sent from the receipt callback never arrived.
This commit is contained in:
parent
e996a030f0
commit
a3a22ae67e
|
@ -375,8 +375,6 @@ static int do_receipts(Messenger *m, int32_t friendnumber, void *userdata)
|
|||
struct Receipts *receipts = m->friendlist[friendnumber].receipts_start;
|
||||
|
||||
while (receipts) {
|
||||
struct Receipts *temp_r = receipts->next;
|
||||
|
||||
if (friend_received_packet(m, friendnumber, receipts->packet_num) == -1) {
|
||||
break;
|
||||
}
|
||||
|
@ -385,9 +383,13 @@ static int do_receipts(Messenger *m, int32_t friendnumber, void *userdata)
|
|||
(*m->read_receipt)(m, friendnumber, receipts->msg_id, userdata);
|
||||
}
|
||||
|
||||
struct Receipts *r_next = receipts->next;
|
||||
|
||||
free(receipts);
|
||||
m->friendlist[friendnumber].receipts_start = temp_r;
|
||||
receipts = temp_r;
|
||||
|
||||
m->friendlist[friendnumber].receipts_start = r_next;
|
||||
|
||||
receipts = r_next;
|
||||
}
|
||||
|
||||
if (!m->friendlist[friendnumber].receipts_start) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user