diff options
author | James Booth <boothj5@gmail.com> | 2015-07-08 21:05:20 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-07-08 21:05:20 +0100 |
commit | 051c6ed50e0972bfcfac08000e4fbc8a08b6e083 (patch) | |
tree | bcd9b8f58cdd9c4384979446eb396812dfd3c810 /src | |
parent | 9a5fe29caa230a5229c26470ef693d2fc102add6 (diff) | |
download | profani-tty-051c6ed50e0972bfcfac08000e4fbc8a08b6e083.tar.gz |
Check for self jid on /software
fixed #592
Diffstat (limited to 'src')
-rw-r--r-- | src/command/commands.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 757b8115..396aa880 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -2109,13 +2109,17 @@ cmd_software(ProfWin *window, gchar **args, struct cmd_help_t help) case WIN_CHAT: case WIN_CONSOLE: if (args[0]) { + Jid *myJid = jid_create(jabber_get_fulljid()); Jid *jid = jid_create(args[0]); if (jid == NULL || jid->fulljid == NULL) { cons_show("You must provide a full jid to the /software command."); + } else if (g_strcmp0(jid->barejid, myJid->barejid) == 0) { + cons_show("Cannot request software version for yourself."); } else { iq_send_software_version(jid->fulljid); } + jid_destroy(myJid); jid_destroy(jid); } else { cons_show("You must provide a jid to the /software command."); |