diff --git a/telegram-purple.c b/telegram-purple.c index b660996..01b4b2c 100755 --- a/telegram-purple.c +++ b/telegram-purple.c @@ -388,10 +388,21 @@ static void update_message_received (struct tgl_state *TLS, struct tgl_message * } if ( + // ignore all empty or deleted messages (M->flags & (FLAG_MESSAGE_EMPTY | FLAG_DELETED)) || + + // ignore all messages that are not created for the first time !(M->flags & FLAG_CREATED) || + + // drop all messages that don't contain any data !M->message || + + // drop messages that were created by *this* client and were already + // added to the conversation our_msg (TLS, M) || + + // drop all messages with an invalid peer id. + // TODO: Verify if we actually need this !tgl_get_peer_type (M->to_id) ) { return; diff --git a/tgp-structs.c b/tgp-structs.c index ab5a2ed..df89527 100644 --- a/tgp-structs.c +++ b/tgp-structs.c @@ -94,12 +94,6 @@ connection_data *connection_data_init (struct tgl_state *TLS, PurpleConnection * return conn; } -static void tgp_xfer_send_data_free (gpointer _data) { - struct tgp_xfer_send_data *data = _data; - if (data->timer) { purple_timeout_remove(data->timer); } - g_free (data); -} - void *connection_data_free (connection_data *conn) { if (conn->write_timer) { purple_timeout_remove (conn->write_timer); } if (conn->login_timer) { purple_timeout_remove (conn->login_timer); }