Mercurial > pidgin
annotate libpurple/disco.c @ 26974:c2cd559e034f
propagate from branch 'im.pidgin.pidgin' (head 97fbf033d9afea69a6eabaac94698b3c051584cf)
to branch 'im.pidgin.cpw.darkrain42.xmpp.disco' (head d1274de628e3e7c76742ebf0941b7d104e19dceb)
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 23 May 2009 22:46:28 +0000 |
parents | ba99ee519926 |
children |
rev | line source |
---|---|
26249
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 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
32 /**************************************************************************/ |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
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:
26250
diff
changeset
|
34 /**************************************************************************/ |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
35 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
36 /** |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
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:
26250
diff
changeset
|
38 */ |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
39 struct _PurpleDiscoList { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
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:
26250
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:
26250
diff
changeset
|
42 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
43 gboolean in_progress; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
44 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
45 gpointer ui_data; /**< UI private data. */ |
26254
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
46 gpointer proto_data; /**< Prpl private data. */ |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
47 guint ref; /**< The reference count. */ |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
48 |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
49 struct { |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
50 PurpleDiscoCancelFunc cancel_cb; |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
51 PurpleDiscoCloseFunc close_cb; /**< Callback to free the prpl data */ |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
52 PurpleDiscoServiceCloseFunc service_close_cb; |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
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:
26600
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:
26600
diff
changeset
|
55 "sub-elements" in the tree */ |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
56 PurpleDiscoRegisterFunc register_cb; |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
57 } ops; |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
58 }; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
59 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
60 /** |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
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:
26250
diff
changeset
|
62 */ |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
63 struct _PurpleDiscoService { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
64 PurpleDiscoList *list; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
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:
26250
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:
26250
diff
changeset
|
67 |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
68 gpointer proto_data; |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
69 |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
70 gchar *gateway_type; /**< The type of the gateway service. */ |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
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:
26250
diff
changeset
|
72 PurpleDiscoServiceFlags flags; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
73 }; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
74 |
26249
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 |
26254
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
77 PurpleDiscoList *purple_disco_list_new(PurpleAccount *account) |
26249
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 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
93 PurpleDiscoList *purple_disco_list_ref(PurpleDiscoList *list) |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
94 { |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
95 g_return_val_if_fail(list != NULL, NULL); |
26249
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); |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
99 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
100 return list; |
26249
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 { |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
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:
26600
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:
26600
diff
changeset
|
107 |
26249
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); |
26260
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
110 g_free(r->gateway_type); |
26249
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 |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
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:
26260
diff
changeset
|
124 list->ops.close_cb(list); |
26254
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
125 |
26249
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 |
26609
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
147 void purple_disco_list_service_add(PurpleDiscoList *list, |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
148 PurpleDiscoService *service, |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
149 PurpleDiscoService *parent) |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
150 { |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
151 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
|
152 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
|
153 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
154 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
|
155 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
|
156 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
157 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
|
158 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
|
159 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
160 |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
161 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:
26600
diff
changeset
|
162 const gchar *name, const gchar *description, |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
163 PurpleDiscoServiceFlags flags, gpointer proto_data) |
26249
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 PurpleDiscoService *s; |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
166 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
167 g_return_val_if_fail(name != NULL, NULL); |
26260
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
168 g_return_val_if_fail(type != PURPLE_DISCO_SERVICE_TYPE_UNSET, NULL); |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
169 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
170 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
|
171 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
|
172 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
|
173 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
|
174 s->flags = flags; |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
175 s->proto_data = proto_data; |
26249
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 return s; |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
178 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
179 |
26254
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
180 PurpleDiscoList *purple_disco_get_list(PurpleConnection *pc) |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
181 { |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
182 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
|
183 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
|
184 |
26254
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
185 g_return_val_if_fail(pc != NULL, NULL); |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
186 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
187 prpl = purple_connection_get_prpl(pc); |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
188 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
|
189 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
|
190 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
191 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, disco_get_list)) |
26254
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
192 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:
26252
diff
changeset
|
193 |
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
194 return NULL; |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
195 } |
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 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
|
198 { |
26609
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
199 PurpleConnection *pc; |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
200 |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
201 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
|
202 |
26609
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
203 pc = purple_account_get_connection(list->account); |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
204 |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
205 g_return_if_fail(pc != NULL); |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
206 |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
207 if (list->ops.cancel_cb) |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
208 list->ops.cancel_cb(list); |
26255
de05bdd931ed
The core should be in charge of setting in_progress to FALSE
Paul Aurich <paul@darkrain42.org>
parents:
26254
diff
changeset
|
209 |
de05bdd931ed
The core should be in charge of setting in_progress to FALSE
Paul Aurich <paul@darkrain42.org>
parents:
26254
diff
changeset
|
210 purple_disco_list_set_in_progress(list, FALSE); |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
211 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
212 |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
213 void purple_disco_service_expand(PurpleDiscoService *service) |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
214 { |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
215 PurpleDiscoList *list; |
26609
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
216 PurpleConnection *pc; |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
217 |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
218 g_return_if_fail(service != NULL); |
26609
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
219 g_return_if_fail((service->flags & PURPLE_DISCO_BROWSE)); |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
220 |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
221 list = service->list; |
26609
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
222 pc = purple_account_get_connection(list->account); |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
223 |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
224 g_return_if_fail(pc != NULL); |
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
225 |
26606
4c974d40cc63
XMPP prpl depends on the core's setting in-progress-ness
Paul Aurich <paul@darkrain42.org>
parents:
26604
diff
changeset
|
226 purple_disco_list_set_in_progress(list, TRUE); |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
227 |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
228 if (list->ops.expand_cb) |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
229 list->ops.expand_cb(list, service); |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
230 else |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
231 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:
26600
diff
changeset
|
232 "protocol did not provide expand op.\n", |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
233 service->name, |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
234 purple_account_get_username(list->account)); |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
235 } |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
236 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
237 void purple_disco_service_register(PurpleDiscoService *service) |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
238 { |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
239 PurpleDiscoList *list; |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
240 PurpleConnection *pc; |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
241 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
242 g_return_if_fail(service != NULL); |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
243 |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
244 list = service->list; |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
245 pc = purple_account_get_connection(list->account); |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
246 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
247 g_return_if_fail(pc != NULL); |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
248 |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
249 if (list->ops.register_cb) |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
250 list->ops.register_cb(pc, service); |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
251 else |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
252 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:
26600
diff
changeset
|
253 "protocol did not provide register op.\n", |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
254 service->name, |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
255 purple_account_get_username(list->account)); |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
256 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
257 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
258 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:
26250
diff
changeset
|
259 { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
260 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:
26250
diff
changeset
|
261 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
262 return service->name; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
263 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
264 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
265 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:
26250
diff
changeset
|
266 { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
267 g_return_val_if_fail(service != NULL, NULL); |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
268 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
269 return service->description; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
270 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
271 |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
272 gpointer |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
273 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:
26600
diff
changeset
|
274 { |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
275 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:
26600
diff
changeset
|
276 |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
277 return service->proto_data; |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
278 } |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
279 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
280 PurpleDiscoServiceType |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
281 purple_disco_service_get_type(PurpleDiscoService *service) |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
282 { |
26260
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
283 g_return_val_if_fail(service != NULL, PURPLE_DISCO_SERVICE_TYPE_UNSET); |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
284 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
285 return service->type; |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
286 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
287 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
288 PurpleDiscoServiceFlags |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
289 purple_disco_service_get_flags(PurpleDiscoService *service) |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
290 { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
291 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:
26250
diff
changeset
|
292 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
293 return service->flags; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
294 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
295 |
26260
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
296 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:
26255
diff
changeset
|
297 { |
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
298 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:
26255
diff
changeset
|
299 |
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
300 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:
26255
diff
changeset
|
301 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:
26255
diff
changeset
|
302 } |
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
303 |
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
304 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:
26255
diff
changeset
|
305 { |
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
306 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:
26255
diff
changeset
|
307 |
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
308 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:
26255
diff
changeset
|
309 } |
d6b2944f04b3
s/category/type/ and s/muc/chat/ in the core and gateway type is a string.
Paul Aurich <paul@darkrain42.org>
parents:
26255
diff
changeset
|
310 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
311 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:
26250
diff
changeset
|
312 { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
313 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:
26250
diff
changeset
|
314 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
315 return list->account; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
316 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
317 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
318 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:
26250
diff
changeset
|
319 { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
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:
26250
diff
changeset
|
321 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
322 return list->services; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
323 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
324 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
325 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:
26250
diff
changeset
|
326 { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
327 g_return_if_fail(list != NULL); |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
328 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
329 list->ui_data = ui_data; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
330 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
331 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
332 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:
26250
diff
changeset
|
333 { |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
334 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:
26250
diff
changeset
|
335 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
336 return list->ui_data; |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
337 } |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
338 |
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
339 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:
26250
diff
changeset
|
340 gboolean in_progress) |
26249
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 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
|
343 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
344 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
|
345 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
346 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
|
347 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
|
348 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
349 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
350 gboolean purple_disco_list_get_in_progress(PurpleDiscoList *list) |
26249
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 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
|
353 |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
354 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
|
355 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
356 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
357 void purple_disco_list_set_protocol_data(PurpleDiscoList *list, |
26254
c619bef09bec
Make the prpl be in charge of creating the PurpleDiscoList; UI data is
Paul Aurich <paul@darkrain42.org>
parents:
26252
diff
changeset
|
358 gpointer proto_data, |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
359 PurpleDiscoCloseFunc cb) |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
360 { |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
361 g_return_if_fail(list != NULL); |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
362 |
26596
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
363 list->proto_data = proto_data; |
1de01f9594c8
Use per-PurpleDiscoList ops for canceling a disco and registering.
Paul Aurich <paul@darkrain42.org>
parents:
26260
diff
changeset
|
364 list->ops.close_cb = cb; |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
365 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
366 |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
367 gpointer purple_disco_list_get_protocol_data(PurpleDiscoList *list) |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
368 { |
26252
535c866b433c
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <paul@darkrain42.org>
parents:
26250
diff
changeset
|
369 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:
26250
diff
changeset
|
370 |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
371 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
|
372 } |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
373 |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
374 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:
26600
diff
changeset
|
375 PurpleDiscoServiceCloseFunc cb) |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
376 { |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
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:
26600
diff
changeset
|
378 |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
379 list->ops.service_close_cb = cb; |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
380 } |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
381 |
26600
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
382 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:
26596
diff
changeset
|
383 { |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
384 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:
26596
diff
changeset
|
385 |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
386 list->ops.cancel_cb = cb; |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
387 } |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
388 |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
389 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:
26600
diff
changeset
|
390 { |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
391 g_return_if_fail(list != NULL); |
26609
ba99ee519926
Do not call the non-destroy prpl-ops when the connection is gone.
Paul Aurich <paul@darkrain42.org>
parents:
26606
diff
changeset
|
392 |
26604
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
393 list->ops.expand_cb = cb; |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
394 } |
ff33b65b2448
Iteratively expand the disco tree as prompted by the UI.
Paul Aurich <paul@darkrain42.org>
parents:
26600
diff
changeset
|
395 |
26600
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
396 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:
26596
diff
changeset
|
397 { |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
398 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:
26596
diff
changeset
|
399 |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
400 list->ops.register_cb = cb; |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
401 } |
15d681a53b5a
It helps to actually add functions when adding prototypes to a header
Paul Aurich <paul@darkrain42.org>
parents:
26596
diff
changeset
|
402 |
26249
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
403 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
|
404 { |
a5010188c01e
Add the files I forgot to `mtn add` earlier (also, alphabetized disco.h
Paul Aurich <paul@darkrain42.org>
parents:
diff
changeset
|
405 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
|
406 } |
26250
2efdd76f5dc0
Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <paul@darkrain42.org>
parents:
26249
diff
changeset
|
407 |
2efdd76f5dc0
Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <paul@darkrain42.org>
parents:
26249
diff
changeset
|
408 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:
26249
diff
changeset
|
409 { |
2efdd76f5dc0
Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <paul@darkrain42.org>
parents:
26249
diff
changeset
|
410 return ops; |
2efdd76f5dc0
Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <paul@darkrain42.org>
parents:
26249
diff
changeset
|
411 } |