mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Moved roster handlers to server_events
This commit is contained in:
parent
4bcd766d34
commit
b8672d709a
@ -133,22 +133,6 @@ prof_handle_not_in_group(const char * const contact,
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
prof_handle_group_add(const char * const contact,
|
||||
const char * const group)
|
||||
{
|
||||
ui_group_added(contact, group);
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
prof_handle_group_remove(const char * const contact,
|
||||
const char * const group)
|
||||
{
|
||||
ui_group_removed(contact, group);
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
prof_handle_roster_add(const char * const barejid, const char * const name)
|
||||
{
|
||||
@ -156,13 +140,6 @@ prof_handle_roster_add(const char * const barejid, const char * const name)
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
prof_handle_roster_remove(const char * const barejid)
|
||||
{
|
||||
ui_roster_remove(barejid);
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
prof_handle_disconnect(const char * const jid)
|
||||
{
|
||||
|
@ -35,10 +35,7 @@ void prof_handle_idle(void);
|
||||
void prof_handle_activity(void);
|
||||
void prof_handle_duck_help(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 contact, const char * const group);
|
||||
void prof_handle_not_in_group(const char * const contact, const char * const group);
|
||||
void prof_handle_group_add(const char * const contact, const char * const group);
|
||||
void prof_handle_group_remove(const char * const contact, const char * const group);
|
||||
|
||||
#endif
|
||||
|
@ -343,3 +343,26 @@ handle_room_member_nick_change(const char * const room,
|
||||
ui_room_member_nick_change(room, old_nick, nick);
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
handle_group_add(const char * const contact,
|
||||
const char * const group)
|
||||
{
|
||||
ui_group_added(contact, group);
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
handle_group_remove(const char * const contact,
|
||||
const char * const group)
|
||||
{
|
||||
ui_group_removed(contact, group);
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
||||
void
|
||||
handle_roster_remove(const char * const barejid)
|
||||
{
|
||||
ui_roster_remove(barejid);
|
||||
ui_current_page_off();
|
||||
}
|
||||
|
@ -66,5 +66,10 @@ void handle_room_member_offline(const char * const room, const char * const nick
|
||||
const char * const show, const char * const status);
|
||||
void handle_room_member_nick_change(const char * const room,
|
||||
const char * const old_nick, const char * const nick);
|
||||
void handle_group_add(const char * const contact,
|
||||
const char * const group);
|
||||
void handle_group_remove(const char * const contact,
|
||||
const char * const group);
|
||||
void handle_roster_remove(const char * const barejid);
|
||||
|
||||
#endif
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "profanity.h"
|
||||
#include "server_events.h"
|
||||
#include "tools/autocomplete.h"
|
||||
#include "xmpp/connection.h"
|
||||
#include "xmpp/roster.h"
|
||||
@ -149,7 +150,7 @@ _group_add_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
{
|
||||
if (userdata != NULL) {
|
||||
GroupData *data = userdata;
|
||||
prof_handle_group_add(data->name, data->group);
|
||||
handle_group_add(data->name, data->group);
|
||||
free(data->name);
|
||||
free(data->group);
|
||||
free(userdata);
|
||||
@ -196,7 +197,7 @@ _group_remove_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
{
|
||||
if (userdata != NULL) {
|
||||
GroupData *data = userdata;
|
||||
prof_handle_group_remove(data->name, data->group);
|
||||
handle_group_remove(data->name, data->group);
|
||||
free(data->name);
|
||||
free(data->group);
|
||||
free(userdata);
|
||||
@ -240,7 +241,7 @@ _roster_handle_push(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
|
||||
roster_remove(name, barejid);
|
||||
|
||||
prof_handle_roster_remove(barejid);
|
||||
handle_roster_remove(barejid);
|
||||
|
||||
// otherwise update local roster
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user