voice storage bugfix, probably
This commit is contained in:
parent
486f28db9a
commit
b039415b93
3
TODO
3
TODO
|
@ -9,3 +9,6 @@ Before release:
|
||||||
TODO:
|
TODO:
|
||||||
- DCC proxying...
|
- DCC proxying...
|
||||||
- crypt logs
|
- crypt logs
|
||||||
|
|
||||||
|
- use gnutls
|
||||||
|
- MODE #channel and WHO #channel on join
|
||||||
|
|
|
@ -157,7 +157,7 @@ static void connect_trynext(connection_t *cn)
|
||||||
close(cn->handle);
|
close(cn->handle);
|
||||||
cn->handle = -1;
|
cn->handle = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cn->connected = CONN_ERROR;
|
cn->connected = CONN_ERROR;
|
||||||
connecting_data_free(cn->connecting_data);
|
connecting_data_free(cn->connecting_data);
|
||||||
cn->connecting_data = NULL;
|
cn->connecting_data = NULL;
|
||||||
|
@ -168,7 +168,7 @@ static void connect_trynext(connection_t *cn)
|
||||||
static X509 *mySSL_get_cert(SSL *ssl)
|
static X509 *mySSL_get_cert(SSL *ssl)
|
||||||
{
|
{
|
||||||
X509 *cert;
|
X509 *cert;
|
||||||
|
|
||||||
if (!ssl) {
|
if (!ssl) {
|
||||||
mylog(LOG_WARN, "mySSL_get_cert() No SSL context");
|
mylog(LOG_WARN, "mySSL_get_cert() No SSL context");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1070,12 +1070,12 @@ static connection_t *_connection_new(char *dsthostname, char *dstport,
|
||||||
char *srchostname, char *srcport, int timeout)
|
char *srchostname, char *srcport, int timeout)
|
||||||
{
|
{
|
||||||
connection_t *conn;
|
connection_t *conn;
|
||||||
|
|
||||||
printf("%s\n", dsthostname);
|
printf("%s\n", dsthostname);
|
||||||
|
|
||||||
conn = connection_init(1, 0, timeout, 0);
|
conn = connection_init(1, 0, timeout, 0);
|
||||||
create_socket(dsthostname, dstport, srchostname, srcport, conn);
|
create_socket(dsthostname, dstport, srchostname, srcport, conn);
|
||||||
|
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1352,10 +1352,10 @@ static connection_t *_connection_new_SSL(char *dsthostname, char *dstport,
|
||||||
" most recent used");
|
" most recent used");
|
||||||
*/
|
*/
|
||||||
SSL_set_connect_state(conn->ssl_h);
|
SSL_set_connect_state(conn->ssl_h);
|
||||||
|
|
||||||
/* Put our connection_t in the SSL object for the verify callback */
|
/* Put our connection_t in the SSL object for the verify callback */
|
||||||
SSL_set_ex_data(conn->ssl_h, ssl_cx_idx, conn);
|
SSL_set_ex_data(conn->ssl_h, ssl_cx_idx, conn);
|
||||||
|
|
||||||
create_socket(dsthostname, dstport, srchostname, srcport, conn);
|
create_socket(dsthostname, dstport, srchostname, srcport, conn);
|
||||||
|
|
||||||
return conn;
|
return conn;
|
||||||
|
|
68
src/irc.c
68
src/irc.c
|
@ -165,10 +165,10 @@ list_t *channel_name_list(struct channel *c)
|
||||||
strncat(str, " ", NAMESIZE);
|
strncat(str, " ", NAMESIZE);
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
if (n->ovmask == NICKOP) {
|
if (n->ovmask & NICKOP) {
|
||||||
strncat(str, "@", NAMESIZE);
|
strncat(str, "@", NAMESIZE);
|
||||||
len++;
|
len++;
|
||||||
} else if (n->ovmask == NICKVOICED) {
|
} else if (n->ovmask & NICKVOICED) {
|
||||||
strncat(str, "+", NAMESIZE);
|
strncat(str, "+", NAMESIZE);
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
|
@ -309,6 +309,16 @@ static void irc_server_connected(struct link_server *server)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int who_arg_to_ovmask(char *str)
|
||||||
|
{
|
||||||
|
int ovmask = 0;
|
||||||
|
if (strchr(str, '@'))
|
||||||
|
ovmask |= NICKOP;
|
||||||
|
if (strchr(str, '+'))
|
||||||
|
ovmask |= NICKVOICED;
|
||||||
|
return ovmask;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given the way irc nets disrespect the rfc, maybe we should completely forget
|
* Given the way irc nets disrespect the rfc, maybe we should completely forget
|
||||||
* about this damn ircmask...
|
* about this damn ircmask...
|
||||||
|
@ -317,22 +327,40 @@ static void irc_server_connected(struct link_server *server)
|
||||||
static int parse_352(struct link_server *server, struct line *line)
|
static int parse_352(struct link_server *server, struct line *line)
|
||||||
{
|
{
|
||||||
char *im;
|
char *im;
|
||||||
int ret = OK_FORGET;
|
|
||||||
if (line->elemc < 4)
|
|
||||||
return ERR_PROTOCOL;
|
|
||||||
if (strcmp(line->elemv[1], server->nick) != 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
im = malloc(strlen(server->nick) + strlen(line->elemv[3]) +
|
if (line->elemc < 8)
|
||||||
strlen(line->elemv[4]) + 2 + 1);
|
return ERR_PROTOCOL;
|
||||||
strcpy(im, server->nick);
|
|
||||||
strcat(im, "!");
|
if (strcmp(line->elemv[2], "*") == 0) {
|
||||||
strcat(im, line->elemv[3]);
|
if (server->irc_mask &&
|
||||||
strcat(im, "@");
|
strcmp(line->elemv[1], server->nick) == 0) {
|
||||||
strcat(im, line->elemv[4]);
|
im = malloc(strlen(server->nick) +
|
||||||
set_ircmask(server, im);
|
strlen(line->elemv[3]) +
|
||||||
free(im);
|
strlen(line->elemv[4]) + 2 + 1);
|
||||||
return ret;
|
strcpy(im, server->nick);
|
||||||
|
strcat(im, "!");
|
||||||
|
strcat(im, line->elemv[3]);
|
||||||
|
strcat(im, "@");
|
||||||
|
strcat(im, line->elemv[4]);
|
||||||
|
set_ircmask(server, im);
|
||||||
|
free(im);
|
||||||
|
return OK_FORGET;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
struct channel *channel;
|
||||||
|
struct nick *nick;
|
||||||
|
|
||||||
|
channel = hash_get(&server->channels, line->elemv[2]);
|
||||||
|
if (!channel)
|
||||||
|
return OK_COPY;
|
||||||
|
|
||||||
|
nick = hash_get(&channel->nicks, line->elemv[6]);
|
||||||
|
if (!nick)
|
||||||
|
return OK_COPY;
|
||||||
|
|
||||||
|
nick->ovmask = who_arg_to_ovmask(line->elemv[7]);
|
||||||
|
}
|
||||||
|
return OK_COPY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -346,10 +374,6 @@ int irc_dispatch_server(struct link_server *server, struct line *line)
|
||||||
if (line->elemc == 0)
|
if (line->elemc == 0)
|
||||||
return ERR_PROTOCOL;
|
return ERR_PROTOCOL;
|
||||||
|
|
||||||
if (!server->irc_mask &&
|
|
||||||
strcmp(line->elemv[0], "352") == 0) /* WHO RPL */
|
|
||||||
ret = parse_352(server, line);
|
|
||||||
|
|
||||||
if (strcmp(line->elemv[0], "PING") == 0) {
|
if (strcmp(line->elemv[0], "PING") == 0) {
|
||||||
if (line->elemc < 2)
|
if (line->elemc < 2)
|
||||||
return ERR_PROTOCOL;
|
return ERR_PROTOCOL;
|
||||||
|
@ -421,6 +445,8 @@ int irc_dispatch_server(struct link_server *server, struct line *line)
|
||||||
ret = irc_332(server, line);
|
ret = irc_332(server, line);
|
||||||
} else if (strcmp(line->elemv[0], "333") == 0) {
|
} else if (strcmp(line->elemv[0], "333") == 0) {
|
||||||
ret = irc_333(server, line);
|
ret = irc_333(server, line);
|
||||||
|
} else if (strcmp(line->elemv[0], "352") == 0) {
|
||||||
|
ret = parse_352(server, line);
|
||||||
} else if (strcmp(line->elemv[0], "353") == 0) {
|
} else if (strcmp(line->elemv[0], "353") == 0) {
|
||||||
ret = irc_353(server, line);
|
ret = irc_353(server, line);
|
||||||
} else if (strcmp(line->elemv[0], "366") == 0) {
|
} else if (strcmp(line->elemv[0], "366") == 0) {
|
||||||
|
|
Loading…
Reference in New Issue