Compare response address with friend address.
[cascardo/f2fchat.git] / message.c
index 1a66892..35b5d1c 100644 (file)
--- a/message.c
+++ b/message.c
@@ -52,6 +52,11 @@ gboolean message_incoming(GIOChannel *channel, GIOCondition cond, gpointer data)
        iaddress = g_inet_socket_address_get_address(G_INET_SOCKET_ADDRESS(address));
        if (g_inet_address_get_is_loopback(iaddress)) {
                command(buffer, len);
+       } else {
+               struct friend *friend;
+               friend = friend_get_by_address(iaddress);
+               if (friend);
+                       g_source_remove_by_user_data(friend);
        }
        g_object_unref(address);
        g_free(buffer);