mirror of
https://github.com/moparisthebest/hexchat
synced 2025-02-10 04:10:22 -05:00
add %u to userlist popups for account
This commit is contained in:
parent
477d7470c1
commit
86cf7de430
@ -48,7 +48,7 @@ ctcp_reply (session *sess, char *nick, char *word[], char *word_eol[],
|
|||||||
/* process %C %B etc */
|
/* process %C %B etc */
|
||||||
check_special_chars (conf, TRUE);
|
check_special_chars (conf, TRUE);
|
||||||
auto_insert (tbuf, sizeof (tbuf), conf, word, word_eol, "", "", word_eol[5],
|
auto_insert (tbuf, sizeof (tbuf), conf, word, word_eol, "", "", word_eol[5],
|
||||||
server_get_network (sess->server, TRUE), "", "", nick);
|
server_get_network (sess->server, TRUE), "", "", nick, "");
|
||||||
free (conf);
|
free (conf);
|
||||||
handle_command (sess, tbuf, FALSE);
|
handle_command (sess, tbuf, FALSE);
|
||||||
}
|
}
|
||||||
|
@ -3856,7 +3856,7 @@ help (session *sess, char *tbuf, char *helpcmd, int quiet)
|
|||||||
int
|
int
|
||||||
auto_insert (char *dest, int destlen, unsigned char *src, char *word[],
|
auto_insert (char *dest, int destlen, unsigned char *src, char *word[],
|
||||||
char *word_eol[], char *a, char *c, char *d, char *e, char *h,
|
char *word_eol[], char *a, char *c, char *d, char *e, char *h,
|
||||||
char *n, char *s)
|
char *n, char *s, char *u)
|
||||||
{
|
{
|
||||||
int num;
|
int num;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
@ -3953,6 +3953,8 @@ auto_insert (char *dest, int destlen, unsigned char *src, char *word[],
|
|||||||
utf = ctime (&now);
|
utf = ctime (&now);
|
||||||
utf[19] = 0;
|
utf[19] = 0;
|
||||||
break;
|
break;
|
||||||
|
case 'u':
|
||||||
|
utf = u; break;
|
||||||
case 'v':
|
case 'v':
|
||||||
utf = PACKAGE_VERSION; break;
|
utf = PACKAGE_VERSION; break;
|
||||||
break;
|
break;
|
||||||
@ -4172,7 +4174,7 @@ user_command (session * sess, char *tbuf, char *cmd, char *word[],
|
|||||||
{
|
{
|
||||||
if (!auto_insert (tbuf, 2048, cmd, word, word_eol, "", sess->channel, "",
|
if (!auto_insert (tbuf, 2048, cmd, word, word_eol, "", sess->channel, "",
|
||||||
server_get_network (sess->server, TRUE), "",
|
server_get_network (sess->server, TRUE), "",
|
||||||
sess->server->nick, ""))
|
sess->server->nick, "", ""))
|
||||||
{
|
{
|
||||||
PrintText (sess, _("Bad arguments for user command.\n"));
|
PrintText (sess, _("Bad arguments for user command.\n"));
|
||||||
return;
|
return;
|
||||||
|
@ -24,7 +24,7 @@ extern const struct commands xc_cmds[];
|
|||||||
extern GSList *menu_list;
|
extern GSList *menu_list;
|
||||||
|
|
||||||
int auto_insert (char *dest, int destlen, unsigned char *src, char *word[], char *word_eol[],
|
int auto_insert (char *dest, int destlen, unsigned char *src, char *word[], char *word_eol[],
|
||||||
char *a, char *c, char *d, char *e, char *h, char *n, char *s);
|
char *a, char *c, char *d, char *e, char *h, char *n, char *s, char *u);
|
||||||
int handle_command (session *sess, char *cmd, int check_spch);
|
int handle_command (session *sess, char *cmd, int check_spch);
|
||||||
void process_data_init (char *buf, char *cmd, char *word[], char *word_eol[], gboolean handle_quotes, gboolean allow_escape_quotes);
|
void process_data_init (char *buf, char *cmd, char *word[], char *word_eol[], gboolean handle_quotes, gboolean allow_escape_quotes);
|
||||||
void handle_multiline (session *sess, char *cmd, int history, int nocommand);
|
void handle_multiline (session *sess, char *cmd, int history, int nocommand);
|
||||||
|
@ -2141,7 +2141,7 @@ mg_dialog_button_cb (GtkWidget *wid, char *cmd)
|
|||||||
|
|
||||||
auto_insert (buf, sizeof (buf), cmd, 0, 0, "", "", "",
|
auto_insert (buf, sizeof (buf), cmd, 0, 0, "", "", "",
|
||||||
server_get_network (current_sess->server, TRUE), host, "",
|
server_get_network (current_sess->server, TRUE), host, "",
|
||||||
current_sess->channel);
|
current_sess->channel, "");
|
||||||
|
|
||||||
handle_command (current_sess, buf, TRUE);
|
handle_command (current_sess, buf, TRUE);
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@ nick_command_parse (session *sess, char *cmd, char *nick, char *allnick)
|
|||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
char *host = _("Host unknown");
|
char *host = _("Host unknown");
|
||||||
|
char *account = _("Account unknown");
|
||||||
struct User *user;
|
struct User *user;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
@ -125,8 +126,13 @@ nick_command_parse (session *sess, char *cmd, char *nick, char *allnick)
|
|||||||
} else*/
|
} else*/
|
||||||
{
|
{
|
||||||
user = userlist_find (sess, nick);
|
user = userlist_find (sess, nick);
|
||||||
if (user && user->hostname)
|
if (user)
|
||||||
host = strchr (user->hostname, '@') + 1;
|
{
|
||||||
|
if (user->hostname)
|
||||||
|
host = strchr (user->hostname, '@') + 1;
|
||||||
|
if (user->account)
|
||||||
|
account = user->account;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this can't overflow, since popup->cmd is only 256 */
|
/* this can't overflow, since popup->cmd is only 256 */
|
||||||
@ -135,7 +141,7 @@ nick_command_parse (session *sess, char *cmd, char *nick, char *allnick)
|
|||||||
|
|
||||||
auto_insert (buf, len, cmd, 0, 0, allnick, sess->channel, "",
|
auto_insert (buf, len, cmd, 0, 0, allnick, sess->channel, "",
|
||||||
server_get_network (sess->server, TRUE), host,
|
server_get_network (sess->server, TRUE), host,
|
||||||
sess->server->nick, nick);
|
sess->server->nick, nick, account);
|
||||||
|
|
||||||
nick_command (sess, buf);
|
nick_command (sess, buf);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user