gaim/gaim

sf patch #1166667, from Bleeter Yaluser
oldstatus
2005-03-19, Mark Doliner
aeeb47a7d41a
Parents c87fcedc8d25
Children 1603d2de5774
sf patch #1166667, from Bleeter Yaluser
Make some Yahoo! things a little better. My genius idea to
get rid of the hardcoded "0" didn't work out because I'm dumb...
But I think this is ok for now. Thoughts?
--- a/src/protocols/yahoo/yahoo.c Sat Mar 19 19:56:52 2005 -0500
+++ b/src/protocols/yahoo/yahoo.c Sat Mar 19 20:19:32 2005 -0500
@@ -77,19 +77,22 @@
gboolean permitted=FALSE;
switch (gc->account->perm_deny) {
- /* it would appear somewhere inside gaim, GAIM_PRIVACY can end up
- * being set to 0 */
case 0:
+ gaim_debug_warning("yahoo", "Privacy setting was 0. If you can "
+ "reproduce this, please file a bug report.\n");
permitted = TRUE;
break;
+
case GAIM_PRIVACY_ALLOW_ALL:
permitted = TRUE;
break;
+
case GAIM_PRIVACY_DENY_ALL:
gaim_debug_info("yahoo",
"%s blocked data received from %s (GAIM_PRIVACY_DENY_ALL)\n",
gc->account->username,who);
break;
+
case GAIM_PRIVACY_ALLOW_USERS:
for( list=gc->account->permit; list!=NULL; list=list->next ) {
if ( !gaim_utf8_strcasecmp(who, gaim_normalize(gc->account, (char *)list->data)) ) {
@@ -101,6 +104,7 @@
}
}
break;
+
case GAIM_PRIVACY_DENY_USERS:
/* seeing we're letting everyone through, except the deny list*/
permitted=TRUE;
@@ -114,6 +118,7 @@
break;
}
break;
+
case GAIM_PRIVACY_ALLOW_BUDDYLIST:
if ( gaim_find_buddy(gc->account,who) != NULL ) {
permitted = TRUE;
@@ -123,13 +128,15 @@
gc->account->username,who);
}
break;
- default:
- gaim_debug(GAIM_DEBUG_INFO, "yahoo",
- "Default privacy dropthrough - we should never see this. Please report yahoo privacy bug to http://gaim.sf.net\n");
- permitted = FALSE;
- break;
+
+ default:
+ gaim_debug_warning("yahoo", "Privacy setting was unknown. If you can "
+ "reproduce this, please file a bug report.\n");
+ permitted = FALSE;
+ break;
}
-return permitted;
+
+ return permitted;
}
struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id)
@@ -805,6 +812,16 @@
gc->account->perm_deny = 4;
serv_set_permit_deny(gc);
}
+
+ if (got_serv_list &&
+ ((gc->account->perm_deny != GAIM_PRIVACY_ALLOW_BUDDYLIST) &&
+ (gc->account->perm_deny != GAIM_PRIVACY_DENY_ALL) &&
+ (gc->account->perm_deny != GAIM_PRIVACY_ALLOW_USERS)))
+ {
+ gc->account->perm_deny = GAIM_PRIVACY_DENY_USERS;
+ gaim_debug_info("yahoo", "Privacy defaulting to GAIM_PRIVACY_DENY_USERS.\n", gc->account->username);
+ }
+
}
static void yahoo_process_notify(GaimConnection *gc, struct yahoo_packet *pkt)