libpurple/chat.c

Mon, 22 Aug 2022 21:40:04 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Mon, 22 Aug 2022 21:40:04 -0500
branch
gtk4
changeset 41567
517ac516af27
parent 40804
5496016b3c00
child 41685
ca22b00972d4
permissions
-rw-r--r--

Inline pidgin_make_scrollable

We need to change it for GTK4, and there are few enough that it can be inlined. Eventually, that code might be a `.ui` anyway.

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/1615/

37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * purple
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * source distribution.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * (at your option) any later version.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * GNU General Public License for more details.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include "internal.h"
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #include "chat.h"
40697
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 39897
diff changeset
25 #include "purpleprotocolchat.h"
37951
c80bc6ef5d20 Not sure how this go typoed and not found until now, but here's a fix
Gary Kramlich <grim@reaperworld.com>
parents: 37947
diff changeset
26 #include "util.h"
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 typedef struct _PurpleChatPrivate PurpleChatPrivate;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 /* Private data for a chat node */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 struct _PurpleChatPrivate {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 char *alias; /* The display name of this chat. */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 PurpleAccount *account; /* The account this chat is attached to */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 GHashTable *components; /* the stuff the protocol needs to know to
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 join the chat */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 gboolean is_constructed; /* Indicates if the chat has finished being
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 constructed. */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 };
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 /* Chat property enums */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 enum
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 PROP_0,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 PROP_ALIAS,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 PROP_ACCOUNT,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 PROP_COMPONENTS,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 PROP_LAST
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 };
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 /******************************************************************************
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 * Globals
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 *****************************************************************************/
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 static GParamSpec *properties[PROP_LAST];
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
56 G_DEFINE_TYPE_WITH_PRIVATE(PurpleChat, purple_chat, PURPLE_TYPE_BLIST_NODE);
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
57
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 /******************************************************************************
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 * API
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 *****************************************************************************/
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 const char *purple_chat_get_name(PurpleChat *chat)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 {
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
64 PurpleChatPrivate *priv = NULL;
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65
39812
d9367dc7edfd Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents: 39782
diff changeset
66 g_return_val_if_fail(PURPLE_IS_CHAT(chat), NULL);
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
67
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
68 priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 if ((priv->alias != NULL) && (*priv->alias != '\0'))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 return priv->alias;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 return purple_chat_get_name_only(chat);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 const char *purple_chat_get_name_only(PurpleChat *chat)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 {
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
78 PurpleChatPrivate *priv = NULL;
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 char *ret = NULL;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 PurpleProtocol *protocol = NULL;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81
39812
d9367dc7edfd Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents: 39782
diff changeset
82 g_return_val_if_fail(PURPLE_IS_CHAT(chat), NULL);
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
83
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
84 priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85
40804
5496016b3c00 Port libpurple from purple_protocols_ to purple_protocol_manager_
Gary Kramlich <grim@reaperworld.com>
parents: 40697
diff changeset
86 protocol = purple_account_get_protocol(priv->account);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39676
diff changeset
88 if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, info)) {
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 PurpleProtocolChatEntry *pce;
40697
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 39897
diff changeset
90 GList *parts = purple_protocol_chat_info(PURPLE_PROTOCOL_CHAT(protocol),
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 39897
diff changeset
91 purple_account_get_connection(priv->account));
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 pce = parts->data;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 ret = g_hash_table_lookup(priv->components, pce->identifier);
39897
16b440d4ab36 Use g_list_free_full instead of g_list_foreach+g_list_free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39812
diff changeset
94 g_list_free_full(parts, g_free);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 return ret;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 void
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 purple_chat_set_alias(PurpleChat *chat, const char *alias)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 {
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
103 PurpleChatPrivate *priv = NULL;
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 char *old_alias;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 char *new_alias = NULL;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106
39812
d9367dc7edfd Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents: 39782
diff changeset
107 g_return_if_fail(PURPLE_IS_CHAT(chat));
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
108
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
109 priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 if ((alias != NULL) && (*alias != '\0'))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 new_alias = purple_utf8_strip_unprintables(alias);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 if (!purple_strequal(priv->alias, new_alias)) {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 g_free(new_alias);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 return;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 old_alias = priv->alias;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 if ((new_alias != NULL) && (*new_alias != '\0'))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 priv->alias = new_alias;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 else {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 priv->alias = NULL;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 g_free(new_alias); /* could be "\0" */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 g_object_notify_by_pspec(G_OBJECT(chat), properties[PROP_ALIAS]);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129
39676
1e8394d47205 Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39675
diff changeset
130 purple_blist_save_node(purple_blist_get_default(),
1e8394d47205 Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39675
diff changeset
131 PURPLE_BLIST_NODE(chat));
39675
583e2ba6e78e Add wrapper functions for some PurpleBlistUiOps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39665
diff changeset
132 purple_blist_update_node(purple_blist_get_default(),
583e2ba6e78e Add wrapper functions for some PurpleBlistUiOps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39665
diff changeset
133 PURPLE_BLIST_NODE(chat));
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 chat, old_alias);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 g_free(old_alias);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 PurpleGroup *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 purple_chat_get_group(PurpleChat *chat)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 g_return_val_if_fail(PURPLE_IS_CHAT(chat), NULL);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 return PURPLE_GROUP(PURPLE_BLIST_NODE(chat)->parent);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 PurpleAccount *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 purple_chat_get_account(PurpleChat *chat)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 {
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
151 PurpleChatPrivate *priv = NULL;
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152
39812
d9367dc7edfd Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents: 39782
diff changeset
153 g_return_val_if_fail(PURPLE_IS_CHAT(chat), NULL);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
155 priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 return priv->account;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 GHashTable *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 purple_chat_get_components(PurpleChat *chat)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 {
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
162 PurpleChatPrivate *priv = NULL;
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163
39812
d9367dc7edfd Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents: 39782
diff changeset
164 g_return_val_if_fail(PURPLE_IS_CHAT(chat), NULL);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165
39782
db027c5e1463 Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39759
diff changeset
166 priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 return priv->components;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 /******************************************************************************
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 * GObject Stuff
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 *****************************************************************************/
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 static void
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174 purple_chat_set_property(GObject *obj, guint param_id, const GValue *value,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 GParamSpec *pspec)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177 PurpleChat *chat = PURPLE_CHAT(obj);
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
178 PurpleChatPrivate *priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 switch (param_id) {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181 case PROP_ALIAS:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182 if (priv->is_constructed)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 purple_chat_set_alias(chat, g_value_get_string(value));
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 else
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185 priv->alias =
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 purple_utf8_strip_unprintables(g_value_get_string(value));
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188 case PROP_ACCOUNT:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189 priv->account = g_value_get_object(value);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 case PROP_COMPONENTS:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192 priv->components = g_value_get_pointer(value);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 default:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
199
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
200 static void
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201 purple_chat_get_property(GObject *obj, guint param_id, GValue *value,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202 GParamSpec *pspec)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 PurpleChat *chat = PURPLE_CHAT(obj);
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
205 PurpleChatPrivate *priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 switch (param_id) {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208 case PROP_ALIAS:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209 g_value_set_string(value, priv->alias);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
211 case PROP_ACCOUNT:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 g_value_set_object(value, purple_chat_get_account(chat));
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214 case PROP_COMPONENTS:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
215 g_value_set_pointer(value, purple_chat_get_components(chat));
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
216 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
217 default:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
218 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
219 break;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
220 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
221 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
222
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
223 /* GObject initialization function */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
224 static void
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
225 purple_chat_init(PurpleChat *chat)
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
226 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
227 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
228
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
229 /* Called when done constructing */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
230 static void
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
231 purple_chat_constructed(GObject *object)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
232 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
233 PurpleChat *chat = PURPLE_CHAT(object);
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
234 PurpleChatPrivate *priv = purple_chat_get_instance_private(chat);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
235
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
236 G_OBJECT_CLASS(purple_chat_parent_class)->constructed(object);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
237
39676
1e8394d47205 Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39675
diff changeset
238 purple_blist_new_node(purple_blist_get_default(),
1e8394d47205 Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39675
diff changeset
239 PURPLE_BLIST_NODE(chat));
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
240
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
241 priv->is_constructed = TRUE;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
242 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
243
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
244 /* GObject finalize function */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
245 static void
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
246 purple_chat_finalize(GObject *object)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
247 {
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
248 PurpleChatPrivate *priv =
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
249 purple_chat_get_instance_private(PURPLE_CHAT(object));
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
250
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
251 g_free(priv->alias);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
252 g_hash_table_destroy(priv->components);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
253
39364
54439db24429 libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
254 G_OBJECT_CLASS(purple_chat_parent_class)->finalize(object);
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
255 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
256
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
257 /* Class initializer function */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
258 static void purple_chat_class_init(PurpleChatClass *klass)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
259 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
260 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
261
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
262 obj_class->finalize = purple_chat_finalize;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
263
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
264 /* Setup properties */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
265 obj_class->get_property = purple_chat_get_property;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
266 obj_class->set_property = purple_chat_set_property;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
267 obj_class->constructed = purple_chat_constructed;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
268
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
269 properties[PROP_ALIAS] = g_param_spec_string(
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
270 "alias",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
271 "Alias",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
272 "The alias for the chat.",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
273 NULL,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
274 G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
275 );
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
276
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
277 properties[PROP_ACCOUNT] = g_param_spec_object(
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
278 "account",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
279 "Account",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
280 "The account that the chat belongs to.",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
281 PURPLE_TYPE_ACCOUNT,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
282 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
283 );
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
284
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
285 properties[PROP_COMPONENTS] = g_param_spec_pointer(
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
286 "components",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
287 "Components",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
288 "The protocol components of the chat.",
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
289 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
290 );
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
291
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
292 g_object_class_install_properties(obj_class, PROP_LAST, properties);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
293 }
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
294
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
295 PurpleChat *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
296 purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components)
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
297 {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
298 g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
299 g_return_val_if_fail(components != NULL, NULL);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
300
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
301 return g_object_new(PURPLE_TYPE_CHAT,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
302 "account", account,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
303 "alias", alias,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
304 "components", components,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
305 NULL);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
306 }

mercurial