libpurple/protocol.c

Mon, 16 Sep 2019 05:26:48 -0400

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Mon, 16 Sep 2019 05:26:48 -0400
changeset 39895
9021ee76539a
parent 39818
d63ceb45d88d
child 40062
d25228fc7b8e
permissions
-rw-r--r--

Remove unused purple_protocol_override.

36560
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
1 /*
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
2 * purple
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
3 *
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
6 * source distribution.
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
7 *
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
11 * (at your option) any later version.
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
12 *
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
16 * GNU General Public License for more details.
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
17 *
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
21 *
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
22 */
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
23 #include "protocol.h"
59acaa1605f4 Added protocol.c and protocols.h
Ankit Vani <a@nevitus.org>
parents:
diff changeset
24
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
25 static GObjectClass *parent_class;
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
26
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
27 /**************************************************************************
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
28 * Protocol Object API
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
29 **************************************************************************/
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
30 const char *
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
31 purple_protocol_get_id(const PurpleProtocol *protocol)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
32 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
33 g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
34
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
35 return protocol->id;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
36 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
37
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
38 const char *
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
39 purple_protocol_get_name(const PurpleProtocol *protocol)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
40 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
41 g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
42
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
43 return protocol->name;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
44 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
45
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
46 PurpleProtocolOptions
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
47 purple_protocol_get_options(const PurpleProtocol *protocol)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
48 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
49 g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), 0);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
50
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
51 return protocol->options;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
52 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
53
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
54 GList *
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
55 purple_protocol_get_user_splits(const PurpleProtocol *protocol)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
56 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
57 g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
58
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
59 return protocol->user_splits;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
60 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
61
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
62 GList *
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
63 purple_protocol_get_account_options(const PurpleProtocol *protocol)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
64 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
65 g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
66
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
67 return protocol->account_options;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
68 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
69
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
70 PurpleBuddyIconSpec *
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
71 purple_protocol_get_icon_spec(const PurpleProtocol *protocol)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
72 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
73 g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
74
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
75 return protocol->icon_spec;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
76 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
77
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36624
diff changeset
78 PurpleWhiteboardOps *
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
79 purple_protocol_get_whiteboard_ops(const PurpleProtocol *protocol)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
80 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
81 g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
82
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
83 return protocol->whiteboard_ops;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
84 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
85
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
86 static void
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
87 user_splits_free(PurpleProtocol *protocol)
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
88 {
36844
b62140058cd3 Check for valid PurpleProtocols
Ankit Vani <a@nevitus.org>
parents: 36731
diff changeset
89 g_return_if_fail(PURPLE_IS_PROTOCOL(protocol));
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
90
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
91 while (protocol->user_splits) {
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
92 PurpleAccountUserSplit *split = protocol->user_splits->data;
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
93 purple_account_user_split_destroy(split);
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
94 protocol->user_splits = g_list_delete_link(protocol->user_splits,
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
95 protocol->user_splits);
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
96 }
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
97 }
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
98
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
99 static void
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
100 account_options_free(PurpleProtocol *protocol)
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
101 {
36844
b62140058cd3 Check for valid PurpleProtocols
Ankit Vani <a@nevitus.org>
parents: 36731
diff changeset
102 g_return_if_fail(PURPLE_IS_PROTOCOL(protocol));
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
103
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
104 while (protocol->account_options) {
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
105 PurpleAccountOption *option = protocol->account_options->data;
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
106 purple_account_option_destroy(option);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
107 protocol->account_options =
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
108 g_list_delete_link(protocol->account_options,
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
109 protocol->account_options);
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
110 }
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
111 }
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
112
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
113 static void
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
114 icon_spec_free(PurpleProtocol *protocol)
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
115 {
36844
b62140058cd3 Check for valid PurpleProtocols
Ankit Vani <a@nevitus.org>
parents: 36731
diff changeset
116 g_return_if_fail(PURPLE_IS_PROTOCOL(protocol));
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
117
36687
7a83a1a657e3 Removed unused declaration of purple_buddy_icon_spec_free()
Ankit Vani <a@nevitus.org>
parents: 36686
diff changeset
118 g_free(protocol->icon_spec);
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
119 protocol->icon_spec = NULL;
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
120 }
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
121
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
122 /**************************************************************************
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
123 * GObject stuff
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
124 **************************************************************************/
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
125 static void
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
126 purple_protocol_init(GTypeInstance *instance, gpointer klass)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
127 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
128 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
129
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
130 static void
36847
58597c72e6ac Moved dispose() code from PurplePluginInfo and PurpleProtocol to finalize()
Ankit Vani <a@nevitus.org>
parents: 36844
diff changeset
131 purple_protocol_finalize(GObject *object)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
132 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
133 PurpleProtocol *protocol = PURPLE_PROTOCOL(object);
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
134 GList *accounts, *l;
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
135
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
136 accounts = purple_accounts_get_all_active();
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
137 for (l = accounts; l != NULL; l = l->next) {
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
138 PurpleAccount *account = PURPLE_ACCOUNT(l->data);
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
139 if (purple_account_is_disconnected(account))
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
140 continue;
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
141
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
142 if (purple_strequal(protocol->id,
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
143 purple_account_get_protocol_id(account)))
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
144 purple_account_disconnect(account);
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
145 }
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
146
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
147 g_list_free(accounts);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
148
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
149 purple_request_close_with_handle(protocol);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
150 purple_notify_close_with_handle(protocol);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
151
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
152 purple_signals_disconnect_by_handle(protocol);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
153 purple_signals_unregister_by_instance(protocol);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
154
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
155 purple_prefs_disconnect_by_handle(protocol);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
156
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
157 user_splits_free(protocol);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 36847
diff changeset
158 account_options_free(protocol);
36686
9807e4acf281 Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents: 36681
diff changeset
159 icon_spec_free(protocol);
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
160
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
161 parent_class->finalize(object);
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
162 }
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
163
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
164 static void
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
165 purple_protocol_class_init(PurpleProtocolClass *klass)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
166 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
167 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
168
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
169 parent_class = g_type_class_peek_parent(klass);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
170
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
171 obj_class->finalize = purple_protocol_finalize;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
172 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
173
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
174 GType
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
175 purple_protocol_get_type(void)
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
176 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
177 static GType type = 0;
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
178
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
179 if (G_UNLIKELY(type == 0)) {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
180 static const GTypeInfo info = {
36681
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
181 .class_size = sizeof(PurpleProtocolClass),
9c38716c8eb7 Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents: 36637
diff changeset
182 .class_init = (GClassInitFunc)purple_protocol_class_init,
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
183 .instance_size = sizeof(PurpleProtocol),
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
184 .instance_init = (GInstanceInitFunc)purple_protocol_init,
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
185 };
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
186
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
187 type = g_type_register_static(G_TYPE_OBJECT, "PurpleProtocol",
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
188 &info, G_TYPE_FLAG_ABSTRACT);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
189 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
190
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
191 return type;
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
192 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
193
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
194 /**************************************************************************
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
195 * Protocol Class API
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
196 **************************************************************************/
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
197 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
198 PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
199 g_return_if_fail(klass != NULL); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
200 if (klass->funcname) \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
201 klass->funcname(__VA_ARGS__);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
202
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
203 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
204 PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
205 g_return_val_if_fail(klass != NULL, defaultreturn); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
206 if (klass->funcname) \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
207 return klass->funcname(__VA_ARGS__); \
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
208 else \
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
209 return defaultreturn;
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
210
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
211 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
212 purple_protocol_class_login(PurpleProtocol *protocol, PurpleAccount *account)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
213 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
214 DEFINE_PROTOCOL_FUNC(protocol, login, account);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
215 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
216
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
217 void
36731
38de3f22e864 Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents: 36726
diff changeset
218 purple_protocol_class_close(PurpleProtocol *protocol, PurpleConnection *gc)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
219 {
36731
38de3f22e864 Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents: 36726
diff changeset
220 DEFINE_PROTOCOL_FUNC(protocol, close, gc);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
221 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
222
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
223 GList *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
224 purple_protocol_class_status_types(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
225 PurpleAccount *account)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
226 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
227 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, status_types, account);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
228 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
229
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
230 const char *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
231 purple_protocol_class_list_icon(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
232 PurpleAccount *account, PurpleBuddy *buddy)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
233 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
234 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, list_icon, account, buddy);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
235 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
236
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
237 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
238 #undef DEFINE_PROTOCOL_FUNC
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
239
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
240 /**************************************************************************
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
241 * Protocol Client Interface API
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
242 **************************************************************************/
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
243 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
244 PurpleProtocolClientInterface *client_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
245 PURPLE_PROTOCOL_CLIENT_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
246 if (client_iface && client_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
247 client_iface->funcname(__VA_ARGS__);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
248
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
249 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
250 PurpleProtocolClientInterface *client_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
251 PURPLE_PROTOCOL_CLIENT_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
252 if (client_iface && client_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
253 return client_iface->funcname(__VA_ARGS__); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
254 else \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
255 return defaultreturn;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
256
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
257 GType
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
258 purple_protocol_client_iface_get_type(void)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
259 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
260 static GType type = 0;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
261
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
262 if (G_UNLIKELY(type == 0)) {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
263 static const GTypeInfo info = {
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
264 .class_size = sizeof(PurpleProtocolClientInterface),
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
265 };
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
266
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
267 type = g_type_register_static(G_TYPE_INTERFACE,
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
268 "PurpleProtocolClientInterface", &info, 0);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
269 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
270 return type;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
271 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
272
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
273 GList *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
274 purple_protocol_client_iface_get_actions(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
275 PurpleConnection *gc)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
276 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
277 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_actions, gc);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
278 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
279
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
280 const char *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
281 purple_protocol_client_iface_list_emblem(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
282 PurpleBuddy *buddy)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
283 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
284 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, list_emblem, buddy);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
285 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
286
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
287 char *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
288 purple_protocol_client_iface_status_text(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
289 PurpleBuddy *buddy)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
290 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
291 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, status_text, buddy);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
292 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
293
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
294 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
295 purple_protocol_client_iface_tooltip_text(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
296 PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
297 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
298 DEFINE_PROTOCOL_FUNC(protocol, tooltip_text, buddy, user_info, full);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
299 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
300
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
301 GList *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
302 purple_protocol_client_iface_blist_node_menu(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
303 PurpleBlistNode *node)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
304 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
305 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, blist_node_menu, node);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
306 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
307
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
308 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
309 purple_protocol_client_iface_buddy_free(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
310 PurpleBuddy *buddy)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
311 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
312 DEFINE_PROTOCOL_FUNC(protocol, buddy_free, buddy);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
313 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
314
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
315 void
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
316 purple_protocol_client_iface_convo_closed(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
317 PurpleConnection *gc, const char *who)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
318 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
319 DEFINE_PROTOCOL_FUNC(protocol, convo_closed, gc, who);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
320 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
321
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
322 const char *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
323 purple_protocol_client_iface_normalize(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
324 const PurpleAccount *account, const char *who)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
325 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
326 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, normalize, account, who);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
327 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
328
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
329 PurpleChat *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
330 purple_protocol_client_iface_find_blist_chat(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
331 PurpleAccount *account, const char *name)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
332 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
333 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, find_blist_chat, account,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
334 name);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
335 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
336
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
337 gboolean
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
338 purple_protocol_client_iface_offline_message(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
339 const PurpleBuddy *buddy)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
340 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
341 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, offline_message, buddy);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
342 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
343
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
344 GHashTable *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
345 purple_protocol_client_iface_get_account_text_table(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
346 PurpleAccount *account)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
347 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
348 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_account_text_table,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
349 account);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
350 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
351
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
352 PurpleMood *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
353 purple_protocol_client_iface_get_moods(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
354 PurpleAccount *account)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
355 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
356 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_moods, account);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
357 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
358
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
359 gssize
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
360 purple_protocol_client_iface_get_max_message_size(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
361 PurpleConversation *conv)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
362 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
363 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, get_max_message_size, conv);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
364 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
365
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
366 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
367 #undef DEFINE_PROTOCOL_FUNC
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
368
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
369 /**************************************************************************
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
370 * Protocol Server Interface API
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
371 **************************************************************************/
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
372 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
373 PurpleProtocolServerInterface *server_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
374 PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
375 if (server_iface && server_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
376 server_iface->funcname(__VA_ARGS__);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
377
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
378 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
379 PurpleProtocolServerInterface *server_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
380 PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
381 if (server_iface && server_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
382 return server_iface->funcname(__VA_ARGS__); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
383 else \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
384 return defaultreturn;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
385
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
386 GType
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
387 purple_protocol_server_iface_get_type(void)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
388 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
389 static GType type = 0;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
390
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
391 if (G_UNLIKELY(type == 0)) {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
392 static const GTypeInfo info = {
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
393 .class_size = sizeof(PurpleProtocolServerInterface),
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
394 };
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
395
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
396 type = g_type_register_static(G_TYPE_INTERFACE,
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
397 "PurpleProtocolServerInterface", &info, 0);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
398 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
399 return type;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
400 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
401
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
402 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
403 purple_protocol_server_iface_register_user(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
404 PurpleAccount *account)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
405 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
406 DEFINE_PROTOCOL_FUNC(protocol, register_user, account);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
407 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
408
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
409 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
410 purple_protocol_server_iface_unregister_user(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
411 PurpleAccount *account, PurpleAccountUnregistrationCb cb,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
412 void *user_data)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
413 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
414 DEFINE_PROTOCOL_FUNC(protocol, unregister_user, account, cb, user_data);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
415 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
416
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
417 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
418 purple_protocol_server_iface_set_info(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
419 PurpleConnection *gc, const char *info)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
420 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
421 DEFINE_PROTOCOL_FUNC(protocol, set_info, gc, info);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
422 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
423
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
424 void
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
425 purple_protocol_server_iface_get_info(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
426 PurpleConnection *gc, const char *who)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
427 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
428 DEFINE_PROTOCOL_FUNC(protocol, get_info, gc, who);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
429 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
430
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
431 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
432 purple_protocol_server_iface_set_status(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
433 PurpleAccount *account, PurpleStatus *status)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
434 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
435 DEFINE_PROTOCOL_FUNC(protocol, set_status, account, status);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
436 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
437
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
438 void
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
439 purple_protocol_server_iface_set_idle(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
440 PurpleConnection *gc, int idletime)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
441 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
442 DEFINE_PROTOCOL_FUNC(protocol, set_idle, gc, idletime);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
443 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
444
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
445 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
446 purple_protocol_server_iface_change_passwd(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
447 PurpleConnection *gc, const char *old_pass, const char *new_pass)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
448 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
449 DEFINE_PROTOCOL_FUNC(protocol, change_passwd, gc, old_pass, new_pass);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
450 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
451
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
452 void
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
453 purple_protocol_server_iface_add_buddy(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
454 PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
455 const char *message)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
456 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
457 DEFINE_PROTOCOL_FUNC(protocol, add_buddy, gc, buddy, group, message);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
458 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
459
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
460 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
461 purple_protocol_server_iface_add_buddies(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
462 PurpleConnection *gc, GList *buddies, GList *groups,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
463 const char *message)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
464 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
465 DEFINE_PROTOCOL_FUNC(protocol, add_buddies, gc, buddies, groups, message);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
466 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
467
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
468 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
469 purple_protocol_server_iface_remove_buddy(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
470 PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
471 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
472 DEFINE_PROTOCOL_FUNC(protocol, remove_buddy, gc, buddy, group);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
473 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
474
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
475 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
476 purple_protocol_server_iface_remove_buddies(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
477 PurpleConnection *gc, GList *buddies, GList *groups)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
478 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
479 DEFINE_PROTOCOL_FUNC(protocol, remove_buddies, gc, buddies, groups);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
480 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
481
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
482 void
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
483 purple_protocol_server_iface_keepalive(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
484 PurpleConnection *gc)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
485 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
486 DEFINE_PROTOCOL_FUNC(protocol, keepalive, gc);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
487 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
488
39518
6141cf90e5b8 libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents: 39352
diff changeset
489 int
6141cf90e5b8 libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents: 39352
diff changeset
490 purple_protocol_server_iface_get_keepalive_interval(PurpleProtocol *protocol)
6141cf90e5b8 libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents: 39352
diff changeset
491 {
6141cf90e5b8 libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents: 39352
diff changeset
492 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 30, get_keepalive_interval);
6141cf90e5b8 libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents: 39352
diff changeset
493 }
6141cf90e5b8 libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents: 39352
diff changeset
494
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
495 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
496 purple_protocol_server_iface_alias_buddy(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
497 PurpleConnection *gc, const char *who, const char *alias)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
498 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
499 DEFINE_PROTOCOL_FUNC(protocol, alias_buddy, gc, who, alias);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
500 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
501
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
502 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
503 purple_protocol_server_iface_group_buddy(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
504 PurpleConnection *gc, const char *who, const char *old_group,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
505 const char *new_group)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
506 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
507 DEFINE_PROTOCOL_FUNC(protocol, group_buddy, gc, who, old_group, new_group);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
508 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
509
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
510 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
511 purple_protocol_server_iface_rename_group(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
512 PurpleConnection *gc, const char *old_name, PurpleGroup *group,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
513 GList *moved_buddies)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
514 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
515 DEFINE_PROTOCOL_FUNC(protocol, rename_group, gc, old_name, group,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
516 moved_buddies);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
517 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
518
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
519 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
520 purple_protocol_server_iface_set_buddy_icon(PurpleProtocol *protocol,
37134
07746c9a04bf Merged default branch
Ankit Vani <a@nevitus.org>
parents: 37038
diff changeset
521 PurpleConnection *gc, PurpleImage *img)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
522 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
523 DEFINE_PROTOCOL_FUNC(protocol, set_buddy_icon, gc, img);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
524 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
525
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
526 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
527 purple_protocol_server_iface_remove_group(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
528 PurpleConnection *gc, PurpleGroup *group)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
529 {
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
530 DEFINE_PROTOCOL_FUNC(protocol, remove_group, gc, group);
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
531 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
532
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
533 int
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
534 purple_protocol_server_iface_send_raw(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
535 PurpleConnection *gc, const char *buf, int len)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
536 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
537 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send_raw, gc, buf, len);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
538 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
539
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
540 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
541 purple_protocol_server_iface_set_public_alias(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
542 PurpleConnection *gc, const char *alias,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
543 PurpleSetPublicAliasSuccessCallback success_cb,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
544 PurpleSetPublicAliasFailureCallback failure_cb)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
545 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
546 DEFINE_PROTOCOL_FUNC(protocol, set_public_alias, gc, alias, success_cb,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
547 failure_cb);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
548 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
549
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
550 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
551 purple_protocol_server_iface_get_public_alias(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
552 PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
553 PurpleGetPublicAliasFailureCallback failure_cb)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
554 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
555 DEFINE_PROTOCOL_FUNC(protocol, get_public_alias, gc, success_cb,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
556 failure_cb);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
557 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
558
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
559 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
560 #undef DEFINE_PROTOCOL_FUNC
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
561
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
562 /**************************************************************************
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
563 * Protocol IM Interface API
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
564 **************************************************************************/
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
565 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
566 PurpleProtocolIMInterface *im_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
567 PURPLE_PROTOCOL_IM_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
568 if (im_iface && im_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
569 im_iface->funcname(__VA_ARGS__);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
570
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
571 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
572 PurpleProtocolIMInterface *im_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
573 PURPLE_PROTOCOL_IM_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
574 if (im_iface && im_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
575 return im_iface->funcname(__VA_ARGS__); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
576 else \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
577 return defaultreturn;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
578
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
579 GType
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
580 purple_protocol_im_iface_get_type(void)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
581 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
582 static GType type = 0;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
583
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
584 if (G_UNLIKELY(type == 0)) {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
585 static const GTypeInfo info = {
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
586 .class_size = sizeof(PurpleProtocolIMInterface),
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
587 };
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
588
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
589 type = g_type_register_static(G_TYPE_INTERFACE,
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
590 "PurpleProtocolIMInterface", &info, 0);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
591 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
592 return type;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
593 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
594
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
595 int
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
596 purple_protocol_im_iface_send(PurpleProtocol *protocol, PurpleConnection *gc,
37148
50f361d39a1e Merged default branch
Ankit Vani <a@nevitus.org>
parents: 37134
diff changeset
597 PurpleMessage *msg)
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
598 {
37148
50f361d39a1e Merged default branch
Ankit Vani <a@nevitus.org>
parents: 37134
diff changeset
599 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send, gc, msg);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
600 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
601
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
602 unsigned int
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
603 purple_protocol_im_iface_send_typing(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
604 PurpleConnection *gc, const char *name, PurpleIMTypingState state)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
605 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
606 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send_typing, gc, name, state);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
607 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
608
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
609 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
610 #undef DEFINE_PROTOCOL_FUNC
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
611
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
612 /**************************************************************************
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
613 * Protocol Chat Interface API
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
614 **************************************************************************/
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
615 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
616 PurpleProtocolChatInterface *chat_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
617 PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
618 if (chat_iface && chat_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
619 chat_iface->funcname(__VA_ARGS__);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
620
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
621 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
622 PurpleProtocolChatInterface *chat_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
623 PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
624 if (chat_iface && chat_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
625 return chat_iface->funcname(__VA_ARGS__); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
626 else \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
627 return defaultreturn;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
628
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
629 GType
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
630 purple_protocol_chat_iface_get_type(void)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
631 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
632 static GType type = 0;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
633
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
634 if (G_UNLIKELY(type == 0)) {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
635 static const GTypeInfo info = {
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
636 .class_size = sizeof(PurpleProtocolChatInterface),
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
637 };
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
638
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
639 type = g_type_register_static(G_TYPE_INTERFACE,
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
640 "PurpleProtocolChatInterface", &info, 0);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
641 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
642 return type;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
643 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
644
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
645 GList *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
646 purple_protocol_chat_iface_info(PurpleProtocol *protocol, PurpleConnection *gc)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
647 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
648 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, info, gc);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
649 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
650
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
651 GHashTable *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
652 purple_protocol_chat_iface_info_defaults(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
653 PurpleConnection *gc, const char *chat_name)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
654 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
655 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, info_defaults, gc,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
656 chat_name);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
657 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
658
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
659 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
660 purple_protocol_chat_iface_join(PurpleProtocol *protocol, PurpleConnection *gc,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
661 GHashTable *components)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
662 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
663 DEFINE_PROTOCOL_FUNC(protocol, join, gc, components);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
664 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
665
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
666 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
667 purple_protocol_chat_iface_reject(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
668 PurpleConnection *gc, GHashTable *components)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
669 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
670 DEFINE_PROTOCOL_FUNC(protocol, reject, gc, components);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
671 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
672
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
673 char *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
674 purple_protocol_chat_iface_get_name(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
675 GHashTable *components)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
676 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
677 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_name, components);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
678 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
679
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
680 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
681 purple_protocol_chat_iface_invite(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
682 PurpleConnection *gc, int id, const char *message, const char *who)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
683 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
684 DEFINE_PROTOCOL_FUNC(protocol, invite, gc, id, message, who);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
685 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
686
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
687 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
688 purple_protocol_chat_iface_leave(PurpleProtocol *protocol, PurpleConnection *gc,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
689 int id)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
690 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
691 DEFINE_PROTOCOL_FUNC(protocol, leave, gc, id);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
692 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
693
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
694 int
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
695 purple_protocol_chat_iface_send(PurpleProtocol *protocol, PurpleConnection *gc,
37148
50f361d39a1e Merged default branch
Ankit Vani <a@nevitus.org>
parents: 37134
diff changeset
696 int id, PurpleMessage *msg)
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
697 {
37148
50f361d39a1e Merged default branch
Ankit Vani <a@nevitus.org>
parents: 37134
diff changeset
698 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send, gc, id, msg);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
699 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
700
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
701 char *
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
702 purple_protocol_chat_iface_get_user_real_name(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
703 PurpleConnection *gc, int id, const char *who)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
704 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
705 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_user_real_name, gc, id,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
706 who);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
707 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
708
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
709 void
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
710 purple_protocol_chat_iface_set_topic(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
711 PurpleConnection *gc, int id, const char *topic)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
712 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
713 DEFINE_PROTOCOL_FUNC(protocol, set_topic, gc, id, topic);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
714 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
715
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
716 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
717 #undef DEFINE_PROTOCOL_FUNC
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
718
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
719 /**************************************************************************
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
720 * Protocol Privacy Interface API
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
721 **************************************************************************/
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
722 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
723 PurpleProtocolPrivacyInterface *privacy_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
724 PURPLE_PROTOCOL_PRIVACY_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
725 if (privacy_iface && privacy_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
726 privacy_iface->funcname(__VA_ARGS__);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
727
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
728 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
729 PurpleProtocolPrivacyInterface *privacy_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
730 PURPLE_PROTOCOL_PRIVACY_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
731 if (privacy_iface && privacy_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
732 return privacy_iface->funcname(__VA_ARGS__); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
733 else \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
734 return defaultreturn;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
735
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
736 GType
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
737 purple_protocol_privacy_iface_get_type(void)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
738 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
739 static GType type = 0;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
740
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
741 if (G_UNLIKELY(type == 0)) {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
742 static const GTypeInfo info = {
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
743 .class_size = sizeof(PurpleProtocolPrivacyInterface),
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
744 };
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
745
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
746 type = g_type_register_static(G_TYPE_INTERFACE,
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
747 "PurpleProtocolPrivacyInterface", &info, 0);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
748 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
749 return type;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
750 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
751
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
752 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
753 purple_protocol_privacy_iface_add_permit(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
754 PurpleConnection *gc, const char *name)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
755 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
756 DEFINE_PROTOCOL_FUNC(protocol, add_permit, gc, name);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
757 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
758
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
759 void
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
760 purple_protocol_privacy_iface_add_deny(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
761 PurpleConnection *gc, const char *name)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
762 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
763 DEFINE_PROTOCOL_FUNC(protocol, add_deny, gc, name);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
764 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
765
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
766 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
767 purple_protocol_privacy_iface_rem_permit(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
768 PurpleConnection *gc, const char *name)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
769 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
770 DEFINE_PROTOCOL_FUNC(protocol, rem_permit, gc, name);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
771 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
772
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
773 void
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
774 purple_protocol_privacy_iface_rem_deny(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
775 PurpleConnection *gc, const char *name)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
776 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
777 DEFINE_PROTOCOL_FUNC(protocol, rem_deny, gc, name);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
778 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
779
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
780 void
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
781 purple_protocol_privacy_iface_set_permit_deny(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
782 PurpleConnection *gc)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
783 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
784 DEFINE_PROTOCOL_FUNC(protocol, set_permit_deny, gc);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
785 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
786
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
787 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
788 #undef DEFINE_PROTOCOL_FUNC
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
789
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
790 /**************************************************************************
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
791 * Protocol Media Interface API
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
792 **************************************************************************/
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
793 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
794 PurpleProtocolMediaInterface *media_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
795 PURPLE_PROTOCOL_MEDIA_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
796 if (media_iface && media_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
797 media_iface->funcname(__VA_ARGS__);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
798
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
799 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
800 PurpleProtocolMediaInterface *media_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
801 PURPLE_PROTOCOL_MEDIA_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
802 if (media_iface && media_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
803 return media_iface->funcname(__VA_ARGS__); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
804 else \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
805 return defaultreturn;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
806
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
807 GType
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
808 purple_protocol_media_iface_get_type(void)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
809 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
810 static GType type = 0;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
811
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
812 if (G_UNLIKELY(type == 0)) {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
813 static const GTypeInfo info = {
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
814 .class_size = sizeof(PurpleProtocolMediaInterface),
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
815 };
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
816
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
817 type = g_type_register_static(G_TYPE_INTERFACE,
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
818 "PurpleProtocolMediaInterface", &info, 0);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
819 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
820 return type;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
821 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
822
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
823 gboolean
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
824 purple_protocol_media_iface_initiate_session(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
825 PurpleAccount *account, const char *who, PurpleMediaSessionType type)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
826 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
827 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, initiate_session, account,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
828 who, type);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
829 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
830
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
831 PurpleMediaCaps
36719
0d7682bdf828 Updated protocol iface calls
Ankit Vani <a@nevitus.org>
parents: 36716
diff changeset
832 purple_protocol_media_iface_get_caps(PurpleProtocol *protocol,
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
833 PurpleAccount *account, const char *who)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
834 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
835 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, get_caps, account, who);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
836 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
837
37164
aea7e3b20138 Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents: 37148
diff changeset
838 gboolean purple_protocol_media_iface_send_dtmf(PurpleProtocol *protocol,
aea7e3b20138 Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents: 37148
diff changeset
839 PurpleMedia *media, gchar dtmf, guint8 volume, guint8 duration)
aea7e3b20138 Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents: 37148
diff changeset
840 {
aea7e3b20138 Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents: 37148
diff changeset
841 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, send_dtmf, media,
aea7e3b20138 Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents: 37148
diff changeset
842 dtmf, volume, duration);
aea7e3b20138 Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents: 37148
diff changeset
843 }
aea7e3b20138 Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents: 37148
diff changeset
844
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
845 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
846 #undef DEFINE_PROTOCOL_FUNC
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
847
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
848 /**************************************************************************
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
849 * Protocol Factory Interface API
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
850 **************************************************************************/
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
851 #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
852 PurpleProtocolFactoryInterface *factory_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
853 PURPLE_PROTOCOL_FACTORY_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
854 if (factory_iface && factory_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
855 factory_iface->funcname(__VA_ARGS__);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
856
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
857 #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
858 PurpleProtocolFactoryInterface *factory_iface = \
39759
ea1401483849 Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39757
diff changeset
859 PURPLE_PROTOCOL_FACTORY_GET_IFACE(protocol); \
36726
8856f5dd6af0 silenced unwanted warnings
Ankit Vani <a@nevitus.org>
parents: 36722
diff changeset
860 if (factory_iface && factory_iface->funcname) \
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
861 return factory_iface->funcname(__VA_ARGS__); \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
862 else \
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
863 return defaultreturn;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
864
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
865 GType
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
866 purple_protocol_factory_iface_get_type(void)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
867 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
868 static GType type = 0;
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
869
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
870 if (G_UNLIKELY(type == 0)) {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
871 static const GTypeInfo info = {
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
872 .class_size = sizeof(PurpleProtocolFactoryInterface),
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
873 };
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
874
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
875 type = g_type_register_static(G_TYPE_INTERFACE,
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39668
diff changeset
876 "PurpleProtocolFactoryInterface", &info, 0);
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
877 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
878 return type;
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
879 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
880
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
881 PurpleConnection *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
882 purple_protocol_factory_iface_connection_new(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
883 PurpleAccount *account, const char *password)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
884 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
885 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, connection_new, protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
886 account, password);
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
887 }
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
888
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
889 PurpleRoomlist *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
890 purple_protocol_factory_iface_roomlist_new(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
891 PurpleAccount *account)
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
892 {
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
893 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, roomlist_new, account);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
894 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
895
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
896 PurpleWhiteboard *
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
897 purple_protocol_factory_iface_whiteboard_new(PurpleProtocol *protocol,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
898 PurpleAccount *account, const char *who, int state)
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
899 {
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
900 DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, whiteboard_new, account,
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
901 who, state);
36617
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
902 }
be16459a68e9 Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents: 36560
diff changeset
903
36722
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
904 #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN
49872e1ec30e Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents: 36719
diff changeset
905 #undef DEFINE_PROTOCOL_FUNC

mercurial