comparison plugins/icq/contacts.c @ 1309:0a766047b4fd

[gaim-migrate @ 1319] Yay, new icqlib committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 19 Dec 2000 10:08:29 +0000
parents 201ec77f3a60
children 4c510ca3563f
comparison
equal deleted inserted replaced
1308:4741b5a75b9f 1309:0a766047b4fd
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* 2 /*
3 $Id: contacts.c 1162 2000-11-28 02:22:42Z warmenhoven $ 3 $Id: contacts.c 1319 2000-12-19 10:08:29Z warmenhoven $
4 $Log$ 4 $Log$
5 Revision 1.1 2000/11/28 02:22:42 warmenhoven 5 Revision 1.2 2000/12/19 10:08:29 warmenhoven
6 icq. whoop de doo 6 Yay, new icqlib
7
8 Revision 1.5 2000/12/19 06:00:07 bills
9 moved members from ICQLINK to ICQLINK_private struct
7 10
8 Revision 1.4 2000/06/17 16:38:45 denis 11 Revision 1.4 2000/06/17 16:38:45 denis
9 New parameter was added in icq_ContactSetVis() for setting/resetting 12 New parameter was added in icq_ContactSetVis() for setting/resetting
10 'Visible to User' status. 13 'Visible to User' status.
11 Port's type was changed to unsigned short in icq_UserOnline callback. 14 Port's type was changed to unsigned short in icq_UserOnline callback.
23 */ 26 */
24 27
25 #include <stdlib.h> 28 #include <stdlib.h>
26 #include <stdarg.h> 29 #include <stdarg.h>
27 30
31 #include "icq.h"
32 #include "icqlib.h"
28 #include "icqtypes.h" 33 #include "icqtypes.h"
29 #include "util.h" 34 #include "util.h"
30 #include "icq.h"
31 #include "list.h" 35 #include "list.h"
32 #include "contacts.h" 36 #include "contacts.h"
33 37
34 icq_ContactItem *icq_ContactNew(ICQLINK *link) 38 icq_ContactItem *icq_ContactNew(ICQLINK *link)
35 { 39 {
51 { 55 {
52 icq_ContactItem *p = icq_ContactNew(link); 56 icq_ContactItem *p = icq_ContactNew(link);
53 p->uin = cuin; 57 p->uin = cuin;
54 p->vis_list = FALSE; 58 p->vis_list = FALSE;
55 59
56 list_enqueue(link->icq_ContactList, p); 60 list_enqueue(link->d->icq_ContactList, p);
57 } 61 }
58 62
59 void icq_ContactRemove(ICQLINK *link, DWORD cuin) 63 void icq_ContactRemove(ICQLINK *link, DWORD cuin)
60 { 64 {
61 icq_ContactItem *pcontact=icq_ContactFind(link, cuin); 65 icq_ContactItem *pcontact=icq_ContactFind(link, cuin);
62 66
63 if (pcontact) 67 if (pcontact)
64 { 68 {
65 list_remove(link->icq_ContactList, pcontact); 69 list_remove(link->d->icq_ContactList, pcontact);
66 icq_ContactDelete(pcontact); 70 icq_ContactDelete(pcontact);
67 } 71 }
68 } 72 }
69 73
70 void icq_ContactClear(ICQLINK *link) 74 void icq_ContactClear(ICQLINK *link)
71 { 75 {
72 list_delete(link->icq_ContactList, icq_ContactDelete); 76 list_delete(link->d->icq_ContactList, icq_ContactDelete);
73 link->icq_ContactList=list_new(); 77 link->d->icq_ContactList=list_new();
74 } 78 }
75 79
76 int _icq_ContactFind(void *p, va_list data) 80 int _icq_ContactFind(void *p, va_list data)
77 { 81 {
78 DWORD uin=va_arg(data, DWORD); 82 DWORD uin=va_arg(data, DWORD);
80 return (((icq_ContactItem *)p)->uin == uin); 84 return (((icq_ContactItem *)p)->uin == uin);
81 } 85 }
82 86
83 icq_ContactItem *icq_ContactFind(ICQLINK *link, DWORD cuin) 87 icq_ContactItem *icq_ContactFind(ICQLINK *link, DWORD cuin)
84 { 88 {
85 return list_traverse(link->icq_ContactList, _icq_ContactFind, cuin); 89 return list_traverse(link->d->icq_ContactList, _icq_ContactFind, cuin);
86 } 90 }
87 91
88 void icq_ContactSetVis(ICQLINK *link, DWORD cuin, BYTE vu) 92 void icq_ContactSetVis(ICQLINK *link, DWORD cuin, BYTE vu)
89 { 93 {
90 icq_ContactItem *p = icq_ContactFind(link, cuin); 94 icq_ContactItem *p = icq_ContactFind(link, cuin);
92 p->vis_list = vu; 96 p->vis_list = vu;
93 } 97 }
94 98
95 icq_ContactItem *icq_ContactGetFirst(ICQLINK *link) 99 icq_ContactItem *icq_ContactGetFirst(ICQLINK *link)
96 { 100 {
97 return list_first(link->icq_ContactList); 101 return list_first(link->d->icq_ContactList);
98 } 102 }
99 103
100 icq_ContactItem *icq_ContactGetNext(icq_ContactItem *pcontact) 104 icq_ContactItem *icq_ContactGetNext(icq_ContactItem *pcontact)
101 { 105 {
102 list_node *p=list_find(pcontact->icqlink->icq_ContactList, pcontact); 106 list_node *p=list_find(pcontact->icqlink->d->icq_ContactList, pcontact);
103 107
104 if (p && p->next) 108 if (p && p->next)
105 return p->next->item; 109 return p->next->item;
106 else 110 else
107 return 0L; 111 return 0L;