libpurple/purpleprotocolchat.c

Thu, 25 Aug 2022 21:34:53 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 25 Aug 2022 21:34:53 -0500
branch
gtk4
changeset 41591
ad6f5ffc2825
parent 41024
a2ad2d034162
child 41960
c8a4853205e3
permissions
-rw-r--r--

Port the invite dialog to GTK4

Testing Done:
Opened the dialog via conversations -> invite and made sure it worked as expected.

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

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 *****************************************************************************/
41024
a2ad2d034162 Set the prereq type for all Protocol interfaces to PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40697
diff changeset
28 G_DEFINE_INTERFACE(PurpleProtocolChat, purple_protocol_chat,
a2ad2d034162 Set the prereq type for all Protocol interfaces to PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40697
diff changeset
29 PURPLE_TYPE_PROTOCOL)
40697
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 static void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 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
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 /******************************************************************************
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 * Public API
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 *****************************************************************************/
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 GList *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 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
40 PurpleConnection *connection)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43
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_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
45 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
46
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 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
48 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
49 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
50 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 return NULL;
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 GHashTable *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 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
57 PurpleConnection *connection,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 const gchar *chat_name)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61
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_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
63 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
64
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 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
66 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
67 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
68 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 return NULL;
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 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
75 PurpleConnection *connection,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 GHashTable *components)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79
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_PROTOCOL_CHAT(protocol_chat));
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(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 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
83
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 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
85 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
86 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
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 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
92 PurpleConnection *connection,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 GHashTable *components)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96
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_PROTOCOL_CHAT(protocol_chat));
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(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 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
100
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 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
102 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
103 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
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 gchar *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 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
109 GHashTable *components)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112
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(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
114 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
115
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 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
117 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
118 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
119 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 return NULL;
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 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
126 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 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
128 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130
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_PROTOCOL_CHAT(protocol_chat));
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(PURPLE_IS_CONNECTION(connection));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 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
134
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 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
136 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
137 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
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 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
143 PurpleConnection *connection, gint id)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146
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_PROTOCOL_CHAT(protocol_chat));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 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
149
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 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
151 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
152 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
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 gint
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 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
158 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 PurpleMessage *message)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162
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_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
164 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
165 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
166
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 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
168 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
169 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
170 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 return -1;
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175 gchar *
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 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
177 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 const gchar *who)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181
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_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
183 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
184 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
185
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
186 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
187 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
188 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
189 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 return NULL;
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
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 void
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 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
196 PurpleConnection *connection, gint id,
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197 const gchar *topic)
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 {
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
199 PurpleProtocolChatInterface *iface = NULL;
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
200
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_PROTOCOL_CHAT(protocol_chat));
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202 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
203
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 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
205 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
206 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
207 }
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208 }

mercurial