libpurple/purpleprotocolchat.c

Tue, 06 Apr 2021 03:35:20 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 06 Apr 2021 03:35:20 -0500
changeset 40840
b5f355f90ab0
parent 40697
81f81f5d2f39
child 41024
a2ad2d034162
permissions
-rw-r--r--

Port the updates from 2.14.2 and the upcoming 2.14.3 to 3.0.0

* Use the unicode version of the System and UserInfo plugins to fix
non-english languages in the Windows installer.
* Update the installer to use the inetc plugin so that https downloads will
work. This became necessary because Sourceforge now redirects http to
https.
* Standardize everything in pidgin/win32/winpidgin.c to use `wprintf`.

Testing Done:
Compiled and ran on windows 10.

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

40697
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include "purpleprotocolchat.h"
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 /******************************************************************************
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 * GObject Implementation
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 *****************************************************************************/
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 G_DEFINE_INTERFACE(PurpleProtocolChat, purple_protocol_chat, G_TYPE_INVALID)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 static void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 purple_protocol_chat_default_init(PurpleProtocolChatInterface *iface) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 /******************************************************************************
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 * Public API
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 *****************************************************************************/
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 GList *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 purple_protocol_chat_info(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 PurpleConnection *connection)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 g_return_val_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat), NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 g_return_val_if_fail(PURPLE_IS_CONNECTION(connection), NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 if(iface != NULL && iface->info != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 return iface->info(protocol_chat, connection);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 return NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 GHashTable *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 purple_protocol_chat_info_defaults(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 PurpleConnection *connection,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 const gchar *chat_name)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 g_return_val_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat), NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 g_return_val_if_fail(PURPLE_IS_CONNECTION(connection), NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 if(iface != NULL && iface->info_defaults != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 return iface->info_defaults(protocol_chat, connection, chat_name);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 return NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 purple_protocol_chat_join(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 PurpleConnection *connection,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 GHashTable *components)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 g_return_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 g_return_if_fail(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 g_return_if_fail(components != NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 if(iface != NULL && iface->join != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 iface->join(protocol_chat, connection, components);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 purple_protocol_chat_reject(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 PurpleConnection *connection,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 GHashTable *components)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 g_return_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 g_return_if_fail(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 g_return_if_fail(components != NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 if(iface != NULL && iface->reject != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 iface->reject(protocol_chat, connection, components);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 gchar *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 purple_protocol_chat_get_name(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 GHashTable *components)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 g_return_val_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat), NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 g_return_val_if_fail(components != NULL, NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 if(iface != NULL && iface->get_name != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 return iface->get_name(protocol_chat, components);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 return NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 purple_protocol_chat_invite(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 const gchar *message, const gchar *who)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 g_return_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 g_return_if_fail(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 g_return_if_fail(who != NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 if(iface != NULL && iface->invite != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 iface->invite(protocol_chat, connection, id, message, who);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 purple_protocol_chat_leave(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 PurpleConnection *connection, gint id)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 g_return_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 g_return_if_fail(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 if(iface != NULL && iface->leave != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 iface->leave(protocol_chat, connection, id);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 gint
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 purple_protocol_chat_send(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158 PurpleMessage *message)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 g_return_val_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat), -1);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 g_return_val_if_fail(PURPLE_IS_CONNECTION(connection), -1);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 g_return_val_if_fail(PURPLE_IS_MESSAGE(message), -1);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 if(iface != NULL && iface->send != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 return iface->send(protocol_chat, connection, id, message);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 return -1;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174 gchar *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 purple_protocol_chat_get_user_real_name(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177 const gchar *who)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181 g_return_val_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat), NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182 g_return_val_if_fail(PURPLE_IS_CONNECTION(connection), NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
183 g_return_val_if_fail(who != NULL, NULL);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
185 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 if(iface != NULL && iface->get_user_real_name != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
187 return iface->get_user_real_name(protocol_chat, connection, id, who);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
188 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
189
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 return NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 purple_protocol_chat_set_topic(PurpleProtocolChat *protocol_chat,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 const gchar *topic)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
199
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
200 g_return_if_fail(PURPLE_IS_PROTOCOL_CHAT(protocol_chat));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201 g_return_if_fail(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 iface = PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol_chat);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 if(iface != NULL && iface->set_topic != NULL) {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
205 iface->set_topic(protocol_chat, connection, id, topic);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 }

mercurial