# HG changeset patch # User Mark Doliner # Date 1151568869 0 # Node ID 2bac009eaa0c7b8692a66cee247044197fad4b4b # Parent 085b15c33ca49b5f8aebc03f43ba60fc67d9c2fa [gaim-migrate @ 16372] 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 committer: Tailor Script diff -r 085b15c33ca4 -r 2bac009eaa0c src/blist.h --- a/src/blist.h Wed Jun 28 19:42:20 2006 +0000 +++ b/src/blist.h Thu Jun 29 08:14:29 2006 +0000 @@ -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. diff -r 085b15c33ca4 -r 2bac009eaa0c src/protocols/jabber/presence.c --- a/src/protocols/jabber/presence.c Wed Jun 28 19:42:20 2006 +0000 +++ b/src/protocols/jabber/presence.c Thu Jun 29 08:14:29 2006 +0000 @@ -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); } } diff -r 085b15c33ca4 -r 2bac009eaa0c src/protocols/oscar/family_feedbag.c --- a/src/protocols/oscar/family_feedbag.c Wed Jun 28 19:42:20 2006 +0000 +++ b/src/protocols/oscar/family_feedbag.c Thu Jun 29 08:14:29 2006 +0000 @@ -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; - - if (!od) - return -EINVAL; + const guint8 csumdata[] = {0x02, 0x01, 0xd2, 0x04, 0x72}; - /* 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); } /** diff -r 085b15c33ca4 -r 2bac009eaa0c src/protocols/oscar/family_oservice.c --- a/src/protocols/oscar/family_oservice.c Wed Jun 28 19:42:20 2006 +0000 +++ b/src/protocols/oscar/family_oservice.c Thu Jun 29 08:14:29 2006 +0000 @@ -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: diff -r 085b15c33ca4 -r 2bac009eaa0c src/protocols/oscar/oscar.h --- a/src/protocols/oscar/oscar.h Wed Jun 28 19:42:20 2006 +0000 +++ b/src/protocols/oscar/oscar.h Thu Jun 29 08:14:29 2006 +0000 @@ -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);