From eba9ab6a3f362ecd814ac85b62f22d3bf85f22d6 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Thu, 10 Oct 2013 18:34:29 -0300 Subject: [PATCH] Set state as online if PING is received. --- friend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/friend.c b/friend.c index 03d306d..2e50f36 100644 --- a/friend.c +++ b/friend.c @@ -81,6 +81,7 @@ void friend_timeout(struct friend *friend) void friend_got_message(struct friend *friend, char *buffer, size_t len) { if (len >= 4 && !strncmp(buffer, "PING", 4)) { + friend->state = STATE_ONLINE; pong(friend); } else if (len >= 4 && !strncmp(buffer, "PONG", 4)) { friend->state = STATE_ONLINE; -- 2.20.1