From: <the...@us...> - 2006-06-29 08:14:32
|
Revision: 16372 Author: thekingant Date: 2006-06-29 01:14:29 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16372&view=rev Log Message: ----------- Some comments changes, and: 1. Don't buddy icons in Jabber 2. When clearing your buddy icon in oscar, do it the same way that WinAIM does it Modified Paths: -------------- trunk/src/blist.h trunk/src/protocols/jabber/presence.c trunk/src/protocols/oscar/family_feedbag.c trunk/src/protocols/oscar/family_oservice.c trunk/src/protocols/oscar/oscar.h Modified: trunk/src/blist.h =================================================================== --- trunk/src/blist.h 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/blist.h 2006-06-29 08:14:29 UTC (rev 16372) @@ -286,6 +286,7 @@ /** * Sets the server-sent alias of a buddy in the buddy list. + * PRPLs should call serv_got_alias() instead of this. * * @param buddy The buddy whose alias will be changed. * @param alias The buddy's "official" alias. Modified: trunk/src/protocols/jabber/presence.c =================================================================== --- trunk/src/protocols/jabber/presence.c 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/jabber/presence.c 2006-06-29 08:14:29 UTC (rev 16372) @@ -256,13 +256,14 @@ char hash[41], *p; int i; - gaim_cipher_digest_region("sha1", (guchar *)data, size, + gaim_cipher_digest_region("sha1", data, size, sizeof(hashval), hashval, NULL); p = hash; for(i=0; i<20; i++, p+=2) snprintf(p, 3, "%02x", hashval[i]); gaim_blist_node_set_string((GaimBlistNode*)b, "avatar_hash", hash); } + g_free(data); g_free(text); } } Modified: trunk/src/protocols/oscar/family_feedbag.c =================================================================== --- trunk/src/protocols/oscar/family_feedbag.c 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/oscar/family_feedbag.c 2006-06-29 08:14:29 UTC (rev 16372) @@ -1089,7 +1089,7 @@ * @param iconcsumlen Length of the MD5 checksum given above. Should be 0x10 bytes. * @return Return 0 if no errors, otherwise return the error number. */ -int aim_ssi_seticon(OscarData *od, guint8 *iconsum, guint16 iconsumlen) +int aim_ssi_seticon(OscarData *od, const guint8 *iconsum, guint16 iconsumlen) { struct aim_ssi_item *tmp; guint8 *csumdata; @@ -1099,13 +1099,12 @@ /* Find the ICONINFO item, or add it if it does not exist */ if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) { - tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0x51F4, AIM_SSI_TYPE_ICONINFO, NULL); + tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0xFFFF, AIM_SSI_TYPE_ICONINFO, NULL); } /* Need to add the 0x00d5 TLV to the TLV chain */ csumdata = (guint8 *)malloc((iconsumlen+2)*sizeof(guint8)); - csumdata[0] = 0x00; - csumdata[1] = 0x10; + aimutil_put16(&csumdata[0], iconsumlen); memcpy(&csumdata[2], iconsum, iconsumlen); aim_tlvlist_replace_raw(&tmp->data, 0x00d5, (iconsumlen+2) * sizeof(guint8), csumdata); free(csumdata); @@ -1122,23 +1121,17 @@ * Remove a reference to a server stored buddy icon. This will make your * icon stop showing up to other people. * - * @param od The oscar odion. + * Really this function just sets the icon to a dummy value. It's weird... + * but I think the dummy value basically means "I don't have an icon!" + * + * @param od The oscar session. * @return Return 0 if no errors, otherwise return the error number. */ int aim_ssi_delicon(OscarData *od) { - struct aim_ssi_item *tmp; + const guint8 csumdata[] = {0x02, 0x01, 0xd2, 0x04, 0x72}; - if (!od) - return -EINVAL; - - /* Find the ICONINFO item and delete it if it exists*/ - if ((tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) - aim_ssi_itemlist_del(&od->ssi.local, tmp); - - /* Sync our local list with the server list */ - aim_ssi_sync(od); - return 0; + return aim_ssi_seticon(od, csumdata, 5); } /** Modified: trunk/src/protocols/oscar/family_oservice.c =================================================================== --- trunk/src/protocols/oscar/family_oservice.c 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/oscar/family_oservice.c 2006-06-29 08:14:29 UTC (rev 16372) @@ -1064,6 +1064,11 @@ flags = byte_stream_get8(bs); length = byte_stream_get8(bs); + /* + * A flag of 0x01 could mean "this is the checksum we have for you" + * A flag of 0x40 could mean "I don't have your icon, upload it" + */ + if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) { switch (type) { case 0x0000: Modified: trunk/src/protocols/oscar/oscar.h =================================================================== --- trunk/src/protocols/oscar/oscar.h 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/oscar/oscar.h 2006-06-29 08:14:29 UTC (rev 16372) @@ -1161,7 +1161,7 @@ int aim_ssi_deletelist(OscarData *od); int aim_ssi_setpermdeny(OscarData *od, guint8 permdeny, guint32 vismask); int aim_ssi_setpresence(OscarData *od, guint32 presence); -int aim_ssi_seticon(OscarData *od, guint8 *iconsum, guint16 iconsumlen); +int aim_ssi_seticon(OscarData *od, const guint8 *iconsum, guint16 iconsumlen); int aim_ssi_delicon(OscarData *od); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |