mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 23:06:21 +00:00
Add nickname support for /roster remove
Add support of name/nickname instead of only JID for `/roster remove` command. Add tests for it as well.
This commit is contained in:
@@ -83,6 +83,7 @@ int main(int argc, char* argv[]) {
|
||||
PROF_FUNC_TEST(sends_new_item),
|
||||
PROF_FUNC_TEST(sends_new_item_nick),
|
||||
PROF_FUNC_TEST(sends_remove_item),
|
||||
PROF_FUNC_TEST(sends_remove_item_nick),
|
||||
PROF_FUNC_TEST(sends_nick_change),
|
||||
|
||||
PROF_FUNC_TEST(send_software_version_request),
|
||||
|
||||
@@ -92,6 +92,35 @@ sends_remove_item(void **state)
|
||||
assert_true(prof_output_exact("Roster item removed: buddy1@localhost"));
|
||||
}
|
||||
|
||||
void
|
||||
sends_remove_item_nick(void **state)
|
||||
{
|
||||
prof_connect_with_roster(
|
||||
"<item jid='buddy1@localhost' name='Bobby' subscription='both'/>"
|
||||
"<item jid='buddy2@localhost' subscription='both'/>"
|
||||
);
|
||||
|
||||
stbbr_for_query("jabber:iq:roster",
|
||||
"<iq id='*' type='set'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='buddy1@localhost' subscription='remove'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
);
|
||||
|
||||
prof_input("/roster remove Bobby");
|
||||
|
||||
assert_true(stbbr_received(
|
||||
"<iq type='set' id='*'>"
|
||||
"<query xmlns='jabber:iq:roster'>"
|
||||
"<item jid='buddy1@localhost' subscription='remove'/>"
|
||||
"</query>"
|
||||
"</iq>"
|
||||
));
|
||||
|
||||
assert_true(prof_output_exact("Roster item removed: buddy1@localhost"));
|
||||
}
|
||||
|
||||
void
|
||||
sends_nick_change(void **state)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
void sends_new_item(void **state);
|
||||
void sends_new_item_nick(void **state);
|
||||
void sends_remove_item(void **state);
|
||||
void sends_remove_item_nick(void **state);
|
||||
void sends_nick_change(void **state);
|
||||
|
||||
Reference in New Issue
Block a user