mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Removed roster_list dependency on xmpp module
This commit is contained in:
parent
06ce95f68a
commit
1d716e48ad
@ -1009,7 +1009,8 @@ cmd_group(gchar **args, struct cmd_help_t help)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
roster_add_to_group(group, barejid);
|
||||
roster_add_to_group(group, pcontact);
|
||||
roster_send_add_to_group(group, pcontact);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1035,7 +1036,8 @@ cmd_group(gchar **args, struct cmd_help_t help)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
roster_remove_from_group(group, barejid);
|
||||
roster_remove_from_group(group, pcontact);
|
||||
roster_send_remove_from_group(group, pcontact);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "jid.h"
|
||||
#include "tools/autocomplete.h"
|
||||
#include "profanity.h"
|
||||
#include "xmpp/xmpp.h"
|
||||
|
||||
// nicknames
|
||||
static Autocomplete name_ac;
|
||||
@ -336,11 +335,10 @@ roster_get_group(const char * const group)
|
||||
}
|
||||
|
||||
void
|
||||
roster_add_to_group(const char * const group, const char * const barejid)
|
||||
roster_add_to_group(const char * const group, PContact contact)
|
||||
{
|
||||
PContact contact = g_hash_table_lookup(contacts, barejid);
|
||||
assert(contact != NULL);
|
||||
|
||||
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);
|
||||
@ -349,18 +347,13 @@ roster_add_to_group(const char * const group, const char * const barejid)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
roster_send_add_to_group(group, contact);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
roster_remove_from_group(const char * const group, const char * const barejid)
|
||||
roster_remove_from_group(const char * const group, PContact contact)
|
||||
{
|
||||
PContact contact = g_hash_table_lookup(contacts, barejid);
|
||||
assert(contact != NULL);
|
||||
|
||||
if (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);
|
||||
@ -369,9 +362,6 @@ roster_remove_from_group(const char * const group, const char * const barejid)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
roster_send_remove_from_group(group, contact);
|
||||
}
|
||||
}
|
||||
|
||||
GSList *
|
||||
|
@ -50,8 +50,8 @@ char * roster_find_contact(char *search_str);
|
||||
char * roster_find_resource(char *search_str);
|
||||
GSList * roster_get_group(const char * const group);
|
||||
GSList * roster_get_groups(void);
|
||||
void roster_add_to_group(const char * const group, const char * const barejid);
|
||||
void roster_remove_from_group(const char * const group, const char * const barejid);
|
||||
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_jid(char *search_str);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user