# HG changeset patch # User Mark Doliner # Date 1177181676 0 # Node ID aae14296a3499ac4179b05ab5e72fe93b149b3f3 # Parent a910080ccf8b5486cb422e9e0ee680857087f1da Only make sure the master group exists in the event we need to add an item. diff -r a910080ccf8b -r aae14296a349 libpurple/protocols/oscar/family_feedbag.c --- a/libpurple/protocols/oscar/family_feedbag.c Sat Apr 21 17:11:35 2007 +0000 +++ b/libpurple/protocols/oscar/family_feedbag.c Sat Apr 21 18:54:36 2007 +0000 @@ -1043,13 +1043,14 @@ if (!od) return -EINVAL; - /* Make sure the master group exists */ - if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) - aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); + /* Find the PDINFO item, or add it if it does not exist */ + if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PDINFO))) { + /* Make sure the master group exists */ + if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) + aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); - /* Find the PDINFO item, or add it if it does not exist */ - if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PDINFO))) tmp = aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0xFFFF, AIM_SSI_TYPE_PDINFO, NULL); + } /* Need to add the 0x00ca TLV to the TLV chain */ aim_tlvlist_replace_8(&tmp->data, 0x00ca, permdeny); @@ -1079,12 +1080,12 @@ if (!od || !iconsum || !iconsumlen) return -EINVAL; - /* Make sure the master group exists */ - if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) - aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); - /* 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))) { + /* Make sure the master group exists */ + if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) + aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); + tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0xFFFF, AIM_SSI_TYPE_ICONINFO, NULL); } @@ -1136,13 +1137,14 @@ if (!od) return -EINVAL; - /* Make sure the master group exists */ - if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) - aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); + /* Find the PRESENCEPREFS item, or add it if it does not exist */ + if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PRESENCEPREFS))) { + /* Make sure the master group exists */ + if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) + aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); - /* Find the PRESENCEPREFS item, or add it if it does not exist */ - if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PRESENCEPREFS))) tmp = aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0xFFFF, AIM_SSI_TYPE_PRESENCEPREFS, NULL); + } /* Need to add the x00c9 TLV to the TLV chain */ aim_tlvlist_replace_32(&tmp->data, 0x00c9, presence);