From 995913b4be70be6e07b8aa7661ac639e5fc0d6e7 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 2 Oct 2006 19:46:57 +0200 Subject: Added some error handling for the (not very complete yet) privacy list code. --- protocols/jabber/jabber.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'protocols/jabber/jabber.c') diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c index 8ec6b70c..39d93d16 100644 --- a/protocols/jabber/jabber.c +++ b/protocols/jabber/jabber.c @@ -41,8 +41,7 @@ static void jabber_acc_init( account_t *acc ) s = set_add( &acc->set, "priority", "0", set_eval_priority, acc ); - s = set_add( &acc->set, "privacy_list", NULL, NULL, acc ); - /* TODO: Add evaluator. */ + s = set_add( &acc->set, "privacy_list", NULL, set_eval_privacy_list, acc ); s = set_add( &acc->set, "resource", "BitlBee", NULL, acc ); s->flags |= ACC_SET_OFFLINE_ONLY; @@ -231,12 +230,24 @@ static void jabber_keepalive( struct gaim_connection *gc ) static void jabber_add_permit( struct gaim_connection *gc, char *who ) { - presence_send_request( gc, who, "subscribed" ); + struct jabber_data *jd = gc->proto_data; + + if( jd->flags & JFLAG_PRIVACY_BROKEN ) + { + serv_got_crap( gc, "Privacy lists not supported by this server" ); + return; + } } static void jabber_rem_permit( struct gaim_connection *gc, char *who ) { - presence_send_request( gc, who, "unsubscribed" ); + struct jabber_data *jd = gc->proto_data; + + if( jd->flags & JFLAG_PRIVACY_BROKEN ) + { + serv_got_crap( gc, "Privacy lists not supported by this server" ); + return; + } } /* XMPP doesn't have both a block- and and allow-list, so these two functions -- cgit v1.2.3