Sat, 13 Apr 2024 21:21:59 -0500
Remove PurpleIMConversation and PurpleProtocolIM
Both of these have been replaced and needed to be removed.
Testing Done:
Checked in with our turtle buddies.
Reviewed at https://reviews.imfreedom.org/r/3113/
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
12 | * any later version. |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
17 | * more details. |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
22 | |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #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
|
24 | #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
|
25 | #include "util.h" |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | typedef struct _PurpleChatPrivate PurpleChatPrivate; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | /* Private data for a chat node */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | struct _PurpleChatPrivate { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | char *alias; /* The display name of this chat. */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | 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
|
33 | 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
|
34 | join the chat */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | 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
|
37 | constructed. */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | }; |
|
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 | /* Chat property enums */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | enum |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | PROP_0, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | PROP_ALIAS, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | PROP_ACCOUNT, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | PROP_COMPONENTS, |
|
42584
687260353985
Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41960
diff
changeset
|
47 | N_PROPERTIES, |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | }; |
|
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 | * Globals |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | *****************************************************************************/ |
|
42584
687260353985
Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41960
diff
changeset
|
53 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | |
|
39364
54439db24429
libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39352
diff
changeset
|
55 | 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
|
56 | |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | /****************************************************************************** |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | * API |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | *****************************************************************************/ |
|
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 | const char *purple_chat_get_name(PurpleChat *chat) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
63 | PurpleChatPrivate *priv = NULL; |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | |
|
39812
d9367dc7edfd
Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents:
39782
diff
changeset
|
65 | 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
|
66 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
67 | priv = purple_chat_get_instance_private(chat); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | if ((priv->alias != NULL) && (*priv->alias != '\0')) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | return priv->alias; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | return purple_chat_get_name_only(chat); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | } |
|
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 | 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
|
76 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
77 | PurpleChatPrivate *priv = NULL; |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | char *ret = NULL; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | PurpleProtocol *protocol = NULL; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | |
|
39812
d9367dc7edfd
Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents:
39782
diff
changeset
|
81 | 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
|
82 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
83 | priv = purple_chat_get_instance_private(chat); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | |
|
40804
5496016b3c00
Port libpurple from purple_protocols_ to purple_protocol_manager_
Gary Kramlich <grim@reaperworld.com>
parents:
40697
diff
changeset
|
85 | protocol = purple_account_get_protocol(priv->account); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39676
diff
changeset
|
87 | if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, CHAT, info)) { |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | PurpleProtocolChatEntry *pce; |
|
40697
81f81f5d2f39
Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
39897
diff
changeset
|
89 | 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
|
90 | purple_account_get_connection(priv->account)); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | pce = parts->data; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | 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
|
93 | g_list_free_full(parts, g_free); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | } |
|
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 | return ret; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | } |
|
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 | void |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | 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
|
101 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
102 | PurpleChatPrivate *priv = NULL; |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | char *old_alias; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | char *new_alias = NULL; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | |
|
39812
d9367dc7edfd
Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents:
39782
diff
changeset
|
106 | 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
|
107 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
108 | priv = purple_chat_get_instance_private(chat); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | if ((alias != NULL) && (*alias != '\0')) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | new_alias = purple_utf8_strip_unprintables(alias); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | if (!purple_strequal(priv->alias, new_alias)) { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | g_free(new_alias); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | return; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | } |
|
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 | old_alias = priv->alias; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | if ((new_alias != NULL) && (*new_alias != '\0')) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | priv->alias = new_alias; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | else { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
123 | priv->alias = NULL; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | g_free(new_alias); /* could be "\0" */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | } |
|
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 | 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
|
128 | |
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
129 | 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
|
130 | PURPLE_BLIST_NODE(chat)); |
|
39675
583e2ba6e78e
Add wrapper functions for some PurpleBlistUiOps.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39665
diff
changeset
|
131 | 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
|
132 | PURPLE_BLIST_NODE(chat)); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | 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
|
135 | chat, old_alias); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | g_free(old_alias); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | } |
|
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 | PurpleGroup * |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | purple_chat_get_group(PurpleChat *chat) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | 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
|
143 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | return PURPLE_GROUP(PURPLE_BLIST_NODE(chat)->parent); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | } |
|
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 | PurpleAccount * |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | purple_chat_get_account(PurpleChat *chat) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
150 | PurpleChatPrivate *priv = NULL; |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | |
|
39812
d9367dc7edfd
Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents:
39782
diff
changeset
|
152 | 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
|
153 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
154 | priv = purple_chat_get_instance_private(chat); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | return priv->account; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | } |
|
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 | GHashTable * |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | purple_chat_get_components(PurpleChat *chat) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
160 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
161 | PurpleChatPrivate *priv = NULL; |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
162 | |
|
39812
d9367dc7edfd
Fix a few broken PURPLE_IS_CHAT checks and fix a incorrect typecast
Gary Kramlich <grim@reaperworld.com>
parents:
39782
diff
changeset
|
163 | 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
|
164 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
165 | priv = purple_chat_get_instance_private(chat); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
166 | return priv->components; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
167 | } |
|
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 | * GObject Stuff |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
171 | *****************************************************************************/ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
172 | static void |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
173 | 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
|
174 | GParamSpec *pspec) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
175 | { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
176 | 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
|
177 | 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
|
178 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
179 | switch (param_id) { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
180 | case PROP_ALIAS: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
181 | if (priv->is_constructed) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
182 | 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
|
183 | else |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
184 | priv->alias = |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
185 | 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
|
186 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
187 | case PROP_ACCOUNT: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
188 | priv->account = g_value_get_object(value); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
189 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
190 | case PROP_COMPONENTS: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
191 | priv->components = g_value_get_pointer(value); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
192 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
193 | default: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
194 | 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
|
195 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
196 | } |
|
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 | static void |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
200 | 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
|
201 | GParamSpec *pspec) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
202 | { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
203 | 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
|
204 | 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
|
205 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
206 | switch (param_id) { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
207 | case PROP_ALIAS: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
208 | g_value_set_string(value, priv->alias); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
209 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
210 | case PROP_ACCOUNT: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
211 | 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
|
212 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
213 | case PROP_COMPONENTS: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
214 | 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
|
215 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
216 | default: |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
217 | 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
|
218 | break; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
219 | } |
|
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 | /* GObject initialization function */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
223 | static void |
|
41960
c8a4853205e3
Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41685
diff
changeset
|
224 | purple_chat_init(G_GNUC_UNUSED PurpleChat *chat) |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
225 | { |
|
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 | /* Called when done constructing */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
229 | static void |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
230 | purple_chat_constructed(GObject *object) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
231 | { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
232 | 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
|
233 | 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
|
234 | |
|
39364
54439db24429
libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39352
diff
changeset
|
235 | 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
|
236 | |
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
237 | 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
|
238 | PURPLE_BLIST_NODE(chat)); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
239 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
240 | priv->is_constructed = TRUE; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
241 | } |
|
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 | /* GObject finalize function */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
244 | static void |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
245 | purple_chat_finalize(GObject *object) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
246 | { |
|
39364
54439db24429
libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39352
diff
changeset
|
247 | PurpleChatPrivate *priv = |
|
54439db24429
libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39352
diff
changeset
|
248 | 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
|
249 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
250 | g_free(priv->alias); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
251 | g_hash_table_destroy(priv->components); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
252 | |
|
39364
54439db24429
libpurple: Port self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
39352
diff
changeset
|
253 | 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
|
254 | } |
|
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 | /* Class initializer function */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
257 | static void purple_chat_class_init(PurpleChatClass *klass) |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
258 | { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
259 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
260 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
261 | obj_class->finalize = purple_chat_finalize; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
262 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
263 | /* Setup properties */ |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
264 | obj_class->get_property = purple_chat_get_property; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
265 | obj_class->set_property = purple_chat_set_property; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
266 | obj_class->constructed = purple_chat_constructed; |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
267 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
268 | /** |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
269 | * PurpleChat:alias: |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
270 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
271 | * The alias of the chat. |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
272 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
273 | * Since: 3.0 |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
274 | */ |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
275 | properties[PROP_ALIAS] = g_param_spec_string( |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
276 | "alias", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
277 | "Alias", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
278 | "The alias for the chat.", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
279 | NULL, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
280 | 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
|
281 | ); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
282 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
283 | /** |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
284 | * PurpleChat:account: |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
285 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
286 | * The account that the chat belongs to. |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
287 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
288 | * Since: 3.0 |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
289 | */ |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
290 | properties[PROP_ACCOUNT] = g_param_spec_object( |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
291 | "account", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
292 | "Account", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
293 | "The account that the chat belongs to.", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
294 | PURPLE_TYPE_ACCOUNT, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
295 | 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
|
296 | ); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
297 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
298 | /** |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
299 | * PurpleChat:components: |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
300 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
301 | * The components for the chat. |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
302 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
303 | * Since: 3.0 |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
304 | */ |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
305 | properties[PROP_COMPONENTS] = g_param_spec_pointer( |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
306 | "components", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
307 | "Components", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
308 | "The protocol components of the chat.", |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
309 | 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
|
310 | ); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
311 | |
|
42584
687260353985
Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41960
diff
changeset
|
312 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
|
37947
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
313 | } |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
314 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
315 | PurpleChat * |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
316 | 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
|
317 | { |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
318 | 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
|
319 | g_return_val_if_fail(components != NULL, NULL); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
320 | |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
321 | return g_object_new(PURPLE_TYPE_CHAT, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
322 | "account", account, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
323 | "alias", alias, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
324 | "components", components, |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
325 | NULL); |
|
12ce09a23094
Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
326 | } |