Mercurial > pidgin
comparison libpurple/protocols/oscar/family_feedbag.c @ 16297:aae14296a349
Only make sure the master group exists in the event we need to add an
item.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 21 Apr 2007 18:54:36 +0000 |
parents | 234b645ada99 |
children | 6a974950d2a8 |
comparison
equal
deleted
inserted
replaced
16294:a910080ccf8b | 16297:aae14296a349 |
---|---|
1041 struct aim_ssi_item *tmp; | 1041 struct aim_ssi_item *tmp; |
1042 | 1042 |
1043 if (!od) | 1043 if (!od) |
1044 return -EINVAL; | 1044 return -EINVAL; |
1045 | 1045 |
1046 /* Make sure the master group exists */ | |
1047 if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) | |
1048 aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); | |
1049 | |
1050 /* Find the PDINFO item, or add it if it does not exist */ | 1046 /* Find the PDINFO item, or add it if it does not exist */ |
1051 if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PDINFO))) | 1047 if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PDINFO))) { |
1048 /* Make sure the master group exists */ | |
1049 if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) | |
1050 aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); | |
1051 | |
1052 tmp = aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0xFFFF, AIM_SSI_TYPE_PDINFO, NULL); | 1052 tmp = aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0xFFFF, AIM_SSI_TYPE_PDINFO, NULL); |
1053 } | |
1053 | 1054 |
1054 /* Need to add the 0x00ca TLV to the TLV chain */ | 1055 /* Need to add the 0x00ca TLV to the TLV chain */ |
1055 aim_tlvlist_replace_8(&tmp->data, 0x00ca, permdeny); | 1056 aim_tlvlist_replace_8(&tmp->data, 0x00ca, permdeny); |
1056 | 1057 |
1057 /* Need to add the 0x00cb TLV to the TLV chain */ | 1058 /* Need to add the 0x00cb TLV to the TLV chain */ |
1077 guint8 *csumdata; | 1078 guint8 *csumdata; |
1078 | 1079 |
1079 if (!od || !iconsum || !iconsumlen) | 1080 if (!od || !iconsum || !iconsumlen) |
1080 return -EINVAL; | 1081 return -EINVAL; |
1081 | 1082 |
1082 /* Make sure the master group exists */ | |
1083 if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) | |
1084 aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); | |
1085 | |
1086 /* Find the ICONINFO item, or add it if it does not exist */ | 1083 /* Find the ICONINFO item, or add it if it does not exist */ |
1087 if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) { | 1084 if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) { |
1085 /* Make sure the master group exists */ | |
1086 if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) | |
1087 aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); | |
1088 | |
1088 tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0xFFFF, AIM_SSI_TYPE_ICONINFO, NULL); | 1089 tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0xFFFF, AIM_SSI_TYPE_ICONINFO, NULL); |
1089 } | 1090 } |
1090 | 1091 |
1091 /* Need to add the 0x00d5 TLV to the TLV chain */ | 1092 /* Need to add the 0x00d5 TLV to the TLV chain */ |
1092 csumdata = (guint8 *)malloc((iconsumlen+2)*sizeof(guint8)); | 1093 csumdata = (guint8 *)malloc((iconsumlen+2)*sizeof(guint8)); |
1134 struct aim_ssi_item *tmp; | 1135 struct aim_ssi_item *tmp; |
1135 | 1136 |
1136 if (!od) | 1137 if (!od) |
1137 return -EINVAL; | 1138 return -EINVAL; |
1138 | 1139 |
1139 /* Make sure the master group exists */ | |
1140 if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) | |
1141 aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); | |
1142 | |
1143 /* Find the PRESENCEPREFS item, or add it if it does not exist */ | 1140 /* Find the PRESENCEPREFS item, or add it if it does not exist */ |
1144 if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PRESENCEPREFS))) | 1141 if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, NULL, AIM_SSI_TYPE_PRESENCEPREFS))) { |
1142 /* Make sure the master group exists */ | |
1143 if (aim_ssi_itemlist_find(od->ssi.local, 0x0000, 0x0000) == NULL) | |
1144 aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0x0000, AIM_SSI_TYPE_GROUP, NULL); | |
1145 | |
1145 tmp = aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0xFFFF, AIM_SSI_TYPE_PRESENCEPREFS, NULL); | 1146 tmp = aim_ssi_itemlist_add(&od->ssi.local, NULL, 0x0000, 0xFFFF, AIM_SSI_TYPE_PRESENCEPREFS, NULL); |
1147 } | |
1146 | 1148 |
1147 /* Need to add the x00c9 TLV to the TLV chain */ | 1149 /* Need to add the x00c9 TLV to the TLV chain */ |
1148 aim_tlvlist_replace_32(&tmp->data, 0x00c9, presence); | 1150 aim_tlvlist_replace_32(&tmp->data, 0x00c9, presence); |
1149 | 1151 |
1150 /* Sync our local list with the server list */ | 1152 /* Sync our local list with the server list */ |