Mark chat messages as read
This commit is contained in:
parent
4a4179d262
commit
106f828b9e
2 changed files with 6 additions and 2 deletions
|
@ -426,6 +426,11 @@ int chat_add_message (struct tgl_state *TLS, struct tgl_message *M, char *text)
|
|||
if (chat_show (conn->gc, tgl_get_peer_id (M->to_id))) {
|
||||
p2tgl_got_chat_in(TLS, M->to_id, M->from_id, text ? text : M->message,
|
||||
M->service ? PURPLE_MESSAGE_SYSTEM : PURPLE_MESSAGE_RECV, M->date);
|
||||
|
||||
pending_reads_add (conn->pending_reads, M->to_id);
|
||||
if (p2tgl_status_is_present(purple_account_get_active_status(conn->pa))) {
|
||||
pending_reads_send_all (conn->pending_reads, conn->TLS);
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
// add message once the chat was initialised
|
||||
|
|
|
@ -337,8 +337,7 @@ static void update_message_received (struct tgl_state *TLS, struct tgl_message *
|
|||
p2tgl_got_im (TLS, M->from_id, text, PURPLE_MESSAGE_RECV, M->date);
|
||||
|
||||
pending_reads_add (conn->pending_reads, M->from_id);
|
||||
PurpleStatus *status = purple_account_get_active_status(conn->pa);
|
||||
if (p2tgl_status_is_present(status)) {
|
||||
if (p2tgl_status_is_present(purple_account_get_active_status(conn->pa))) {
|
||||
pending_reads_send_all (conn->pending_reads, conn->TLS);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue