Sat, 16 Mar 2019 15:26:34 +0100
libpurple: Make keepalive interval configurable
| 36560 | 1 | /* |
| 2 | * purple | |
| 3 | * | |
| 4 | * Purple is the legal property of its developers, whose names are too numerous | |
| 5 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 6 | * source distribution. | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
| 21 | * | |
| 22 | */ | |
| 23 | #include "protocol.h" | |
| 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 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
122 | void |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
123 | purple_protocol_override(PurpleProtocol *protocol, |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
124 | PurpleProtocolOverrideFlags flags) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
125 | { |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
126 | g_return_if_fail(PURPLE_IS_PROTOCOL(protocol)); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
127 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
128 | if (flags & PURPLE_PROTOCOL_OVERRIDE_USER_SPLITS) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
129 | user_splits_free(protocol); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
130 | if (flags & PURPLE_PROTOCOL_OVERRIDE_PROTOCOL_OPTIONS) |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
131 | account_options_free(protocol); |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
132 | if (flags & PURPLE_PROTOCOL_OVERRIDE_ICON_SPEC) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
133 | icon_spec_free(protocol); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
134 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
135 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
136 | /************************************************************************** |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
137 | * GObject stuff |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
138 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
139 | static void |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
140 | 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
|
141 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
142 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
143 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
144 | static void |
|
36847
58597c72e6ac
Moved dispose() code from PurplePluginInfo and PurpleProtocol to finalize()
Ankit Vani <a@nevitus.org>
parents:
36844
diff
changeset
|
145 | 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
|
146 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
147 | 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
|
148 | 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
|
149 | |
|
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
|
150 | 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
|
151 | 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
|
152 | 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
|
153 | 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
|
154 | 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
|
155 | |
|
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
|
156 | 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
|
157 | 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
|
158 | 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
|
159 | } |
|
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 | 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
|
162 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
163 | 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
|
164 | 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
|
165 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
166 | 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
|
167 | 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
|
168 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
169 | 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
|
170 | |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
171 | 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
|
172 | account_options_free(protocol); |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
173 | 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
|
174 | |
|
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
|
175 | 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
|
176 | } |
|
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
|
177 | |
|
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
|
178 | static void |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
179 | 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
|
180 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
181 | 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
|
182 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
183 | 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
|
184 | |
|
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
|
185 | 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
|
186 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
187 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
188 | GType |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
189 | 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
|
190 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
191 | 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
|
192 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
193 | 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
|
194 | 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
|
195 | .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
|
196 | .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
|
197 | .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
|
198 | .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
|
199 | }; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
200 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
201 | 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
|
202 | &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
|
203 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
204 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
205 | return type; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
206 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
207 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
208 | /************************************************************************** |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
209 | * 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
|
210 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
211 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
212 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
213 | g_return_if_fail(klass != NULL); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
214 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
215 | 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
|
216 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
217 | #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
|
218 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
219 | g_return_val_if_fail(klass != NULL, defaultreturn); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
220 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
221 | 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
|
222 | else \ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
223 | return defaultreturn; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
224 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
225 | void |
| 36719 | 226 | 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
|
227 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
228 | 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
|
229 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
230 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
231 | void |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
232 | 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
|
233 | { |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
234 | DEFINE_PROTOCOL_FUNC(protocol, close, gc); |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
235 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
236 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
237 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
238 | purple_protocol_class_status_types(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
239 | PurpleAccount *account) |
|
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 | 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
|
242 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
243 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
244 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
245 | purple_protocol_class_list_icon(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
246 | PurpleAccount *account, PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
247 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
248 | 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
|
249 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
250 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
251 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
252 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
253 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
254 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
255 | * Protocol Client Interface API |
|
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 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
258 | PurpleProtocolClientIface *client_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
259 | PURPLE_PROTOCOL_GET_CLIENT_IFACE(protocol); \ |
| 36726 | 260 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
261 | client_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
262 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
263 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
264 | PurpleProtocolClientIface *client_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
265 | PURPLE_PROTOCOL_GET_CLIENT_IFACE(protocol); \ |
| 36726 | 266 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
267 | return client_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
268 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
269 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
270 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
271 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
272 | 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
|
273 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
274 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
275 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
276 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
277 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
278 | .class_size = sizeof(PurpleProtocolClientIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
281 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
282 | "PurpleProtocolClientIface", &info, 0); |
|
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 | return type; |
|
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 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
288 | purple_protocol_client_iface_get_actions(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
289 | PurpleConnection *gc) |
|
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, get_actions, gc); |
|
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 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
295 | purple_protocol_client_iface_list_emblem(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
296 | PurpleBuddy *buddy) |
|
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_WITH_RETURN(protocol, NULL, list_emblem, buddy); |
|
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 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
302 | purple_protocol_client_iface_status_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
303 | PurpleBuddy *buddy) |
|
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, status_text, buddy); |
|
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_tooltip_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
310 | PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
|
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, tooltip_text, buddy, user_info, full); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
313 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
314 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
315 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
316 | purple_protocol_client_iface_blist_node_menu(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
317 | PurpleBlistNode *node) |
|
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_WITH_RETURN(protocol, NULL, blist_node_menu, node); |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
323 | purple_protocol_client_iface_buddy_free(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
324 | PurpleBuddy *buddy) |
|
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(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
|
327 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
328 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
329 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
330 | purple_protocol_client_iface_convo_closed(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
331 | PurpleConnection *gc, const char *who) |
|
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(protocol, convo_closed, gc, who); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
334 | } |
|
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 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
337 | purple_protocol_client_iface_normalize(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
338 | const PurpleAccount *account, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
339 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
340 | 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
|
341 | } |
|
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 | PurpleChat * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
344 | purple_protocol_client_iface_find_blist_chat(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
345 | PurpleAccount *account, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
346 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
347 | 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
|
348 | name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
349 | } |
|
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 | gboolean |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
352 | purple_protocol_client_iface_offline_message(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
353 | const PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
354 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
355 | 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
|
356 | } |
|
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 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
359 | 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
|
360 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
361 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
362 | 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
|
363 | account); |
|
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 | PurpleMood * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
367 | purple_protocol_client_iface_get_moods(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
368 | PurpleAccount *account) |
|
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 | 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
|
371 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
372 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
373 | gssize |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
374 | 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
|
375 | PurpleConversation *conv) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
376 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
377 | 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
|
378 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
379 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
380 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
381 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
382 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
383 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
384 | * Protocol Server Interface API |
|
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 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
387 | PurpleProtocolServerIface *server_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
388 | PURPLE_PROTOCOL_GET_SERVER_IFACE(protocol); \ |
| 36726 | 389 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
390 | server_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
391 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
392 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
393 | PurpleProtocolServerIface *server_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
394 | PURPLE_PROTOCOL_GET_SERVER_IFACE(protocol); \ |
| 36726 | 395 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
396 | return server_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
397 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
398 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
399 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
400 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
401 | purple_protocol_server_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
402 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
403 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
404 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
405 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
406 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
407 | .class_size = sizeof(PurpleProtocolServerIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
410 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
411 | "PurpleProtocolServerIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
412 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
413 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
414 | } |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
417 | purple_protocol_server_iface_register_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
418 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
419 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
420 | DEFINE_PROTOCOL_FUNC(protocol, register_user, account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
421 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
422 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
423 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
424 | purple_protocol_server_iface_unregister_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
425 | PurpleAccount *account, PurpleAccountUnregistrationCb cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
426 | void *user_data) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
427 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
428 | 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
|
429 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
430 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
431 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
432 | purple_protocol_server_iface_set_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
433 | 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
|
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_info, gc, info); |
|
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_get_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
440 | 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
|
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, 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
|
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 | 446 | purple_protocol_server_iface_set_status(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
447 | 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
|
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, 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
|
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_set_idle(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
454 | 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
|
455 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
456 | 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
|
457 | } |
|
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 | void |
| 36719 | 460 | purple_protocol_server_iface_change_passwd(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
461 | 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
|
462 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
463 | 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
|
464 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
465 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
466 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
467 | purple_protocol_server_iface_add_buddy(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
468 | PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
469 | 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
|
470 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
471 | 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
|
472 | } |
|
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 | void |
| 36719 | 475 | purple_protocol_server_iface_add_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
476 | PurpleConnection *gc, GList *buddies, GList *groups, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
477 | 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
|
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, 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
|
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 |
| 36719 | 483 | purple_protocol_server_iface_remove_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
484 | 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
|
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, 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
|
487 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
488 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
489 | void |
| 36719 | 490 | purple_protocol_server_iface_remove_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
491 | 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
|
492 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
493 | 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
|
494 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
495 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
496 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
497 | purple_protocol_server_iface_keepalive(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
498 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
499 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
500 | 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
|
501 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
502 | |
|
39518
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
503 | int |
|
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
504 | 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
|
505 | { |
|
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
506 | 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
|
507 | } |
|
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
508 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
509 | void |
| 36719 | 510 | purple_protocol_server_iface_alias_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
511 | 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
|
512 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
513 | 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
|
514 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
515 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
516 | void |
| 36719 | 517 | purple_protocol_server_iface_group_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
518 | PurpleConnection *gc, const char *who, const char *old_group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
519 | 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
|
520 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
521 | 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
|
522 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
523 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
524 | void |
| 36719 | 525 | purple_protocol_server_iface_rename_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
526 | PurpleConnection *gc, const char *old_name, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
527 | 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
|
528 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
529 | 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
|
530 | moved_buddies); |
|
36617
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 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
533 | void |
| 36719 | 534 | purple_protocol_server_iface_set_buddy_icon(PurpleProtocol *protocol, |
| 37134 | 535 | 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
|
536 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
537 | 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
|
538 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
539 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
540 | void |
| 36719 | 541 | purple_protocol_server_iface_remove_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
542 | 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
|
543 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
544 | 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
|
545 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
546 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
547 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
548 | purple_protocol_server_iface_send_raw(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
549 | PurpleConnection *gc, const char *buf, int len) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
550 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
551 | 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
|
552 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
553 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
554 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
555 | purple_protocol_server_iface_set_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
556 | PurpleConnection *gc, const char *alias, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
557 | PurpleSetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
558 | PurpleSetPublicAliasFailureCallback failure_cb) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
559 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
560 | 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
|
561 | failure_cb); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
564 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
565 | purple_protocol_server_iface_get_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
566 | PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
567 | PurpleGetPublicAliasFailureCallback failure_cb) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
568 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
569 | 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
|
570 | failure_cb); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
571 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
572 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
573 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
574 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
575 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
576 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
577 | * Protocol IM Interface API |
|
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 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
580 | PurpleProtocolIMIface *im_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
581 | PURPLE_PROTOCOL_GET_IM_IFACE(protocol); \ |
| 36726 | 582 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
583 | im_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
584 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
585 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
586 | PurpleProtocolIMIface *im_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
587 | PURPLE_PROTOCOL_GET_IM_IFACE(protocol); \ |
| 36726 | 588 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
589 | return im_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
590 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
591 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
592 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
593 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
594 | purple_protocol_im_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
595 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
596 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
597 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
598 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
599 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
600 | .class_size = sizeof(PurpleProtocolIMIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
603 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
604 | "PurpleProtocolIMIface", &info, 0); |
|
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 | return type; |
|
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 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
610 | purple_protocol_im_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
| 37148 | 611 | PurpleMessage *msg) |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
612 | { |
| 37148 | 613 | 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
|
614 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
615 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
616 | unsigned int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
617 | purple_protocol_im_iface_send_typing(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
618 | PurpleConnection *gc, const char *name, PurpleIMTypingState state) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
619 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
620 | 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
|
621 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
622 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
623 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
624 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
625 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
626 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
627 | * Protocol Chat Interface API |
|
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 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
630 | PurpleProtocolChatIface *chat_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
631 | PURPLE_PROTOCOL_GET_CHAT_IFACE(protocol); \ |
| 36726 | 632 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
633 | chat_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
634 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
635 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
636 | PurpleProtocolChatIface *chat_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
637 | PURPLE_PROTOCOL_GET_CHAT_IFACE(protocol); \ |
| 36726 | 638 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
639 | return chat_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
640 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
641 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
642 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
643 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
644 | purple_protocol_chat_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
645 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
646 | static GType type = 0; |
|
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 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
649 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
650 | .class_size = sizeof(PurpleProtocolChatIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
651 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
652 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
653 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
654 | "PurpleProtocolChatIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
655 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
656 | return type; |
|
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 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
660 | purple_protocol_chat_iface_info(PurpleProtocol *protocol, PurpleConnection *gc) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
661 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
662 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, info, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
663 | } |
|
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 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
666 | purple_protocol_chat_iface_info_defaults(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
667 | PurpleConnection *gc, const char *chat_name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
668 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
669 | 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
|
670 | chat_name); |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
674 | purple_protocol_chat_iface_join(PurpleProtocol *protocol, PurpleConnection *gc, |
|
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(protocol, join, gc, 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_reject(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
682 | PurpleConnection *gc, GHashTable *components) |
|
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, reject, gc, components); |
|
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 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
688 | purple_protocol_chat_iface_get_name(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
689 | GHashTable *components) |
|
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_WITH_RETURN(protocol, NULL, get_name, components); |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
695 | purple_protocol_chat_iface_invite(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
696 | 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
|
697 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
698 | DEFINE_PROTOCOL_FUNC(protocol, invite, gc, id, message, who); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
701 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
702 | purple_protocol_chat_iface_leave(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
703 | int id) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
704 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
705 | DEFINE_PROTOCOL_FUNC(protocol, leave, gc, id); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
706 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
707 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
708 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
709 | purple_protocol_chat_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
| 37148 | 710 | int id, PurpleMessage *msg) |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
711 | { |
| 37148 | 712 | 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
|
713 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
714 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
715 | char * |
| 36719 | 716 | 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
|
717 | 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
|
718 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
719 | 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
|
720 | who); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
721 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
722 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
723 | void |
| 36719 | 724 | purple_protocol_chat_iface_set_topic(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
725 | 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
|
726 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
727 | 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
|
728 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
729 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
730 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
731 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
732 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
733 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
734 | * Protocol Privacy Interface API |
|
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 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
737 | PurpleProtocolPrivacyIface *privacy_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
738 | PURPLE_PROTOCOL_GET_PRIVACY_IFACE(protocol); \ |
| 36726 | 739 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
740 | privacy_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
741 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
742 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
743 | PurpleProtocolPrivacyIface *privacy_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
744 | PURPLE_PROTOCOL_GET_PRIVACY_IFACE(protocol); \ |
| 36726 | 745 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
746 | return privacy_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
747 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
748 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
749 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
750 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
751 | 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
|
752 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
753 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
754 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
755 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
756 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
757 | .class_size = sizeof(PurpleProtocolPrivacyIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
758 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
759 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
760 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
761 | "PurpleProtocolPrivacyIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
762 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
763 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
764 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
765 | |
|
36722
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_add_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
768 | 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
|
769 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
770 | 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
|
771 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
772 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
773 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
774 | purple_protocol_privacy_iface_add_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
775 | 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
|
776 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
777 | DEFINE_PROTOCOL_FUNC(protocol, add_deny, gc, name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
778 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
779 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
780 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
781 | purple_protocol_privacy_iface_rem_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
782 | PurpleConnection *gc, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
783 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
784 | DEFINE_PROTOCOL_FUNC(protocol, rem_permit, gc, name); |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
788 | purple_protocol_privacy_iface_rem_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
789 | PurpleConnection *gc, const char *name) |
|
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 | 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
|
792 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
793 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
794 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
795 | purple_protocol_privacy_iface_set_permit_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
796 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
797 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
798 | DEFINE_PROTOCOL_FUNC(protocol, set_permit_deny, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
799 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
800 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
801 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
802 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
803 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
804 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
805 | * Protocol Roomlist Interface API |
|
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 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
808 | PurpleProtocolRoomlistIface *roomlist_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
809 | PURPLE_PROTOCOL_GET_ROOMLIST_IFACE(protocol); \ |
| 36726 | 810 | if (roomlist_iface && roomlist_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
811 | roomlist_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
812 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
813 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
814 | PurpleProtocolRoomlistIface *roomlist_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
815 | PURPLE_PROTOCOL_GET_ROOMLIST_IFACE(protocol); \ |
| 36726 | 816 | if (roomlist_iface && roomlist_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
817 | return roomlist_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
818 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
819 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
820 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
821 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
822 | purple_protocol_roomlist_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
|
823 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
824 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
825 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
826 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
827 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
828 | .class_size = sizeof(PurpleProtocolRoomlistIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
829 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
830 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
831 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
832 | "PurpleProtocolRoomlistIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
833 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
834 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
835 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
836 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
837 | PurpleRoomlist * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
838 | purple_protocol_roomlist_iface_get_list(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
839 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
840 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
841 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_list, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
842 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
843 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
844 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
845 | purple_protocol_roomlist_iface_cancel(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
846 | PurpleRoomlist *list) |
|
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 | DEFINE_PROTOCOL_FUNC(protocol, cancel, list); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
849 | } |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
852 | purple_protocol_roomlist_iface_expand_category(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
853 | PurpleRoomlist *list, PurpleRoomlistRoom *category) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
854 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
855 | DEFINE_PROTOCOL_FUNC(protocol, expand_category, list, category); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
856 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
857 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
858 | char * |
| 36719 | 859 | purple_protocol_roomlist_iface_room_serialize(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
860 | PurpleRoomlistRoom *room) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
861 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
862 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, room_serialize, room); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
863 | } |
|
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 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
866 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
867 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
868 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
869 | * Protocol Media Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
870 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
871 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
872 | PurpleProtocolMediaIface *media_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
873 | PURPLE_PROTOCOL_GET_MEDIA_IFACE(protocol); \ |
| 36726 | 874 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
875 | media_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
876 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
877 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
878 | PurpleProtocolMediaIface *media_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
879 | PURPLE_PROTOCOL_GET_MEDIA_IFACE(protocol); \ |
| 36726 | 880 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
881 | return media_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
882 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
883 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
884 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
885 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
886 | 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
|
887 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
888 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
889 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
890 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
891 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
892 | .class_size = sizeof(PurpleProtocolMediaIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
893 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
894 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
895 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
896 | "PurpleProtocolMediaIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
897 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
898 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
899 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
900 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
901 | gboolean |
| 36719 | 902 | purple_protocol_media_iface_initiate_session(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
903 | 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
|
904 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
905 | 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
|
906 | who, type); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
907 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
908 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
909 | PurpleMediaCaps |
| 36719 | 910 | purple_protocol_media_iface_get_caps(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
911 | 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
|
912 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
913 | 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
|
914 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
915 | |
|
37164
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
916 | 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
|
917 | 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
|
918 | { |
|
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
919 | 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
|
920 | dtmf, volume, duration); |
|
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
921 | } |
|
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
922 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
923 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
924 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
925 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
926 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
927 | * Protocol Factory Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
928 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
929 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
930 | PurpleProtocolFactoryIface *factory_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
931 | PURPLE_PROTOCOL_GET_FACTORY_IFACE(protocol); \ |
| 36726 | 932 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
933 | factory_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
934 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
935 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
936 | PurpleProtocolFactoryIface *factory_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
937 | PURPLE_PROTOCOL_GET_FACTORY_IFACE(protocol); \ |
| 36726 | 938 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
939 | return factory_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
940 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
941 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
942 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
943 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
944 | 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
|
945 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
946 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
947 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
948 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
949 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
950 | .class_size = sizeof(PurpleProtocolFactoryIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
951 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
952 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
953 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
954 | "PurpleProtocolFactoryIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
955 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
956 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
957 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
958 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
959 | PurpleConnection * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
960 | purple_protocol_factory_iface_connection_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
961 | 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
|
962 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
963 | 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
|
964 | account, password); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
965 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
966 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
967 | PurpleRoomlist * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
968 | purple_protocol_factory_iface_roomlist_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
969 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
970 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
971 | 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
|
972 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
973 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
974 | PurpleWhiteboard * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
975 | purple_protocol_factory_iface_whiteboard_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
976 | 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
|
977 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
978 | 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
|
979 | who, state); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
980 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
981 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
982 | PurpleXfer * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
983 | purple_protocol_factory_iface_xfer_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
984 | PurpleAccount *account, PurpleXferType type, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
985 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
986 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, xfer_new, account, type, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
987 | who); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
988 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
989 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
990 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
991 | #undef DEFINE_PROTOCOL_FUNC |