Add some debug when receiving a message
authorThadeu Lima de Souza Cascardo <cascardo@cascardo.info>
Wed, 9 Oct 2013 21:59:48 +0000 (18:59 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@cascardo.info>
Wed, 9 Oct 2013 21:59:48 +0000 (18:59 -0300)
message.c

index 4104cff..8e3202d 100644 (file)
--- a/message.c
+++ b/message.c
@@ -55,8 +55,12 @@ gboolean message_incoming(GIOChannel *channel, GIOCondition cond, gpointer data)
        } else {
                struct friend *friend;
                friend = friend_get_by_address(iaddress);
-               if (friend)
+               if (friend) {
+                       printf("got message from %s\n", friend_get_name(friend));
                        g_source_remove_by_user_data(friend);
+               } else {
+                       printf("could not find friend from address %s\n", g_inet_address_to_string(iaddress));
+               }
        }
        g_object_unref(address);
        g_free(buffer);