1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Show message when contact already in group

This commit is contained in:
James Booth 2013-06-23 16:29:42 +01:00
parent f9b8da1afe
commit 265fff8f40
5 changed files with 21 additions and 0 deletions

View File

@ -148,6 +148,14 @@ prof_handle_duck_result(const char * const result)
ui_current_page_off();
}
void
prof_handle_already_in_group(const char * const barejid,
const char * const group)
{
ui_contact_already_in_group(barejid, group);
ui_current_page_off();
}
void
prof_handle_error_message(const char *from, const char *err_msg)
{

View File

@ -82,5 +82,6 @@ void prof_handle_duck_help(const char * const result);
void prof_handle_duck_result(const char * const result);
void prof_handle_roster_add(const char * const barejid, const char * const name);
void prof_handle_roster_remove(const char * const barejid);
void prof_handle_already_in_group(const char * const barejid, const char * const group);
#endif

View File

@ -455,6 +455,12 @@ ui_roster_remove(const char * const barejid)
cons_show("Roster item removed: %s", barejid);
}
void
ui_contact_already_in_group(const char * const barejid, const char * const group)
{
cons_show("%s already in group %s", barejid, group);
}
void
ui_contact_online(const char * const barejid, const char * const resource,
const char * const show, const char * const status, GDateTime *last_activity)

View File

@ -114,6 +114,7 @@ void ui_room_member_presence(const char * const room,
const char * const nick, const char * const show, const char * const status);
void ui_roster_add(const char * const barejid, const char * const name);
void ui_roster_remove(const char * const barejid);
void ui_contact_already_in_group(const char * const barejid, const char * const group);
// contact status functions
void ui_status_room(const char * const contact);

View File

@ -293,6 +293,11 @@ roster_add_to_group(const char * const group, const char * const barejid)
if (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;
}