Command history: allow "next history" to jump back to last msg in

history if we already went over it with "prev history" once.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1365 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-03-08 00:45:56 +00:00 committed by cras
commit f5d67dcb5c
3 changed files with 77 additions and 51 deletions

View file

@ -190,12 +190,12 @@ static void cmd_unquery(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
query_destroy(query);
}
/* SYNTAX: QUERY [-window] <nick> */
/* SYNTAX: QUERY [-window] [-<server tag>] <nick> [<message>] */
static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
GHashTable *optlist;
QUERY_REC *query;
char *nick;
char *nick, *msg;
void *free_arg;
g_return_if_fail(data != NULL);
@ -206,9 +206,9 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
return;
}
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
PARAM_FLAG_UNKNOWN_OPTIONS,
"query", &optlist, &nick))
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST |
PARAM_FLAG_OPTIONS | PARAM_FLAG_UNKNOWN_OPTIONS,
"query", &optlist, &nick, &msg))
return;
if (*nick == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
@ -253,6 +253,16 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
(SIGNAL_FUNC) signal_query_created_curwin);
}
if (*msg != '\0') {
/* FIXME: we'll need some function that does both
of these. and separate the , and . target handling
from own_private messagge.. */
server->send_message(server, nick, msg);
signal_emit("message own_private", 4,
server, msg, nick, nick);
}
cmd_params_free(free_arg);
}