From 434e44a5556e86a3e01e00a84357b683aca26ff7 Mon Sep 17 00:00:00 2001 From: nishi Date: Wed, 21 Feb 2024 22:24:33 +0000 Subject: [PATCH] irc git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@248 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/IRC.c | 9 +++++++++ Library/W3IRC.h | 1 + W3Version.h.m4 | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Library/IRC.c b/Library/IRC.c index 45c71d6..2a4d329 100644 --- a/Library/IRC.c +++ b/Library/IRC.c @@ -45,6 +45,11 @@ void __W3_IRC_Request(struct W3* w3) { __W3_Auto_Write(w3, "NICK ", 5); __W3_Auto_Write(w3, nickname, strlen(nickname)); __W3_Auto_Write(w3, "\r\n", 2); + if(__W3_Get_Prop(w3, "IRC_PASSWORD") != NULL){ + __W3_Auto_Write(w3, "PASS :", 6); + __W3_Auto_Write(w3, __W3_Get_Prop(w3, "IRC_PASSWORD"), strlen(__W3_Get_Prop(w3, "IRC_PASSWORD"))); + __W3_Auto_Write(w3, "\r\n", 2); + } char* buf = malloc(w3->readsize); int phase = 0; /* 0: before the prefix * 1: prefix @@ -215,6 +220,10 @@ void W3_IRC_Set_Nickname(struct W3* w3, const char* nickname){ __W3_Add_Prop(w3, "IRC_NICKNAME", nickname); } +void W3_IRC_Set_Password(struct W3* w3, const char* password){ + __W3_Add_Prop(w3, "IRC_PASSWORD", password); +} + void W3_IRC_Send_Request(struct W3* w3){ __W3_Auto_Write(w3, w3->method, strlen(w3->method)); __W3_Auto_Write(w3, " ", 1); diff --git a/Library/W3IRC.h b/Library/W3IRC.h index bdd4b8b..c24fb88 100644 --- a/Library/W3IRC.h +++ b/Library/W3IRC.h @@ -14,6 +14,7 @@ void W3_IRC_Set_Hostname(struct W3* w3, const char* hostname); void W3_IRC_Set_Realname(struct W3* w3, const char* realname); void W3_IRC_Set_Servername(struct W3* w3, const char* servername); void W3_IRC_Set_Nickname(struct W3* w3, const char* nickname); +void W3_IRC_Set_Password(struct W3* w3, const char* password); void W3_IRC_Send_Request(struct W3* w3); void W3_IRC_Disconnect(struct W3* w3); diff --git a/W3Version.h.m4 b/W3Version.h.m4 index 7f9f494..b8366d7 100644 --- a/W3Version.h.m4 +++ b/W3Version.h.m4 @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "2.17B" \ +#define LIBW3_VERSION "2.17C" \ SUFFIX ifdef(`HTTP_SUPPORT', `#define LIBW3_HTTP_SUPPORT', `') -- 2.43.0