fixed
This commit is contained in:
parent
332c0ff43b
commit
18278e6d6c
2
C/irc.c
2
C/irc.c
@ -140,7 +140,7 @@ int IRCC_parse(IRCC_client *irc) {
|
|||||||
else if (strstr(irc->irc_raw, "PART ") || strstr(irc->irc_raw, "QUIT ")) {
|
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, "PART "), irc);
|
||||||
IRCC_parse_msg(strstr(irc->irc_raw, "QUIT "), irc);
|
IRCC_parse_msg(strstr(irc->irc_raw, "QUIT "), irc);
|
||||||
return IRCC_PART;
|
return IRCC_QUIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return IRCC_SUCCESS;
|
return IRCC_SUCCESS;
|
||||||
|
4
C/irc.h
4
C/irc.h
@ -21,7 +21,7 @@ enum {
|
|||||||
IRCC_NICK = 1,
|
IRCC_NICK = 1,
|
||||||
IRCC_PRIVMSG,
|
IRCC_PRIVMSG,
|
||||||
IRCC_JOIN,
|
IRCC_JOIN,
|
||||||
IRCC_PART,
|
IRCC_QUIT,
|
||||||
IRCC_PING,
|
IRCC_PING,
|
||||||
IRCC_TOPIC,
|
IRCC_TOPIC,
|
||||||
IRCC_MODE,
|
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_recv(IRCC_client *irc);
|
||||||
int IRCC_parse(IRCC_client *irc);
|
int IRCC_parse(IRCC_client *irc);
|
||||||
int IRCC_join(IRCC_client *irc, const char *channel, const char *key);
|
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_register(IRCC_client *irc, const char *nickname);
|
||||||
int IRCC_initssl(IRCC_client *irc);
|
int IRCC_initssl(IRCC_client *irc);
|
||||||
void IRCC_close(IRCC_client *irc);
|
void IRCC_close(IRCC_client *irc);
|
||||||
|
7
C/main.c
7
C/main.c
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
//Config
|
//Config
|
||||||
#define HOST "irc.rizon.net"
|
#define HOST "irc.rizon.net"
|
||||||
#define PORT 6697
|
#define PORT 6667
|
||||||
#define NICK "tester134"
|
#define NICK "tester134"
|
||||||
char *channels[] = {"#test"};
|
char *channels[] = {"#test"};
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ void handler(int sig) {
|
|||||||
|
|
||||||
void recvinfo(void) {
|
void recvinfo(void) {
|
||||||
while (1) {
|
while (1) {
|
||||||
unsigned int irc_status = IRCC_recv(&client);
|
int irc_status = IRCC_recv(&client);
|
||||||
if (irc_status == IRCC_DISCONNECTED)
|
if (irc_status == IRCC_DISCONNECTED)
|
||||||
die("Disconnected");
|
die("Disconnected");
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ void recvinfo(void) {
|
|||||||
|
|
||||||
//Print
|
//Print
|
||||||
if (CHECK_NULL() && irc_status == IRCC_PRIVMSG)
|
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)
|
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);
|
printf("[N] %s is know as %s\n", client.irc_nick, client.irc_msg);
|
||||||
@ -78,4 +78,3 @@ int main(void) {
|
|||||||
|
|
||||||
recvinfo();
|
recvinfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user