annotate libpurple/roomlist.c @ 32493:70b74f751fad

Send offline messages using UUM.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 03 Feb 2012 06:49:22 +0000
parents cd7dcd0beafa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file roomlist.c Room List API
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 * @ingroup core
20074
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19681
diff changeset
4 */
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19681
diff changeset
5
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19681
diff changeset
6 /* purple
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19681
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18202
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26
18202
7df46d8bf114 Move the define in internal.h instead.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15822
diff changeset
27 #include "internal.h"
7df46d8bf114 Move the define in internal.h instead.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15822
diff changeset
28
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "account.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "connection.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "debug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "roomlist.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "server.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34
31934
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
35 /**
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
36 * Represents a list of rooms for a given connection on a given protocol.
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
37 */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
38 struct _PurpleRoomlist {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
39 PurpleAccount *account; /**< The account this list belongs to. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
40 GList *fields; /**< The fields. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
41 GList *rooms; /**< The list of rooms. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
42 gboolean in_progress; /**< The listing is in progress. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
43 gpointer ui_data; /**< UI private data. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
44 gpointer proto_data; /** Prpl private data. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
45 guint ref; /**< The reference count. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
46 };
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
47
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
48 /**
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
49 * Represents a room.
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
50 */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
51 struct _PurpleRoomlistRoom {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
52 PurpleRoomlistRoomType type; /**< The type of room. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
53 gchar *name; /**< The name of the room. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
54 GList *fields; /**< Other fields. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
55 PurpleRoomlistRoom *parent; /**< The parent room, or NULL. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
56 gboolean expanded_once; /**< A flag the UI uses to avoid multiple expand prpl cbs. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
57 };
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
58
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
59 /**
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
60 * A field a room might have.
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
61 */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
62 struct _PurpleRoomlistField {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
63 PurpleRoomlistFieldType type; /**< The type of field. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
64 gchar *label; /**< The i18n user displayed name of the field. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
65 gchar *name; /**< The internal name of the field. */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
66 gboolean hidden; /**< Hidden? */
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
67 };
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
69 static PurpleRoomlistUiOps *ops = NULL;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 /** @name Room List API */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
76 void purple_roomlist_show_with_account(PurpleAccount *account)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 if (ops && ops->show_with_account)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 ops->show_with_account(account);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
82 PurpleRoomlist *purple_roomlist_new(PurpleAccount *account)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
84 PurpleRoomlist *list;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 g_return_val_if_fail(account != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
88 list = g_new0(PurpleRoomlist, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 list->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90 list->rooms = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 list->fields = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 list->ref = 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94 if (ops && ops->create)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 ops->create(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 return list;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
100 void purple_roomlist_ref(PurpleRoomlist *list)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 list->ref++;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
105 purple_debug_misc("roomlist", "reffing list, ref count now %d\n", list->ref);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
108 static void purple_roomlist_room_destroy(PurpleRoomlist *list, PurpleRoomlistRoom *r)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 GList *l, *j;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 for (l = list->fields, j = r->fields; l && j; l = l->next, j = j->next) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
113 PurpleRoomlistField *f = l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
114 if (f->type == PURPLE_ROOMLIST_FIELD_STRING)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115 g_free(j->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118 g_list_free(r->fields);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
119 g_free(r->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120 g_free(r);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
123 static void purple_roomlist_field_destroy(PurpleRoomlistField *f)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
124 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 g_free(f->label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 g_free(f->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127 g_free(f);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
130 static void purple_roomlist_destroy(PurpleRoomlist *list)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
134 purple_debug_misc("roomlist", "destroying list %p\n", list);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 if (ops && ops->destroy)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137 ops->destroy(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 for (l = list->rooms; l; l = l->next) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
140 PurpleRoomlistRoom *r = l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
141 purple_roomlist_room_destroy(list, r);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 g_list_free(list->rooms);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
145 g_list_foreach(list->fields, (GFunc)purple_roomlist_field_destroy, NULL);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 g_list_free(list->fields);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 g_free(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
151 void purple_roomlist_unref(PurpleRoomlist *list)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 g_return_if_fail(list->ref > 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 list->ref--;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
158 purple_debug_misc("roomlist", "unreffing list, ref count now %d\n", list->ref);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 if (list->ref == 0)
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
160 purple_roomlist_destroy(list);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162
31934
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
163 PurpleAccount *purple_roomlist_get_account(PurpleRoomlist *list)
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
164 {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
165 g_return_val_if_fail(list != NULL, NULL);
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
166
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
167 return list->account;
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
168 }
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
169
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
170 void purple_roomlist_set_fields(PurpleRoomlist *list, GList *fields)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174 list->fields = fields;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 if (ops && ops->set_fields)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177 ops->set_fields(list, fields);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
178 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
180 void purple_roomlist_set_in_progress(PurpleRoomlist *list, gboolean in_progress)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 list->in_progress = in_progress;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 if (ops && ops->in_progress)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187 ops->in_progress(list, in_progress);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
190 gboolean purple_roomlist_get_in_progress(PurpleRoomlist *list)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 g_return_val_if_fail(list != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194 return list->in_progress;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
195 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
197 void purple_roomlist_room_add(PurpleRoomlist *list, PurpleRoomlistRoom *room)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 g_return_if_fail(room != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 list->rooms = g_list_append(list->rooms, room);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 if (ops && ops->add_room)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 ops->add_room(list, room);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
208 PurpleRoomlist *purple_roomlist_get_list(PurpleConnection *gc)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 {
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
210 PurplePlugin *prpl = NULL;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
211 PurplePluginProtocolInfo *prpl_info = NULL;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213 g_return_val_if_fail(gc != NULL, NULL);
24597
c1f954e51389 Fix a crash that happens when accessing the roomlist for an account that's
Paul Aurich <paul@darkrain42.org>
parents: 24550
diff changeset
214 g_return_val_if_fail(PURPLE_CONNECTION_IS_CONNECTED(gc), NULL);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
216 prpl = purple_connection_get_prpl(gc);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
218 if(prpl != NULL)
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
219 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
220
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
221 if(prpl_info && prpl_info->roomlist_get_list)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 return prpl_info->roomlist_get_list(gc);
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
223
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
227 void purple_roomlist_cancel_get_list(PurpleRoomlist *list)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 {
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
229 PurplePlugin *prpl = NULL;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
230 PurplePluginProtocolInfo *prpl_info = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
231 PurpleConnection *gc;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
235 gc = purple_account_get_connection(list->account);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 g_return_if_fail(gc != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
239 if(gc)
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
240 prpl = purple_connection_get_prpl(gc);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
242 if(prpl)
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
243 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
244
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
245 if(prpl_info && prpl_info->roomlist_cancel)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246 prpl_info->roomlist_cancel(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
249 void purple_roomlist_expand_category(PurpleRoomlist *list, PurpleRoomlistRoom *category)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 {
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
251 PurplePlugin *prpl = NULL;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
252 PurplePluginProtocolInfo *prpl_info = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
253 PurpleConnection *gc;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 g_return_if_fail(category != NULL);
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
257 g_return_if_fail(category->type & PURPLE_ROOMLIST_ROOMTYPE_CATEGORY);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
259 gc = purple_account_get_connection(list->account);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 g_return_if_fail(gc != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
262 if(gc)
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
263 prpl = purple_connection_get_prpl(gc);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
265 if(prpl)
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
266 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
267
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22004
diff changeset
268 if(prpl_info && prpl_info->roomlist_expand_category)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 prpl_info->roomlist_expand_category(list, category);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271
22004
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
272 GList * purple_roomlist_get_fields(PurpleRoomlist *list)
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
273 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
274 return list->fields;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
275 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
276
31934
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
277 gpointer purple_roomlist_get_proto_data(PurpleRoomlist *list)
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
278 {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
279 g_return_val_if_fail(list != NULL, NULL);
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
280
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
281 return list->proto_data;
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
282 }
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
283
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
284 void purple_roomlist_set_proto_data(PurpleRoomlist *list, gpointer proto_data)
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
285 {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
286 g_return_if_fail(list != NULL);
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
287
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
288 list->proto_data = proto_data;
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
289 }
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
290
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
291 gpointer purple_roomlist_get_ui_data(PurpleRoomlist *list)
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
292 {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
293 g_return_val_if_fail(list != NULL, NULL);
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
294
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
295 return list->ui_data;
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
296 }
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
297
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
298 void purple_roomlist_set_ui_data(PurpleRoomlist *list, gpointer ui_data)
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
299 {
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
300 g_return_if_fail(list != NULL);
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
301
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
302 list->ui_data = ui_data;
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
303 }
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
304
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
307 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308 /** @name Room API */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
312 PurpleRoomlistRoom *purple_roomlist_room_new(PurpleRoomlistRoomType type, const gchar *name,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
313 PurpleRoomlistRoom *parent)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
315 PurpleRoomlistRoom *room;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 g_return_val_if_fail(name != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
319 room = g_new0(PurpleRoomlistRoom, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
320 room->type = type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
321 room->name = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322 room->parent = parent;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
324 return room;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
326
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
327 void purple_roomlist_room_add_field(PurpleRoomlist *list, PurpleRoomlistRoom *room, gconstpointer field)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
329 PurpleRoomlistField *f;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
331 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
332 g_return_if_fail(room != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
333 g_return_if_fail(list->fields != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334
24550
d18f44ae1143 Add a comment to clarify code I initially thought was broken.
Richard Laager <rlaager@wiktel.com>
parents: 22262
diff changeset
335 /* If this is the first call for this room, grab the first field in
d18f44ae1143 Add a comment to clarify code I initially thought was broken.
Richard Laager <rlaager@wiktel.com>
parents: 22262
diff changeset
336 * the Roomlist's fields. Otherwise, grab the field that is one
d18f44ae1143 Add a comment to clarify code I initially thought was broken.
Richard Laager <rlaager@wiktel.com>
parents: 22262
diff changeset
337 * more than the number of fields already present for the room.
d18f44ae1143 Add a comment to clarify code I initially thought was broken.
Richard Laager <rlaager@wiktel.com>
parents: 22262
diff changeset
338 * (This works because g_list_nth_data() is zero-indexed and
d18f44ae1143 Add a comment to clarify code I initially thought was broken.
Richard Laager <rlaager@wiktel.com>
parents: 22262
diff changeset
339 * g_list_length() is one-indexed.) */
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
340 if (!room->fields)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341 f = list->fields->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 f = g_list_nth_data(list->fields, g_list_length(room->fields));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
344
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 g_return_if_fail(f != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347 switch(f->type) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
348 case PURPLE_ROOMLIST_FIELD_STRING:
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
349 room->fields = g_list_append(room->fields, g_strdup(field));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
350 break;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
351 case PURPLE_ROOMLIST_FIELD_BOOL:
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
352 case PURPLE_ROOMLIST_FIELD_INT:
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
353 room->fields = g_list_append(room->fields, GINT_TO_POINTER(field));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354 break;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
355 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
356 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
358 void purple_roomlist_room_join(PurpleRoomlist *list, PurpleRoomlistRoom *room)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
360 GHashTable *components;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
361 GList *l, *j;
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
362 PurpleConnection *gc;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
363
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
364 g_return_if_fail(list != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365 g_return_if_fail(room != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
366
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
367 gc = purple_account_get_connection(list->account);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
368 if (!gc)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371 components = g_hash_table_new(g_str_hash, g_str_equal);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
373 g_hash_table_replace(components, "name", room->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
374 for (l = list->fields, j = room->fields; l && j; l = l->next, j = j->next) {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
375 PurpleRoomlistField *f = l->data;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
376
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377 g_hash_table_replace(components, f->name, j->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
379
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380 serv_join_chat(gc, components);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382 g_hash_table_destroy(components);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384
22004
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
385 PurpleRoomlistRoomType purple_roomlist_room_get_type(PurpleRoomlistRoom *room)
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
386 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
387 return room->type;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
388 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
389
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
390 const char * purple_roomlist_room_get_name(PurpleRoomlistRoom *room)
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
391 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
392 return room->name;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
393 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
394
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
395 PurpleRoomlistRoom * purple_roomlist_room_get_parent(PurpleRoomlistRoom *room)
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
396 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
397 return room->parent;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
398 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
399
31934
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
400 gboolean purple_roomlist_room_get_expanded_once(PurpleRoomlistRoom *room)
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
401 {
31955
cd7dcd0beafa Fix two compile warnings. Did I do that? I totally didn't notice. My bad.
Mark Doliner <mark@kingant.net>
parents: 31934
diff changeset
402 g_return_val_if_fail(room != NULL, FALSE);
31934
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
403
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
404 return room->expanded_once;
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
405 }
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
406
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
407 void purple_roomlist_room_set_expanded_once(PurpleRoomlistRoom *room, gboolean expanded_once)
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
408 {
31955
cd7dcd0beafa Fix two compile warnings. Did I do that? I totally didn't notice. My bad.
Mark Doliner <mark@kingant.net>
parents: 31934
diff changeset
409 g_return_if_fail(room != NULL);
31934
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
410
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
411 room->expanded_once = expanded_once;
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
412 }
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
413
5dafa68c8eb0 Some struct hiding. What a pain.
Mark Doliner <mark@kingant.net>
parents: 28647
diff changeset
414 GList *purple_roomlist_room_get_fields(PurpleRoomlistRoom *room)
22004
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
415 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
416 return room->fields;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
417 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
418
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
420
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422 /** @name Room Field API */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
423 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
425
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
426 PurpleRoomlistField *purple_roomlist_field_new(PurpleRoomlistFieldType type,
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
427 const gchar *label, const gchar *name,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
428 gboolean hidden)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
429 {
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
430 PurpleRoomlistField *f;
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 g_return_val_if_fail(label != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 g_return_val_if_fail(name != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
435 f = g_new0(PurpleRoomlistField, 1);
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
436
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437 f->type = type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438 f->label = g_strdup(label);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439 f->name = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440 f->hidden = hidden;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 return f;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444
22004
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
445 PurpleRoomlistFieldType purple_roomlist_field_get_type(PurpleRoomlistField *field)
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
446 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
447 return field->type;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
448 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
449
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
450 const char * purple_roomlist_field_get_label(PurpleRoomlistField *field)
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
451 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
452 return field->label;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
453 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
454
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
455 gboolean purple_roomlist_field_get_hidden(PurpleRoomlistField *field)
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
456 {
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
457 return field->hidden;
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
458 }
f9dcdc0e89a5 A list of accessor functions to the roomlist API.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20074
diff changeset
459
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460 /*@}*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
462 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
463 /** @name UI Registration Functions */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 /*@{*/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
468 void purple_roomlist_set_ui_ops(PurpleRoomlistUiOps *ui_ops)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
470 ops = ui_ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
472
15822
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15373
diff changeset
473 PurpleRoomlistUiOps *purple_roomlist_get_ui_ops(void)
15373
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 return ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
478 /*@}*/