static void jabber_add_buddy(struct im_connection *ic, char *who, char *group) { if (g_strcasecmp(who, JABBER_XMLCONSOLE_HANDLE) == 0) { jabber_xmlconsole_enable(ic); return; } if (jabber_add_to_roster(ic, who, NULL, group)) { presence_send_request(ic, who, "subscribe"); } }
static void jabber_add_buddy( struct im_connection *ic, char *who, char *group ) { struct jabber_data *jd = ic->proto_data; if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) { jd->flags |= JFLAG_XMLCONSOLE; imcb_add_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); return; } if( jabber_add_to_roster( ic, who, NULL, group ) ) presence_send_request( ic, who, "subscribe" ); }
static void jabber_remove_buddy( struct im_connection *ic, char *who, char *group ) { struct jabber_data *jd = ic->proto_data; if( g_strcasecmp( who, JABBER_XMLCONSOLE_HANDLE ) == 0 ) { jd->flags &= ~JFLAG_XMLCONSOLE; /* Not necessary for now. And for now the code isn't too happy if the buddy is completely gone right after calling this function already. imcb_remove_buddy( ic, JABBER_XMLCONSOLE_HANDLE, NULL ); */ return; } /* We should always do this part. Clean up our administration a little bit. */ jabber_buddy_remove_bare( ic, who ); if( jabber_remove_from_roster( ic, who ) ) presence_send_request( ic, who, "unsubscribe" ); }