diff options
author | James Booth <boothj5@gmail.com> | 2014-01-05 23:24:48 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-01-05 23:24:48 +0000 |
commit | 76484665fd0df4e559f7a6732819130dc98b68a7 (patch) | |
tree | c2cf9a007672d887cd4a39bca7dc53540e8827a8 /src/command | |
parent | 1d716e48adf7dc6a2639131450c1ca74d48ea105 (diff) | |
download | profani-tty-76484665fd0df4e559f7a6732819130dc98b68a7.tar.gz |
Removed prof_handle group functions
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/commands.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 57a6b151..e6588c11 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1009,8 +1009,13 @@ cmd_group(gchar **args, struct cmd_help_t help) return TRUE; } - roster_add_to_group(group, pcontact); - roster_send_add_to_group(group, pcontact); + if (p_contact_in_group(pcontact, group)) { + const char *display_name = p_contact_name_or_jid(pcontact); + ui_contact_already_in_group(display_name, group); + ui_current_page_off(); + } else { + roster_send_add_to_group(group, pcontact); + } return TRUE; } @@ -1036,8 +1041,13 @@ cmd_group(gchar **args, struct cmd_help_t help) return TRUE; } - roster_remove_from_group(group, pcontact); - roster_send_remove_from_group(group, pcontact); + if (!p_contact_in_group(pcontact, group)) { + const char *display_name = p_contact_name_or_jid(pcontact); + ui_contact_not_in_group(display_name, group); + ui_current_page_off(); + } else { + roster_send_remove_from_group(group, pcontact); + } return TRUE; } |