mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-29 06:56:44 +02:00
Refactor unread message flagging
This fixes an issue where the interface wasn't able to update when the unread message flag changed. It also cleans up some ugly code
This commit is contained in:
@ -28,8 +28,10 @@ struct cqueue_msg {
|
||||
size_t len;
|
||||
int line_id;
|
||||
time_t last_send_try;
|
||||
time_t time_added;
|
||||
uint8_t type;
|
||||
int64_t receipt;
|
||||
bool noread_flag;
|
||||
struct cqueue_msg *next;
|
||||
struct cqueue_msg *prev;
|
||||
};
|
||||
@ -48,6 +50,12 @@ void cqueue_add(struct chat_queue *q, const char *msg, size_t len, uint8_t type,
|
||||
*/
|
||||
void cqueue_try_send(ToxWindow *self, Tox *m);
|
||||
|
||||
/*
|
||||
* Sets the noread flag for messages sent to the peer associated with `self` which have not
|
||||
* received a receipt after a period of time.
|
||||
*/
|
||||
void cqueue_check_unread(ToxWindow *self);
|
||||
|
||||
/* removes message with matching receipt from queue, writes to log and updates line to show the message was received. */
|
||||
void cqueue_remove(ToxWindow *self, Tox *m, uint32_t receipt);
|
||||
|
||||
|
Reference in New Issue
Block a user