annotate plugins/perl/common/BuddyList_Group.xs @ 10296:a7b2fd5efcf2

[gaim-migrate @ 11476] Some "random updates" updates from patch 1077274 by Felipe Contreras: "Some changes in the behaviour of slpcalls (for FT), free some unused structures and properly close switchboard connections." Looks good to me, and seems to have fixed a mysterious FT problem that I had been pretending didn't exist. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 02 Dec 2004 16:07:26 +0000
parents 7a8aa87164ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 #include "module.h"
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 MODULE = Gaim::BuddyList::Group PACKAGE = Gaim::BuddyList::Group PREFIX = gaim_group_
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 PROTOTYPES: ENABLE
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 Gaim::BuddyList::Group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 new(name)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 const char *name
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 RETVAL = gaim_group_new(name);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 void
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 rename(group, new_name)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 const char *new_name
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 gaim_blist_rename_group(group, new_name);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 void
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 get_accounts(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 PREINIT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 GSList *l;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 PPCODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 for (l = gaim_group_get_accounts(group); l != NULL; l = l->next)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account")));
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 int
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 get_size(group, offline)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 gboolean offline
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 RETVAL = gaim_blist_get_group_size(group, offline);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 const char *
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 get_name(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 RETVAL = group->name;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 int
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 get_online_count(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 CODE:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 RETVAL = gaim_blist_get_group_online_count(group);
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 OUTPUT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 RETVAL
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 void
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 buddies(group)
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 Gaim::BuddyList::Group group
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 PREINIT:
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 GaimBlistNode *node;
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
60 GaimBlistNode *contact;
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 GaimBlistNode *_group = (GaimBlistNode *)group;
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 PPCODE:
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
63 for (contact = _group->child; contact != NULL; contact = contact->next)
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 {
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
65 for (node = contact->child; node != NULL; node = node->next)
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
66 {
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
67 XPUSHs(sv_2mortal(gaim_perl_bless_object(node,
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
68 "Gaim::BuddyList::Buddy")));
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
69 }
6542
fe0294504602 [gaim-migrate @ 7064]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 }
6922
1d994e9b81f9 [gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents: 6542
diff changeset
71