1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Use current jid for /blocked add in chat win

This commit is contained in:
James Booth 2016-05-01 20:06:34 +01:00
parent b8c94376aa
commit 5a48b7b7d5

View File

@ -2998,14 +2998,20 @@ cmd_blocked(ProfWin *window, const char *const command, gchar **args)
}
if (g_strcmp0(args[0], "add") == 0) {
if (args[1] == NULL) {
char *jid = args[1];
if (jid == NULL && (window->type == WIN_CHAT)) {
ProfChatWin *chatwin = (ProfChatWin*)window;
jid = chatwin->barejid;
}
if (jid == NULL) {
cons_bad_cmd_usage(command);
return TRUE;
}
gboolean res = blocked_add(args[1]);
gboolean res = blocked_add(jid);
if (!res) {
cons_show("User %s already blocked.", args[1]);
cons_show("User %s already blocked.", jid);
}
return TRUE;