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