Mon, 11 Nov 2019 20:43:31 -0600
closing merged branch
| 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 | icon_spec_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 | |
|
36687
7a83a1a657e3
Removed unused declaration of purple_buddy_icon_spec_free()
Ankit Vani <a@nevitus.org>
parents:
36686
diff
changeset
|
91 | g_free(protocol->icon_spec); |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
92 | protocol->icon_spec = NULL; |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
93 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
94 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
95 | /************************************************************************** |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
96 | * GObject stuff |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
97 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
98 | static void |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
99 | 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
|
100 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
101 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
102 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
103 | static void |
|
36847
58597c72e6ac
Moved dispose() code from PurplePluginInfo and PurpleProtocol to finalize()
Ankit Vani <a@nevitus.org>
parents:
36844
diff
changeset
|
104 | 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
|
105 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
106 | 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
|
107 | 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
|
108 | |
|
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
|
109 | 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
|
110 | 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
|
111 | 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
|
112 | 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
|
113 | 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
|
114 | |
|
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
|
115 | 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
|
116 | 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
|
117 | 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
|
118 | } |
|
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
|
119 | |
|
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
|
120 | 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
|
121 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
122 | 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
|
123 | 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
|
124 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
125 | 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
|
126 | 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
|
127 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
128 | 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
|
129 | |
|
40065
3b61e89f42bd
Replace functions which called once with their bodies
qarkai <qarkai@gmail.com>
parents:
40063
diff
changeset
|
130 | g_list_free_full(protocol->user_splits, (GDestroyNotify)purple_account_user_split_destroy); |
|
3b61e89f42bd
Replace functions which called once with their bodies
qarkai <qarkai@gmail.com>
parents:
40063
diff
changeset
|
131 | g_list_free_full(protocol->account_options, (GDestroyNotify)purple_account_option_destroy); |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
132 | 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
|
133 | |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
134 | 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
|
135 | } |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
136 | |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
137 | static void |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
138 | 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
|
139 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
140 | 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
|
141 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
142 | 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
|
143 | |
|
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
|
144 | 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
|
145 | } |
|
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 | GType |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
148 | 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
|
149 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
150 | 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
|
151 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
152 | 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
|
153 | 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
|
154 | .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
|
155 | .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
|
156 | .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
|
157 | .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
|
158 | }; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
159 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
160 | 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
|
161 | &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
|
162 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
163 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
164 | return type; |
|
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 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
167 | /************************************************************************** |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
168 | * 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
|
169 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
170 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
171 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
172 | g_return_if_fail(klass != NULL); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
173 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
174 | 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
|
175 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
176 | #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
|
177 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
178 | g_return_val_if_fail(klass != NULL, defaultreturn); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
179 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
180 | 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
|
181 | else \ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
182 | return defaultreturn; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
183 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
184 | void |
| 36719 | 185 | 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
|
186 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
187 | 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
|
188 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
189 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
190 | void |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
191 | 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
|
192 | { |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
193 | DEFINE_PROTOCOL_FUNC(protocol, close, gc); |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
194 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
195 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
196 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
197 | purple_protocol_class_status_types(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
198 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
199 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
200 | 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
|
201 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
202 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
203 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
204 | purple_protocol_class_list_icon(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
205 | PurpleAccount *account, PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
206 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
207 | 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
|
208 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
209 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
210 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
211 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
212 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
213 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
214 | * Protocol Client Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
215 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
216 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
217 | PurpleProtocolClientInterface *client_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
218 | PURPLE_PROTOCOL_CLIENT_GET_IFACE(protocol); \ |
| 36726 | 219 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
220 | client_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
221 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
222 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
223 | PurpleProtocolClientInterface *client_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
224 | PURPLE_PROTOCOL_CLIENT_GET_IFACE(protocol); \ |
| 36726 | 225 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
226 | return client_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
227 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
228 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
229 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
230 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
231 | 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
|
232 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
233 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
234 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
235 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
236 | static const GTypeInfo info = { |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
237 | .class_size = sizeof(PurpleProtocolClientInterface), |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
238 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
239 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
240 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
241 | "PurpleProtocolClientInterface", &info, 0); |
|
36722
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 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
244 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
245 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
246 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
247 | purple_protocol_client_iface_get_actions(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
248 | PurpleConnection *gc) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
249 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
250 | 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
|
251 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
252 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
253 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
254 | purple_protocol_client_iface_list_emblem(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
255 | PurpleBuddy *buddy) |
|
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_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, list_emblem, buddy); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
258 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
259 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
260 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
261 | purple_protocol_client_iface_status_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
262 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
263 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
264 | 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
|
265 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
266 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
267 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
268 | purple_protocol_client_iface_tooltip_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
269 | PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
|
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 | 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
|
272 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
273 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
274 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
275 | purple_protocol_client_iface_blist_node_menu(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
276 | PurpleBlistNode *node) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
277 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
278 | 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
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
282 | purple_protocol_client_iface_buddy_free(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
283 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
284 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
285 | 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
|
286 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
287 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
288 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
289 | purple_protocol_client_iface_convo_closed(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
290 | PurpleConnection *gc, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
291 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
292 | DEFINE_PROTOCOL_FUNC(protocol, convo_closed, gc, who); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
295 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
296 | purple_protocol_client_iface_normalize(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
297 | const PurpleAccount *account, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
298 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
299 | 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
|
300 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
301 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
302 | PurpleChat * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
303 | purple_protocol_client_iface_find_blist_chat(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
304 | PurpleAccount *account, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
305 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
306 | 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
|
307 | name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
308 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
309 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
310 | gboolean |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
311 | purple_protocol_client_iface_offline_message(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
312 | const PurpleBuddy *buddy) |
|
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 | 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
|
315 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
316 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
317 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
318 | 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
|
319 | PurpleAccount *account) |
|
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 | 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
|
322 | account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
323 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
324 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
325 | PurpleMood * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
326 | purple_protocol_client_iface_get_moods(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
327 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
328 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
329 | 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
|
330 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
331 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
332 | gssize |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
333 | 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
|
334 | PurpleConversation *conv) |
|
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 | 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
|
337 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
338 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
339 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
340 | #undef DEFINE_PROTOCOL_FUNC |
|
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 | * Protocol Server Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
344 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
345 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
346 | PurpleProtocolServerInterface *server_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
347 | PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol); \ |
| 36726 | 348 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
349 | server_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
352 | PurpleProtocolServerInterface *server_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
353 | PURPLE_PROTOCOL_SERVER_GET_IFACE(protocol); \ |
| 36726 | 354 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
355 | return server_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
356 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
357 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
358 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
359 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
360 | purple_protocol_server_iface_get_type(void) |
|
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 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
363 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
364 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
365 | static const GTypeInfo info = { |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
366 | .class_size = sizeof(PurpleProtocolServerInterface), |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
367 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
368 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
369 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
370 | "PurpleProtocolServerInterface", &info, 0); |
|
36722
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 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
373 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
374 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
375 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
376 | purple_protocol_server_iface_register_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
377 | PurpleAccount *account) |
|
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 | DEFINE_PROTOCOL_FUNC(protocol, register_user, account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
380 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
381 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
382 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
383 | purple_protocol_server_iface_unregister_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
384 | PurpleAccount *account, PurpleAccountUnregistrationCb cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
385 | void *user_data) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
386 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
387 | 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
|
388 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
389 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
390 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
391 | purple_protocol_server_iface_set_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
392 | 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
|
393 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
394 | 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
|
395 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
396 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
397 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
398 | purple_protocol_server_iface_get_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
399 | 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
|
400 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
401 | 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
|
402 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
403 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
404 | void |
| 36719 | 405 | purple_protocol_server_iface_set_status(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
406 | 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
|
407 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
408 | 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
|
409 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
410 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
411 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
412 | purple_protocol_server_iface_set_idle(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
413 | 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
|
414 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
415 | 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
|
416 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
417 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
418 | void |
| 36719 | 419 | purple_protocol_server_iface_change_passwd(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
420 | 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
|
421 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
422 | 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
|
423 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
424 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
425 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
426 | purple_protocol_server_iface_add_buddy(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
427 | PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
428 | 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
|
429 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
430 | 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
|
431 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
432 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
433 | void |
| 36719 | 434 | purple_protocol_server_iface_add_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
435 | PurpleConnection *gc, GList *buddies, GList *groups, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
436 | 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
|
437 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
438 | 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
|
439 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
440 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
441 | void |
| 36719 | 442 | purple_protocol_server_iface_remove_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
443 | 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
|
444 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
445 | 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
|
446 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
447 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
448 | void |
| 36719 | 449 | purple_protocol_server_iface_remove_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
450 | 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
|
451 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
452 | 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
|
453 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
454 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
455 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
456 | purple_protocol_server_iface_keepalive(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
457 | PurpleConnection *gc) |
|
36617
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 | 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
|
460 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
461 | |
|
39518
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
462 | int |
|
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
463 | 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
|
464 | { |
|
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
465 | 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
|
466 | } |
|
6141cf90e5b8
libpurple: Make keepalive interval configurable
Petteri Pitkänen <petepitk@gmail.com>
parents:
39352
diff
changeset
|
467 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
468 | void |
| 36719 | 469 | purple_protocol_server_iface_alias_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
470 | 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
|
471 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
472 | DEFINE_PROTOCOL_FUNC(protocol, 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
|
473 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
474 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
475 | void |
| 36719 | 476 | purple_protocol_server_iface_group_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
477 | PurpleConnection *gc, const char *who, const char *old_group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
478 | 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
|
479 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
480 | 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
|
481 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
482 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
483 | void |
| 36719 | 484 | purple_protocol_server_iface_rename_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
485 | PurpleConnection *gc, const char *old_name, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
486 | 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
|
487 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
488 | 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
|
489 | moved_buddies); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
490 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
491 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
492 | void |
| 36719 | 493 | purple_protocol_server_iface_set_buddy_icon(PurpleProtocol *protocol, |
| 37134 | 494 | 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
|
495 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
496 | 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
|
497 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
498 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
499 | void |
| 36719 | 500 | purple_protocol_server_iface_remove_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
501 | 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
|
502 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
503 | 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
|
504 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
505 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
506 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
507 | purple_protocol_server_iface_send_raw(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
508 | PurpleConnection *gc, const char *buf, int len) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
509 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
510 | 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
|
511 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
512 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
513 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
514 | purple_protocol_server_iface_set_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
515 | PurpleConnection *gc, const char *alias, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
516 | PurpleSetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
517 | PurpleSetPublicAliasFailureCallback failure_cb) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
518 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
519 | 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
|
520 | failure_cb); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
521 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
522 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
523 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
524 | purple_protocol_server_iface_get_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
525 | PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
526 | PurpleGetPublicAliasFailureCallback failure_cb) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
527 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
528 | 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
|
529 | failure_cb); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
530 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
531 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
532 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
533 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
534 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
535 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
536 | * Protocol IM Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
537 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
538 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
539 | PurpleProtocolIMInterface *im_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
540 | PURPLE_PROTOCOL_IM_GET_IFACE(protocol); \ |
| 36726 | 541 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
542 | im_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
543 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
544 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
545 | PurpleProtocolIMInterface *im_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
546 | PURPLE_PROTOCOL_IM_GET_IFACE(protocol); \ |
| 36726 | 547 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
548 | return im_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
549 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
550 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
551 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
552 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
553 | purple_protocol_im_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
554 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
555 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
556 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
557 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
558 | static const GTypeInfo info = { |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
559 | .class_size = sizeof(PurpleProtocolIMInterface), |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
560 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
561 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
562 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
563 | "PurpleProtocolIMInterface", &info, 0); |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
564 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
565 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
566 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
567 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
568 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
569 | purple_protocol_im_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
| 37148 | 570 | PurpleMessage *msg) |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
571 | { |
| 37148 | 572 | 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
|
573 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
574 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
575 | unsigned int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
576 | purple_protocol_im_iface_send_typing(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
577 | PurpleConnection *gc, const char *name, PurpleIMTypingState state) |
|
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_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
|
580 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
581 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
582 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
583 | #undef DEFINE_PROTOCOL_FUNC |
|
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 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
586 | * Protocol Chat Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
587 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
588 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
589 | PurpleProtocolChatInterface *chat_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
590 | PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol); \ |
| 36726 | 591 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
592 | chat_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
593 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
594 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
595 | PurpleProtocolChatInterface *chat_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
596 | PURPLE_PROTOCOL_CHAT_GET_IFACE(protocol); \ |
| 36726 | 597 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
598 | return chat_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
599 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
600 | return defaultreturn; |
|
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 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
603 | purple_protocol_chat_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
604 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
605 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
606 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
607 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
608 | static const GTypeInfo info = { |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
609 | .class_size = sizeof(PurpleProtocolChatInterface), |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
610 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
611 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
612 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
613 | "PurpleProtocolChatInterface", &info, 0); |
|
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 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
616 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
617 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
618 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
619 | purple_protocol_chat_iface_info(PurpleProtocol *protocol, PurpleConnection *gc) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
620 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
621 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, info, gc); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
624 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
625 | purple_protocol_chat_iface_info_defaults(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
626 | PurpleConnection *gc, const char *chat_name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
627 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
628 | 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
|
629 | chat_name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
630 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
631 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
632 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
633 | purple_protocol_chat_iface_join(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
634 | GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
635 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
636 | DEFINE_PROTOCOL_FUNC(protocol, join, gc, components); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
637 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
638 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
639 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
640 | purple_protocol_chat_iface_reject(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
641 | PurpleConnection *gc, GHashTable *components) |
|
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 | DEFINE_PROTOCOL_FUNC(protocol, reject, gc, components); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
644 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
645 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
646 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
647 | purple_protocol_chat_iface_get_name(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
648 | GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
649 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
650 | 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
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
654 | purple_protocol_chat_iface_invite(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
655 | 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
|
656 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
657 | DEFINE_PROTOCOL_FUNC(protocol, invite, gc, id, message, who); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
660 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
661 | purple_protocol_chat_iface_leave(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
662 | int id) |
|
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 | DEFINE_PROTOCOL_FUNC(protocol, leave, gc, id); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
665 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
666 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
667 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
668 | purple_protocol_chat_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
| 37148 | 669 | int id, PurpleMessage *msg) |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
670 | { |
| 37148 | 671 | 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
|
672 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
673 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
674 | char * |
| 36719 | 675 | 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
|
676 | 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
|
677 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
678 | 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
|
679 | who); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
680 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
681 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
682 | void |
| 36719 | 683 | purple_protocol_chat_iface_set_topic(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
684 | 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
|
685 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
686 | 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
|
687 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
688 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
689 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
690 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
691 | |
|
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 | * Protocol Privacy Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
694 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
695 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
696 | PurpleProtocolPrivacyInterface *privacy_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
697 | PURPLE_PROTOCOL_PRIVACY_GET_IFACE(protocol); \ |
| 36726 | 698 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
699 | privacy_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
702 | PurpleProtocolPrivacyInterface *privacy_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
703 | PURPLE_PROTOCOL_PRIVACY_GET_IFACE(protocol); \ |
| 36726 | 704 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
705 | return privacy_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
706 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
707 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
708 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
709 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
710 | 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
|
711 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
712 | static GType type = 0; |
|
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 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
715 | static const GTypeInfo info = { |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
716 | .class_size = sizeof(PurpleProtocolPrivacyInterface), |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
717 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
718 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
719 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
720 | "PurpleProtocolPrivacyInterface", &info, 0); |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
721 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
722 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
723 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
724 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
725 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
726 | purple_protocol_privacy_iface_add_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
727 | 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
|
728 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
729 | 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
|
730 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
731 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
732 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
733 | purple_protocol_privacy_iface_add_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
734 | 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
|
735 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
736 | DEFINE_PROTOCOL_FUNC(protocol, add_deny, gc, name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
737 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
738 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
739 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
740 | purple_protocol_privacy_iface_rem_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
741 | PurpleConnection *gc, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
742 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
743 | DEFINE_PROTOCOL_FUNC(protocol, rem_permit, gc, name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
744 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
745 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
746 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
747 | purple_protocol_privacy_iface_rem_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
748 | PurpleConnection *gc, const char *name) |
|
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 | 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
|
751 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
752 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
753 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
754 | purple_protocol_privacy_iface_set_permit_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
755 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
756 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
757 | DEFINE_PROTOCOL_FUNC(protocol, set_permit_deny, gc); |
|
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 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
761 | #undef DEFINE_PROTOCOL_FUNC |
|
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 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
764 | * Protocol Media Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
765 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
766 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
767 | PurpleProtocolMediaInterface *media_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
768 | PURPLE_PROTOCOL_MEDIA_GET_IFACE(protocol); \ |
| 36726 | 769 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
770 | media_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
771 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
772 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
773 | PurpleProtocolMediaInterface *media_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
774 | PURPLE_PROTOCOL_MEDIA_GET_IFACE(protocol); \ |
| 36726 | 775 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
776 | return media_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
777 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
778 | return defaultreturn; |
|
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 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
781 | 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
|
782 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
783 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
784 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
785 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
786 | static const GTypeInfo info = { |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
787 | .class_size = sizeof(PurpleProtocolMediaInterface), |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
788 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
789 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
790 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
791 | "PurpleProtocolMediaInterface", &info, 0); |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
792 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
793 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
794 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
795 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
796 | gboolean |
| 36719 | 797 | purple_protocol_media_iface_initiate_session(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
798 | 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
|
799 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
800 | 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
|
801 | who, type); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
802 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
803 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
804 | PurpleMediaCaps |
| 36719 | 805 | purple_protocol_media_iface_get_caps(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
806 | 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
|
807 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
808 | 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
|
809 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
810 | |
|
37164
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
811 | 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
|
812 | 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
|
813 | { |
|
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
814 | 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
|
815 | dtmf, volume, duration); |
|
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
816 | } |
|
aea7e3b20138
Added send_dtmf to protocol media interface
Ankit Vani <a@nevitus.org>
parents:
37148
diff
changeset
|
817 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
818 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
819 | #undef DEFINE_PROTOCOL_FUNC |
|
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 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
822 | * Protocol Factory Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
823 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
824 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
825 | PurpleProtocolFactoryInterface *factory_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
826 | PURPLE_PROTOCOL_FACTORY_GET_IFACE(protocol); \ |
| 36726 | 827 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
828 | factory_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
831 | PurpleProtocolFactoryInterface *factory_iface = \ |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39757
diff
changeset
|
832 | PURPLE_PROTOCOL_FACTORY_GET_IFACE(protocol); \ |
| 36726 | 833 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
834 | return factory_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
835 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
836 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
837 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
838 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
839 | 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
|
840 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
841 | static GType type = 0; |
|
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 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
844 | static const GTypeInfo info = { |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
845 | .class_size = sizeof(PurpleProtocolFactoryInterface), |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
846 | }; |
|
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 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39668
diff
changeset
|
849 | "PurpleProtocolFactoryInterface", &info, 0); |
|
36722
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 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
852 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
853 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
854 | PurpleConnection * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
855 | purple_protocol_factory_iface_connection_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
856 | 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
|
857 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
858 | 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
|
859 | account, password); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
860 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
861 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
862 | PurpleRoomlist * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
863 | purple_protocol_factory_iface_roomlist_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
864 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
865 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
866 | 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
|
867 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
868 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
869 | PurpleWhiteboard * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
870 | purple_protocol_factory_iface_whiteboard_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
871 | 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
|
872 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
873 | 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
|
874 | who, state); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
875 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
876 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
877 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
878 | #undef DEFINE_PROTOCOL_FUNC |