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

Removed prof_handle group functions

This commit is contained in:
James Booth 2014-01-05 23:24:48 +00:00
parent 1d716e48ad
commit 76484665fd
5 changed files with 14 additions and 54 deletions

View File

@ -1009,8 +1009,13 @@ cmd_group(gchar **args, struct cmd_help_t help)
return TRUE; return TRUE;
} }
roster_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); roster_send_add_to_group(group, pcontact);
}
return TRUE; return TRUE;
} }
@ -1036,8 +1041,13 @@ cmd_group(gchar **args, struct cmd_help_t help)
return TRUE; return TRUE;
} }
roster_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); roster_send_remove_from_group(group, pcontact);
}
return TRUE; return TRUE;
} }

View File

@ -117,22 +117,6 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
g_timer_destroy(timer); g_timer_destroy(timer);
} }
void
prof_handle_already_in_group(const char * const contact,
const char * const group)
{
ui_contact_already_in_group(contact, group);
ui_current_page_off();
}
void
prof_handle_not_in_group(const char * const contact,
const char * const group)
{
ui_contact_not_in_group(contact, group);
ui_current_page_off();
}
void void
prof_handle_roster_add(const char * const barejid, const char * const name) prof_handle_roster_add(const char * const barejid, const char * const name)
{ {

View File

@ -31,7 +31,5 @@ void prof_run(const int disable_tls, char *log_level, char *account_name);
void prof_handle_idle(void); void prof_handle_idle(void);
void prof_handle_activity(void); void prof_handle_activity(void);
void prof_handle_roster_add(const char * const barejid, const char * const name); void prof_handle_roster_add(const char * const barejid, const char * const name);
void prof_handle_already_in_group(const char * const contact, const char * const group);
void prof_handle_not_in_group(const char * const contact, const char * const group);
#endif #endif

View File

@ -334,36 +334,6 @@ roster_get_group(const char * const group)
return result; return result;
} }
void
roster_add_to_group(const char * const group, PContact contact)
{
assert(contact != NULL);
if (p_contact_in_group(contact, group)) {
if (p_contact_name(contact) != NULL) {
prof_handle_already_in_group(p_contact_name(contact), group);
} else {
prof_handle_already_in_group(p_contact_barejid(contact), group);
}
return;
}
}
void
roster_remove_from_group(const char * const group, PContact contact)
{
assert(contact != NULL);
if (!p_contact_in_group(contact, group)) {
if (p_contact_name(contact) != NULL) {
prof_handle_not_in_group(p_contact_name(contact), group);
} else {
prof_handle_not_in_group(p_contact_barejid(contact), group);
}
return;
}
}
GSList * GSList *
roster_get_groups(void) roster_get_groups(void)
{ {

View File

@ -50,8 +50,6 @@ char * roster_find_contact(char *search_str);
char * roster_find_resource(char *search_str); char * roster_find_resource(char *search_str);
GSList * roster_get_group(const char * const group); GSList * roster_get_group(const char * const group);
GSList * roster_get_groups(void); GSList * roster_get_groups(void);
void roster_add_to_group(const char * const group, PContact contact);
void roster_remove_from_group(const char * const group, PContact contact);
char * roster_find_group(char *search_str); char * roster_find_group(char *search_str);
char * roster_find_jid(char *search_str); char * roster_find_jid(char *search_str);