mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Use current jid for /blocked add in chat win
This commit is contained in:
parent
b8c94376aa
commit
5a48b7b7d5
@ -2998,14 +2998,20 @@ cmd_blocked(ProfWin *window, const char *const command, gchar **args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_strcmp0(args[0], "add") == 0) {
|
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);
|
cons_bad_cmd_usage(command);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean res = blocked_add(args[1]);
|
gboolean res = blocked_add(jid);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
cons_show("User %s already blocked.", args[1]);
|
cons_show("User %s already blocked.", jid);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user