comparison src/protocols/oscar/ssi.c @ 4243:eae97ca4bbea

[gaim-migrate @ 4493] Guess what? Another SSI patch! This one fixes the automatic deletion of empty groups upon signin. The problem was that apparently WinICQ handles empty groups slightly differently than WinAIM. It's all good now. Uh, I fixed some comments. Oh, and moving a buddy that you've requested authorization from to a different group. I don't know if that used to give you the dialog that prompted if you wanted to send another auth request, but it shouldn't anymore (as long as you have sent 1 auth request). I also changed the button title for ICQ's receive contacts. I changed it from "Deny" to "Decline." Thanks to Nathan for pointing that out. I am to Time Warner as spiders are to the bottom of my shoe. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 08 Jan 2003 04:06:20 +0000
parents 0e4be672f516
children ea8fb193f5a0
comparison
equal deleted inserted replaced
4242:cf19d8102b34 4243:eae97ca4bbea
88 return group; 88 return group;
89 } 89 }
90 90
91 /** 91 /**
92 * Locally add a new item to the given item list. 92 * Locally add a new item to the given item list.
93 *
94 * XXX - This should copy data, not just use it.
95 * 93 *
96 * @param list A pointer to a pointer to the current list of items. 94 * @param list A pointer to a pointer to the current list of items.
97 * @param name A null terminated string of the name of the new item, or NULL if the 95 * @param name A null terminated string of the name of the new item, or NULL if the
98 * item should have no name. 96 * item should have no name.
99 * @param gid The group ID# you want the new item to have, or 0xFFFF if we should pick something. 97 * @param gid The group ID# you want the new item to have, or 0xFFFF if we should pick something.
429 } 427 }
430 return NULL; 428 return NULL;
431 } 429 }
432 430
433 /** 431 /**
432 * Locally find if you are waiting for authorization for a buddy.
433 *
434 * @param list A pointer to the current list of items.
435 * @return A pointer to a NULL terminated string that is the buddies
436 * alias, or NULL if the buddy has no alias. You should free
437 * this returned value!
438 */
439 faim_export int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn)
440 {
441 struct aim_ssi_item *cur = aim_ssi_itemlist_finditem(list, gn, sn, AIM_SSI_TYPE_BUDDY);
442 if (cur) {
443 aim_tlvlist_t *tlvlist = cur->data;
444 if (tlvlist)
445 if (aim_gettlv(tlvlist, 0x0066, 1))
446 return 1;
447 }
448 return 0;
449 }
450
451 /**
434 * If there are changes, then create temporary items and 452 * If there are changes, then create temporary items and
435 * call addmoddel. 453 * call addmoddel.
436 * 454 *
437 * @param sess The oscar session. 455 * @param sess The oscar session.
438 * @param conn The bos connection for this session. 456 * @param conn The bos connection for this session.
632 if ((cur->type == AIM_SSI_TYPE_BUDDY) && (cur->gid == 0x0000)) 650 if ((cur->type == AIM_SSI_TYPE_BUDDY) && (cur->gid == 0x0000))
633 aim_ssi_delbuddy(sess, conn, cur->name, NULL); 651 aim_ssi_delbuddy(sess, conn, cur->name, NULL);
634 652
635 /* Check if there are empty groups */ 653 /* Check if there are empty groups */
636 for (cur=sess->ssi.local; cur; cur=cur->next) 654 for (cur=sess->ssi.local; cur; cur=cur->next)
637 if ((cur->type == AIM_SSI_TYPE_GROUP) && (!cur->data)) 655 if (cur->type == AIM_SSI_TYPE_GROUP) {
638 aim_ssi_itemlist_del(&sess->ssi.local, cur); 656 aim_tlv_t *tlv = aim_gettlv(cur->data, 0x00c8, 1);
657 if (!cur->data || !tlv || !tlv->length)
658 aim_ssi_itemlist_del(&sess->ssi.local, cur);
659 }
639 660
640 /* Check if the master group is empty */ 661 /* Check if the master group is empty */
641 if ((cur = aim_ssi_itemlist_find(sess->ssi.local, 0x0000, 0x0000)) && (!cur->data)) 662 if ((cur = aim_ssi_itemlist_find(sess->ssi.local, 0x0000, 0x0000)) && (!cur->data))
642 aim_ssi_itemlist_del(&sess->ssi.local, cur); 663 aim_ssi_itemlist_del(&sess->ssi.local, cur);
643 664
860 * @param sn The name of the buddy to be moved. 881 * @param sn The name of the buddy to be moved.
861 * @return Return 0 if no errors, otherwise return the error number. 882 * @return Return 0 if no errors, otherwise return the error number.
862 */ 883 */
863 faim_export int aim_ssi_movebuddy(aim_session_t *sess, aim_conn_t *conn, const char *oldgn, const char *newgn, const char *sn) 884 faim_export int aim_ssi_movebuddy(aim_session_t *sess, aim_conn_t *conn, const char *oldgn, const char *newgn, const char *sn)
864 { 885 {
865 aim_ssi_addbuddy(sess, conn, sn, newgn, aim_ssi_getalias(sess->ssi.local, oldgn, sn), NULL, NULL, 0); 886 aim_ssi_addbuddy(sess, conn, sn, newgn, aim_ssi_getalias(sess->ssi.local, oldgn, sn), NULL, NULL, aim_ssi_waitingforauth(sess->ssi.local, oldgn, sn));
866 aim_ssi_delbuddy(sess, conn, sn, oldgn); 887 aim_ssi_delbuddy(sess, conn, sn, oldgn);
867 return 0; 888 return 0;
868 } 889 }
869 890
870 /** 891 /**
1020 return ret; 1041 return ret;
1021 } 1042 }
1022 1043
1023 /* 1044 /*
1024 * Subtype 0x0004 - Request SSI Data. 1045 * Subtype 0x0004 - Request SSI Data.
1025 * XXX - If you don't a timestamp and revision number? 1046 * XXX - If you don't have a timestamp and revision number?
1026 * 1047 *
1027 * Note that the client should never increment the revision, only the server. 1048 * Note that the client should never increment the revision, only the server.
1028 * 1049 *
1029 */ 1050 */
1030 1051