1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

query_find() didn't check for queries with no active server

Some DCC CHAT format fixes


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1097 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-01-09 18:56:56 +00:00 committed by cras
parent d6ee17e8cd
commit f8f1f814a5
3 changed files with 14 additions and 7 deletions

View File

@ -216,7 +216,8 @@ abstracts = {
dccfile = "%_$0-%_";
# DCC chat, own msg/action
dccownmsg = "[%r$0%K(%R$1-%K)%n] ";
dccownmsg = "[%r$0%K($1-%K)%n] ";
dccownnick = "%R$0-%n";
dccownaction = "{action $0-}";
# DCC chat, others

View File

@ -96,7 +96,7 @@ static QUERY_REC *query_find_server(SERVER_REC *server, const char *nick)
for (tmp = server->queries; tmp != NULL; tmp = tmp->next) {
QUERY_REC *rec = tmp->data;
if (g_strcasecmp(nick, rec->name) == 0)
if (g_strcasecmp(rec->name, nick) == 0)
return rec;
}
@ -105,16 +105,22 @@ static QUERY_REC *query_find_server(SERVER_REC *server, const char *nick)
QUERY_REC *query_find(SERVER_REC *server, const char *nick)
{
GSList *tmp;
g_return_val_if_fail(server == NULL || IS_SERVER(server), NULL);
g_return_val_if_fail(nick != NULL, NULL);
if (server != NULL)
return query_find_server(server, nick);
/* find from any server */
return gslist_foreach_find(servers,
(FOREACH_FIND_FUNC) query_find_server,
(void *) nick);
for (tmp = queries; tmp != NULL; tmp = tmp->next) {
QUERY_REC *rec = tmp->data;
if (g_strcasecmp(rec->name, nick) == 0)
return rec;
}
return NULL;
}
void query_change_nick(QUERY_REC *query, const char *nick)

View File

@ -32,7 +32,7 @@ FORMAT_REC fecommon_irc_dcc_formats[] = {
{ "own_dcc_ctcp", "{ownctcp ctcp $0}$1 $2", 3, { 0, 0, 0 } },
{ "dcc_msg", "{dccmsg dcc $0}$1", 2, { 0, 0 } },
{ "action_dcc", "{dccaction $0}$1", 2, { 0, 0 } },
{ "own_dcc_query", "{ownmsgnick {msgownnick $0}}$2", 3, { 0, 0, 0 } },
{ "own_dcc_query", "{ownmsgnick {ownnick $0}}$2", 3, { 0, 0, 0 } },
{ "dcc_msg_query", "{privmsgnick $0}$1", 2, { 0, 0 } },
{ "dcc_ctcp", "{dcc >>> DCC CTCP received from {hilight $0}: $1}", 2, { 0, 0 } },
{ "dcc_chat", "{dcc DCC CHAT from {nick $0} [$1 port $2]}", 3, { 0, 0, 1 } },