1
0
forked from bip/bip

/msg to -bip is now equivalent to /quote bip.

This commit is contained in:
nohar 2007-01-12 18:34:45 +00:00
parent 8b46e5f04f
commit ccd2274772
4 changed files with 36 additions and 26 deletions

View File

@ -1,3 +1,7 @@
2006-01-12 Arnaud Cornet <arnaud.cornet@gmail.com>
* src/irc.c: /msg to -bip is now equivalent to /quote bip.
2006-01-07 Arnaud Cornet <arnaud.cornet@gmail.com>
* *: Backlog fixes.

View File

@ -1242,57 +1242,59 @@ void adm_away_nick(struct link_client *ic, char *val)
link->away_nick = strdup(val);
}
int adm_bip(struct link_client *ic, struct line *line);
int adm_bip(struct link_client *ic, struct line *line)
int adm_bip(struct link_client *ic, struct line *line, unsigned int privmsg)
{
char *nick;
if (LINK(ic)->l_server)
nick = LINK(ic)->l_server->nick;
else
nick = LINK(ic)->prev_nick;
if (line->elemc < 2)
if (line->elemc < privmsg + 2)
return OK_FORGET;
if (strcasecmp(line->elemv[1], "RELOAD") == 0) {
if (strcasecmp(line->elemv[privmsg + 1], "RELOAD") == 0) {
reloading_client = ic;
sighup = 1;
} else if (strcasecmp(line->elemv[1], "LIST") == 0) {
} else if (strcasecmp(line->elemv[privmsg + 1], "LIST") == 0) {
write_user_list(CONN(ic), nick);
} else if (strcasecmp(line->elemv[1], "JUMP") == 0) {
} else if (strcasecmp(line->elemv[privmsg + 1], "JUMP") == 0) {
if (LINK(ic)->l_server) {
WRITE_LINE1(CONN(LINK(ic)->l_server), NULL, "QUIT",
"jumpin' jumpin'");
connection_close(CONN(LINK(ic)->l_server));
}
} else if (strcasecmp(line->elemv[1], "BLRESET") == 0) {
} else if (strcasecmp(line->elemv[privmsg + 1], "BLRESET") == 0) {
adm_blreset(ic);
} else if (strcasecmp(line->elemv[1], "HELP") == 0) {
} else if (strcasecmp(line->elemv[privmsg + 1], "HELP") == 0) {
WRITE_LINE2(CONN(ic), P_IRCMASK, "PRIVMSG", nick,
"/BIP (RELOAD|LIST|JUMP|BLRESET|HELP)");
} else if (strcasecmp(line->elemv[1], "FOLLOW_NICK") == 0) {
if (line->elemc != 3)
} else if (strcasecmp(line->elemv[privmsg + 1], "FOLLOW_NICK") == 0) {
if (line->elemc != privmsg + 3)
return OK_FORGET;
adm_follow_nick(ic, line->elemv[2]);
} else if (strcasecmp(line->elemv[1], "IGNORE_FIRST_NICK") == 0) {
if (line->elemc != 3)
adm_follow_nick(ic, line->elemv[privmsg + 2]);
} else if (strcasecmp(line->elemv[privmsg + 1],
"IGNORE_FIRST_NICK") == 0) {
if (line->elemc != privmsg + 3)
return OK_FORGET;
adm_ignore_first_nick(ic, line->elemv[2]);
} else if (strcasecmp(line->elemv[1], "ON_CONNECT_SEND") == 0) {
if (line->elemc == 2)
adm_ignore_first_nick(ic, line->elemv[privmsg + 2]);
} else if (strcasecmp(line->elemv[privmsg + 1],
"ON_CONNECT_SEND") == 0) {
if (line->elemc == privmsg + 2)
adm_on_connect_send(ic, NULL);
else if (line->elemc == 3)
adm_on_connect_send(ic, line->elemv[2]);
else if (line->elemc == privmsg + 3)
adm_on_connect_send(ic, line->elemv[privmsg + 2]);
else
return OK_FORGET;
} else if (strcasecmp(line->elemv[1], "AWAY_NICK") == 0) {
if (line->elemc == 2)
} else if (strcasecmp(line->elemv[privmsg + 1], "AWAY_NICK") == 0) {
if (line->elemc == privmsg + 2)
adm_away_nick(ic, NULL);
else if (line->elemc == 3)
adm_away_nick(ic, line->elemv[2]);
else if (line->elemc == privmsg + 3)
adm_away_nick(ic, line->elemv[privmsg + 2]);
else
return OK_FORGET;
#ifdef HAVE_LIBSSL
} else if (strcasecmp(line->elemv[1], "TRUST") == 0) {
} else if (strcasecmp(line->elemv[privmsg + 1], "TRUST") == 0) {
return adm_trust(ic, line);
#endif
}

View File

@ -66,7 +66,7 @@ struct c_channel
#ifdef HAVE_LIBSSL
int adm_trust(struct link_client *ic, struct line *line);
#endif
int adm_bip(struct link_client *ic, struct line *line);
int adm_bip(struct link_client *ic, struct line *line, unsigned int privmsg);
int ssl_check_trust(struct link_client *ic);
void adm_blreset(struct link_client *ic);

View File

@ -684,7 +684,7 @@ void unbind_from_link(struct link_client *ic)
int irc_cli_bip(struct link_client *ic, struct line *line)
{
return adm_bip(ic, line);
return adm_bip(ic, line, 0);
}
#define PASS_SEP ':'
@ -946,8 +946,12 @@ static int irc_cli_quit(struct link_client *ic, struct line *line)
static int irc_cli_privmsg(struct link_client *ic, struct line *line)
{
if (line->elemc >= 3)
log_cli_privmsg(LINK(ic)->log, LINK(ic)->l_server->nick,
line->elemv[1], line->elemv[2]);
if (strcmp(line->elemv[1], "-bip") == 0)
return adm_bip(ic, line, 1);
if (conf_blreset_on_talk)
adm_blreset(ic);
return OK_COPY_CLI;