Don't drop secret chat state updates
This commit is contained in:
parent
65f8c4aa6e
commit
14e5e106b7
3 changed files with 8 additions and 6 deletions
|
@ -33,6 +33,7 @@
|
|||
#include <request.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include "telegram-base.h"
|
||||
#include "telegram-purple.h"
|
||||
#include "msglog.h"
|
||||
#include "tgp-2prpl.h"
|
||||
|
@ -107,20 +108,21 @@ void write_state_file (struct tgl_state *TLS) {
|
|||
close (state_file_fd);
|
||||
}
|
||||
|
||||
static gboolean write_state_file_gw (gpointer data) {
|
||||
static gboolean write_files_gw (gpointer data) {
|
||||
struct tgl_state *TLS = data;
|
||||
|
||||
((connection_data *)TLS->ev_base)->write_timer = 0;
|
||||
write_state_file ((struct tgl_state *)TLS);
|
||||
write_state_file (TLS);
|
||||
write_secret_chat_file (TLS);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void write_state_file_schedule (struct tgl_state *TLS) {
|
||||
void write_files_schedule (struct tgl_state *TLS) {
|
||||
connection_data *conn = TLS->ev_base;
|
||||
|
||||
if (! conn->write_timer) {
|
||||
conn->write_timer = purple_timeout_add (0, write_state_file_gw, TLS);
|
||||
conn->write_timer = purple_timeout_add (0, write_files_gw, TLS);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ void read_state_file (struct tgl_state *TLS);
|
|||
void read_auth_file (struct tgl_state *TLS);
|
||||
void write_auth_file (struct tgl_state *TLS);
|
||||
void write_state_file (struct tgl_state *TLS);
|
||||
void write_state_file_schedule (struct tgl_state *TLS);
|
||||
void write_files_schedule (struct tgl_state *TLS);
|
||||
void read_secret_chat_file (struct tgl_state *TLS);
|
||||
void write_secret_chat_file (struct tgl_state *TLS);
|
||||
void write_secret_chat_gw (struct tgl_state *TLS, void *extra, int success, struct tgl_secret_chat *E);
|
||||
|
|
|
@ -98,7 +98,7 @@ struct tgl_update_callback tgp_callback = {
|
|||
};
|
||||
|
||||
static void update_message_received (struct tgl_state *TLS, struct tgl_message *M) {
|
||||
write_state_file_schedule (TLS);
|
||||
write_files_schedule (TLS);
|
||||
tgp_msg_recv (TLS, M);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue