This commit is contained in:
Your Name 2024-03-27 17:12:42 +03:00
parent 332c0ff43b
commit 18278e6d6c
3 changed files with 6 additions and 7 deletions

View File

@ -140,7 +140,7 @@ int IRCC_parse(IRCC_client *irc) {
else if (strstr(irc->irc_raw, "PART ") || strstr(irc->irc_raw, "QUIT ")) {
IRCC_parse_msg(strstr(irc->irc_raw, "PART "), irc);
IRCC_parse_msg(strstr(irc->irc_raw, "QUIT "), irc);
return IRCC_PART;
return IRCC_QUIT;
}
return IRCC_SUCCESS;

View File

@ -21,7 +21,7 @@ enum {
IRCC_NICK = 1,
IRCC_PRIVMSG,
IRCC_JOIN,
IRCC_PART,
IRCC_QUIT,
IRCC_PING,
IRCC_TOPIC,
IRCC_MODE,
@ -53,7 +53,7 @@ int IRCC_connect(IRCC_client *irc, const char *ip, const unsigned int port);
int IRCC_recv(IRCC_client *irc);
int IRCC_parse(IRCC_client *irc);
int IRCC_join(IRCC_client *irc, const char *channel, const char *key);
int IRCC_send(IRCC_client *irc, const char *msg, const char *channel);
int IRCC_send(IRCC_client *irc, const char *channel, const char *msg);
int IRCC_register(IRCC_client *irc, const char *nickname);
int IRCC_initssl(IRCC_client *irc);
void IRCC_close(IRCC_client *irc);

View File

@ -7,7 +7,7 @@
//Config
#define HOST "irc.rizon.net"
#define PORT 6697
#define PORT 6667
#define NICK "tester134"
char *channels[] = {"#test"};
@ -29,7 +29,7 @@ void handler(int sig) {
void recvinfo(void) {
while (1) {
unsigned int irc_status = IRCC_recv(&client);
int irc_status = IRCC_recv(&client);
if (irc_status == IRCC_DISCONNECTED)
die("Disconnected");
@ -37,7 +37,7 @@ void recvinfo(void) {
//Print
if (CHECK_NULL() && irc_status == IRCC_PRIVMSG)
printf("%s\n", client.irc_msg);
printf("%s %s\n", client.irc_nick, client.irc_msg);
else if (client.irc_nick != NULL && client.irc_msg != NULL && irc_status == IRCC_NICK)
printf("[N] %s is know as %s\n", client.irc_nick, client.irc_msg);
@ -78,4 +78,3 @@ int main(void) {
recvinfo();
}