From: Thadeu Lima de Souza Cascardo Date: Thu, 10 Oct 2013 21:34:29 +0000 (-0300) Subject: Set state as online if PING is received. X-Git-Url: http://git.cascardo.info/?p=cascardo%2Ff2fchat.git;a=commitdiff_plain;h=eba9ab6a3f362ecd814ac85b62f22d3bf85f22d6 Set state as online if PING is received. --- 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;