libpurple/disco.c

Tue, 14 Apr 2009 08:39:39 +0000

author
Paul Aurich <darkrain42@pidgin.im>
date
Tue, 14 Apr 2009 08:39:39 +0000
changeset 26918
a87808a6c028
parent 26916
6cb5053eb433
child 26921
81e8285f1fb5
permissions
-rw-r--r--

XMPP prpl depends on the core's setting in-progress-ness

26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
1 /**
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
2 * @file disco.c Service Discovery API
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
3 * @ingroup core
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
4 */
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
5
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
6 /* purple
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
7 *
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
10 * source distribution.
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
11 *
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
16 *
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
21 *
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
25 */
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
26
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
27 #include "internal.h"
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
28 #include "debug.h"
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
29
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
30 #include "disco.h"
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
31
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
32 /**************************************************************************/
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
33 /* Main structures, members and constants */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
34 /**************************************************************************/
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
35
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
36 /**
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
37 * Represents a list of services for a given connection on a given protocol.
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
38 */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
39 struct _PurpleDiscoList {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
40 PurpleAccount *account; /**< The account this list belongs to. */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
41 GList *services; /**< The list of services. */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
42
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
43 gboolean in_progress;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
44
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
45 gpointer ui_data; /**< UI private data. */
26590
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
46 gpointer proto_data; /**< Prpl private data. */
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
47 guint ref; /**< The reference count. */
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
48
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
49 struct {
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
50 PurpleDiscoCancelFunc cancel_cb;
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
51 PurpleDiscoCloseFunc close_cb; /**< Callback to free the prpl data */
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
52 PurpleDiscoServiceCloseFunc service_close_cb;
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
53 PurpleDiscoServiceExpandFunc expand_cb; /**< Expand a service (iteratively
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
54 look for things that are
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
55 "sub-elements" in the tree */
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
56 PurpleDiscoRegisterFunc register_cb;
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
57 } ops;
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
58 };
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
59
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
60 /**
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
61 * Represents a list of services for a given connection on a given protocol.
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
62 */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
63 struct _PurpleDiscoService {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
64 PurpleDiscoList *list;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
65 gchar *name; /**< The name of the service. */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
66 gchar *description; /**< The name of the service. */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
67
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
68 gpointer proto_data;
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
69
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
70 gchar *gateway_type; /**< The type of the gateway service. */
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
71 PurpleDiscoServiceType type; /**< The type of service. */
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
72 PurpleDiscoServiceFlags flags;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
73 };
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
74
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
75 static PurpleDiscoUiOps *ops = NULL;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
76
26590
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
77 PurpleDiscoList *purple_disco_list_new(PurpleAccount *account)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
78 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
79 PurpleDiscoList *list;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
80
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
81 g_return_val_if_fail(account != NULL, NULL);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
82
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
83 list = g_new0(PurpleDiscoList, 1);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
84 list->account = account;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
85 list->ref = 1;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
86
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
87 if (ops && ops->create)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
88 ops->create(list);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
89
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
90 return list;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
91 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
92
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
93 PurpleDiscoList *purple_disco_list_ref(PurpleDiscoList *list)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
94 {
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
95 g_return_val_if_fail(list != NULL, NULL);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
96
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
97 list->ref++;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
98 purple_debug_misc("disco", "reffing list, ref count now %d\n", list->ref);
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
99
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
100 return list;
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
101 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
102
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
103 static void purple_disco_list_service_destroy(PurpleDiscoList *list, PurpleDiscoService *r)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
104 {
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
105 if (list->ops.service_close_cb)
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
106 list->ops.service_close_cb(r);
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
107
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
108 g_free(r->name);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
109 g_free(r->description);
26596
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
110 g_free(r->gateway_type);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
111 g_free(r);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
112 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
113
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
114 static void purple_disco_list_destroy(PurpleDiscoList *list)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
115 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
116 GList *l;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
117
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
118 purple_debug_misc("disco", "destroying list %p\n", list);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
119
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
120 if (ops && ops->destroy)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
121 ops->destroy(list);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
122
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
123 if (list->ops.close_cb)
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
124 list->ops.close_cb(list);
26590
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
125
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
126 for (l = list->services; l; l = l->next) {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
127 PurpleDiscoService *s = l->data;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
128 purple_disco_list_service_destroy(list, s);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
129 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
130 g_list_free(list->services);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
131
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
132 g_free(list);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
133 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
134
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
135 void purple_disco_list_unref(PurpleDiscoList *list)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
136 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
137 g_return_if_fail(list != NULL);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
138 g_return_if_fail(list->ref > 0);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
139
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
140 list->ref--;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
141
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
142 purple_debug_misc("disco", "unreffing list, ref count now %d\n", list->ref);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
143 if (list->ref == 0)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
144 purple_disco_list_destroy(list);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
145 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
146
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
147 void purple_disco_list_service_add(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
148 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
149 g_return_if_fail(list != NULL);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
150 g_return_if_fail(service != NULL);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
151
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
152 list->services = g_list_append(list->services, service);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
153 service->list = list;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
154
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
155 if (ops && ops->add_service)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
156 ops->add_service(list, service, parent);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
157 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
158
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
159 PurpleDiscoService *purple_disco_list_service_new(PurpleDiscoServiceType type,
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
160 const gchar *name, const gchar *description,
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
161 PurpleDiscoServiceFlags flags, gpointer proto_data)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
162 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
163 PurpleDiscoService *s;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
164
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
165 g_return_val_if_fail(name != NULL, NULL);
26596
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
166 g_return_val_if_fail(type != PURPLE_DISCO_SERVICE_TYPE_UNSET, NULL);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
167
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
168 s = g_new0(PurpleDiscoService, 1);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
169 s->name = g_strdup(name);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
170 s->type = type;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
171 s->description = g_strdup(description);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
172 s->flags = flags;
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
173 s->proto_data = proto_data;
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
174
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
175 return s;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
176 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
177
26590
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
178 PurpleDiscoList *purple_disco_get_list(PurpleConnection *pc)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
179 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
180 PurplePlugin *prpl = NULL;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
181 PurplePluginProtocolInfo *prpl_info = NULL;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
182
26590
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
183 g_return_val_if_fail(pc != NULL, NULL);
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
184
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
185 prpl = purple_connection_get_prpl(pc);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
186 if (prpl != NULL)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
187 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
188
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
189 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, disco_get_list))
26590
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
190 return prpl_info->disco_get_list(pc);
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
191
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
192 return NULL;
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
193 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
194
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
195 void purple_disco_cancel_get_list(PurpleDiscoList *list)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
196 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
197 g_return_if_fail(list != NULL);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
198
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
199 if (list->ops.cancel_cb)
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
200 list->ops.cancel_cb(list);
26591
29379646de02 The core should be in charge of setting in_progress to FALSE
Paul Aurich <darkrain42@pidgin.im>
parents: 26590
diff changeset
201
29379646de02 The core should be in charge of setting in_progress to FALSE
Paul Aurich <darkrain42@pidgin.im>
parents: 26590
diff changeset
202 purple_disco_list_set_in_progress(list, FALSE);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
203 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
204
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
205 void purple_disco_service_expand(PurpleDiscoService *service)
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
206 {
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
207 PurpleDiscoList *list;
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
208
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
209 g_return_if_fail(service != NULL);
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
210 g_return_if_fail((service->flags & PURPLE_DISCO_BROWSE) == PURPLE_DISCO_BROWSE);
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
211
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
212 list = service->list;
26918
a87808a6c028 XMPP prpl depends on the core's setting in-progress-ness
Paul Aurich <darkrain42@pidgin.im>
parents: 26916
diff changeset
213 purple_disco_list_set_in_progress(list, TRUE);
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
214
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
215 if (list->ops.expand_cb)
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
216 list->ops.expand_cb(list, service);
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
217 else
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
218 purple_debug_warning("disco", "Cannot expand %s for account %s, "
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
219 "protocol did not provide expand op.\n",
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
220 service->name,
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
221 purple_account_get_username(list->account));
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
222 }
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
223
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
224 void purple_disco_service_register(PurpleDiscoService *service)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
225 {
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
226 PurpleDiscoList *list;
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
227 PurpleConnection *pc;
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
228
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
229 g_return_if_fail(service != NULL);
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
230
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
231 list = service->list;
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
232 pc = purple_account_get_connection(list->account);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
233
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
234 g_return_if_fail(pc != NULL);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
235
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
236 if (list->ops.register_cb)
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
237 list->ops.register_cb(pc, service);
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
238 else
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
239 purple_debug_warning("disco", "Cannot register to %s for account %s, "
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
240 "protocol did not provide register op.\n",
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
241 service->name,
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
242 purple_account_get_username(list->account));
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
243 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
244
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
245 const gchar *purple_disco_service_get_name(PurpleDiscoService *service)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
246 {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
247 g_return_val_if_fail(service != NULL, NULL);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
248
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
249 return service->name;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
250 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
251
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
252 const gchar *purple_disco_service_get_description(PurpleDiscoService *service)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
253 {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
254 g_return_val_if_fail(service != NULL, NULL);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
255
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
256 return service->description;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
257 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
258
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
259 gpointer
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
260 purple_disco_service_get_protocol_data(PurpleDiscoService *service)
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
261 {
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
262 g_return_val_if_fail(service != NULL, NULL);
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
263
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
264 return service->proto_data;
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
265 }
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
266
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
267 PurpleDiscoServiceType
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
268 purple_disco_service_get_type(PurpleDiscoService *service)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
269 {
26596
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
270 g_return_val_if_fail(service != NULL, PURPLE_DISCO_SERVICE_TYPE_UNSET);
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
271
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
272 return service->type;
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
273 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
274
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
275 PurpleDiscoServiceFlags
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
276 purple_disco_service_get_flags(PurpleDiscoService *service)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
277 {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
278 g_return_val_if_fail(service != NULL, PURPLE_DISCO_NONE);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
279
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
280 return service->flags;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
281 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
282
26596
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
283 void purple_disco_service_set_gateway_type(PurpleDiscoService *service, const gchar *type)
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
284 {
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
285 g_return_if_fail(service != NULL);
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
286
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
287 g_free(service->gateway_type);
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
288 service->gateway_type = g_strdup(type);
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
289 }
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
290
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
291 const gchar *purple_disco_service_get_gateway_type(PurpleDiscoService *service)
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
292 {
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
293 g_return_val_if_fail(service != NULL, NULL);
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
294
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
295 return service->gateway_type;
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
296 }
d44a3a6a3046 s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <darkrain42@pidgin.im>
parents: 26591
diff changeset
297
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
298 PurpleAccount* purple_disco_list_get_account(PurpleDiscoList *list)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
299 {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
300 g_return_val_if_fail(list != NULL, NULL);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
301
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
302 return list->account;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
303 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
304
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
305 GList* purple_disco_list_get_services(PurpleDiscoList *list)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
306 {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
307 g_return_val_if_fail(list != NULL, NULL);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
308
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
309 return list->services;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
310 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
311
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
312 void purple_disco_list_set_ui_data(PurpleDiscoList *list, gpointer ui_data)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
313 {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
314 g_return_if_fail(list != NULL);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
315
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
316 list->ui_data = ui_data;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
317 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
318
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
319 gpointer purple_disco_list_get_ui_data(PurpleDiscoList *list)
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
320 {
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
321 g_return_val_if_fail(list != NULL, NULL);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
322
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
323 return list->ui_data;
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
324 }
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
325
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
326 void purple_disco_list_set_in_progress(PurpleDiscoList *list,
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
327 gboolean in_progress)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
328 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
329 g_return_if_fail(list != NULL);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
330
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
331 list->in_progress = in_progress;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
332
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
333 if (ops && ops->in_progress)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
334 ops->in_progress(list, in_progress);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
335 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
336
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
337 gboolean purple_disco_list_get_in_progress(PurpleDiscoList *list)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
338 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
339 g_return_val_if_fail(list != NULL, FALSE);
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
340
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
341 return list->in_progress;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
342 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
343
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
344 void purple_disco_list_set_protocol_data(PurpleDiscoList *list,
26590
689f6f3b4d8a Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <darkrain42@pidgin.im>
parents: 26588
diff changeset
345 gpointer proto_data,
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
346 PurpleDiscoCloseFunc cb)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
347 {
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
348 g_return_if_fail(list != NULL);
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
349
26908
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
350 list->proto_data = proto_data;
e292ff5a9311 Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <darkrain42@pidgin.im>
parents: 26596
diff changeset
351 list->ops.close_cb = cb;
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
352 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
353
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
354 gpointer purple_disco_list_get_protocol_data(PurpleDiscoList *list)
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
355 {
26588
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
356 g_return_val_if_fail(list != NULL, NULL);
644d7d7ad292 Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents: 26586
diff changeset
357
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
358 return list->proto_data;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
359 }
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
360
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
361 void purple_disco_list_set_service_close_func(PurpleDiscoList *list,
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
362 PurpleDiscoServiceCloseFunc cb)
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
363 {
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
364 g_return_if_fail(list != NULL);
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
365
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
366 list->ops.service_close_cb = cb;
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
367 }
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
368
26912
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
369 void purple_disco_list_set_cancel_func(PurpleDiscoList *list, PurpleDiscoCancelFunc cb)
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
370 {
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
371 g_return_if_fail(list != NULL);
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
372
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
373 list->ops.cancel_cb = cb;
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
374 }
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
375
26916
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
376 void purple_disco_list_set_expand_func(PurpleDiscoList *list, PurpleDiscoServiceExpandFunc cb)
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
377 {
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
378 g_return_if_fail(list != NULL);
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
379 list->ops.expand_cb = cb;
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
380 }
6cb5053eb433 Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <darkrain42@pidgin.im>
parents: 26912
diff changeset
381
26912
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
382 void purple_disco_list_set_register_func(PurpleDiscoList *list, PurpleDiscoRegisterFunc cb)
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
383 {
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
384 g_return_if_fail(list != NULL);
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
385
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
386 list->ops.register_cb = cb;
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
387 }
325b6aaca17a It helps to actually add functions when adding prototypes to a header
Paul Aurich <darkrain42@pidgin.im>
parents: 26908
diff changeset
388
26585
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
389 void purple_disco_set_ui_ops(PurpleDiscoUiOps *ui_ops)
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
390 {
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
391 ops = ui_ops;
11eaedca43b4 Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <darkrain42@pidgin.im>
parents:
diff changeset
392 }
26586
32f62e0864ad Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <darkrain42@pidgin.im>
parents: 26585
diff changeset
393
32f62e0864ad Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <darkrain42@pidgin.im>
parents: 26585
diff changeset
394 PurpleDiscoUiOps *purple_disco_get_ui_ops(void)
32f62e0864ad Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <darkrain42@pidgin.im>
parents: 26585
diff changeset
395 {
32f62e0864ad Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <darkrain42@pidgin.im>
parents: 26585
diff changeset
396 return ops;
32f62e0864ad Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <darkrain42@pidgin.im>
parents: 26585
diff changeset
397 }

mercurial