diff --git a/loop.c b/loop.c index bdeea3f..37833d2 100644 --- a/loop.c +++ b/loop.c @@ -254,14 +254,7 @@ struct protocol_state read_state_file (const char *filename) { } void write_state_file (struct protocol_state *state, const char* filename) { - /* - static int wseq; - static int wpts; - static int wqts; - static int wdate; - if (wseq >= seq && wpts >= pts && wqts >= qts && wdate >= last_date) { return; } - */ - int state_file_fd = open (filename /*get_state_filename ()*/, O_CREAT | O_RDWR, 0600); + int state_file_fd = open (filename, O_CREAT | O_RDWR, 0600); if (state_file_fd < 0) { return; } @@ -274,7 +267,6 @@ void write_state_file (struct protocol_state *state, const char* filename) { x[5] = state->last_date; assert (write (state_file_fd, x, 24) == 24); close (state_file_fd); - //wseq = seq; wpts = pts; wqts = qts; wdate = last_date; } extern peer_t *Peers[]; diff --git a/purple-plugin/telegram-purple.c b/purple-plugin/telegram-purple.c index ae140a7..59c9a83 100644 --- a/purple-plugin/telegram-purple.c +++ b/purple-plugin/telegram-purple.c @@ -293,18 +293,9 @@ void telegram_on_ready (struct telegram *instance) tggroup = purple_group_new ("Telegram"); purple_blist_add_group (tggroup, NULL); } - - // get all current contacts - purple_debug_info(PLUGIN_ID, "Fetching all current contacts...\n"); do_update_contact_list(instance); - - purple_debug_info(PLUGIN_ID, "Fetching all current chats...\n"); do_get_dialog_list(instance); - - // get new messages - purple_debug_info(PLUGIN_ID, "Fetching new messages...\n"); do_get_difference(instance); - tgprpl_has_output(instance); conn->timer = purple_timeout_add (4000, queries_timerfunc, conn); } @@ -401,7 +392,6 @@ void message_allocated_handler(struct telegram *tg, struct message *M) // TODO: this should probably be freed again somwhere int id = get_peer_id(M->from_id); - logprintf ("id: %d\n", id); char *who = g_strdup_printf("%d", id); if (who) { logprintf ("who: %s\n", who); diff --git a/telegram.h b/telegram.h index 52669c5..c13590e 100644 --- a/telegram.h +++ b/telegram.h @@ -1,10 +1,3 @@ -/* - * libtelegram - * =========== - * - * struct telegram library based on the telegram cli application, that was originally made by vysheng (see https://github.com/vysheng/tg) - */ - #ifndef __TELEGRAM_H__ #define __TELEGRAM_H__ @@ -37,16 +30,10 @@ struct tree_timer; #define STATE_INITIALISED 0 #define STATE_DISCONNECTED 1 - -// Error #define STATE_ERROR 2 - -// intermediate authorization states already present and handled in mtproto-client.c -//#define STATE_PQ_REQUESTED 3 -//#define STATE_DH_REQUESTED 4 -//#define STATE_CDH_REQUESTED 5 #define STATE_AUTHORIZED 6 + // dc discovery #define STATE_CONFIG_REQUESTED 7 #define STATE_EXPORTING_CONFIG 8 @@ -273,19 +260,8 @@ struct telegram { */ struct telegram *telegram_new(struct dc *DC, const char* login, struct telegram_config *config); -/** - * Resume the session to - */ void telegram_restore_session(struct telegram *instance); - -/** - * Store - */ void telegram_store_session(struct telegram *instance); - -/** - * Destructor - */ void telegram_destroy(struct telegram *instance); /**