fixed
This commit is contained in:
parent
18278e6d6c
commit
65de41ff41
2 changed files with 10 additions and 10 deletions
18
C/irc.c
18
C/irc.c
|
@ -91,14 +91,6 @@ int IRCC_recv(IRCC_client *irc) {
|
|||
if (msg_size == 0 || msg_size == -1)
|
||||
return IRCC_DISCONNECTED;
|
||||
|
||||
else if (!strncmp(irc->irc_raw, "PING", 4)) {
|
||||
*(strchr(irc->irc_raw, 'I')) = 'O';
|
||||
if (IRCC_usend(irc, strlen(irc->irc_raw)) == -1)
|
||||
return IRCC_ERROR;
|
||||
|
||||
return IRCC_PING;
|
||||
}
|
||||
|
||||
return IRCC_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -107,11 +99,18 @@ int IRCC_parse(IRCC_client *irc) {
|
|||
irc->irc_msg = NULL;
|
||||
irc->irc_nick = NULL;
|
||||
|
||||
if (!strncmp(irc->irc_raw, "PING", 4)) {
|
||||
*(strchr(irc->irc_raw, 'I')) = 'O';
|
||||
if (IRCC_usend(irc, strlen(irc->irc_raw)) == -1)
|
||||
return IRCC_ERROR;
|
||||
|
||||
return IRCC_PING;
|
||||
}
|
||||
|
||||
//Check end of motd
|
||||
if (strstr(irc->irc_raw, "PRIVMSG ") == NULL && strstr(irc->irc_raw, "MOTD"))
|
||||
return IRCC_CONNECTED;
|
||||
|
||||
//Other
|
||||
else if (strstr(irc->irc_raw, "PRIVMSG ")) {
|
||||
IRCC_parse_msg(strstr(irc->irc_raw, "PRIVMSG "), irc);
|
||||
return IRCC_PRIVMSG;
|
||||
|
@ -235,3 +234,4 @@ void IRCC_close(IRCC_client *irc) {
|
|||
SSL_CTX_free(irc->irc_sslctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue