libpurple/protocols/jabber/gtalk.c

Sun, 15 Sep 2019 17:11:46 -0400

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 15 Sep 2019 17:11:46 -0400
changeset 39894
7eab91ea30a1
parent 39760
217330c81a30
child 39968
71622ee1354e
permissions
-rw-r--r--

Replace Purple type macros by GObject macros.

These were necessary to support both static and dynamic plugins, but
we're just leaving the to GPlugin now.

32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
1 /* purple
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
2 *
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
5 * source distribution.
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
6 *
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
10 * (at your option) any later version.
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
11 *
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
15 * GNU General Public License for more details.
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
16 *
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
20 *
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
21 */
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
22
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
23 #include "internal.h"
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
24 #include "chat.h"
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
25 #include "core.h"
36509
86e882c3cfdf Refactored libpurple according to the changes
Ankit Vani <a@nevitus.org>
parents: 36505
diff changeset
26 #include "plugins.h"
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
27
36665
5bef44ba334a Build a single library for jabber.
Ankit Vani <a@nevitus.org>
parents: 36653
diff changeset
28 #include "gtalk.h"
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
29
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
30 static const char *
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
31 gtalk_list_icon(PurpleAccount *a, PurpleBuddy *b)
36496
e7fe371c60a6 Refactored jabber to use the new API
Ankit Vani <a@nevitus.org>
parents: 34670
diff changeset
32 {
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
33 return "google-talk";
36496
e7fe371c60a6 Refactored jabber to use the new API
Ankit Vani <a@nevitus.org>
parents: 34670
diff changeset
34 }
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
35
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
36 static void
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
37 gtalk_protocol_init(GTalkProtocol *self)
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
38 {
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
39 PurpleProtocol *protocol = PURPLE_PROTOCOL(self);
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
40 PurpleAccountUserSplit *split;
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
41 PurpleAccountOption *option;
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
42 GList *encryption_values = NULL;
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
43
37004
c8dce7bef0e6 Change protocol IDs to prpl-*
Ankit Vani <a@nevitus.org>
parents: 36732
diff changeset
44 protocol->id = "prpl-gtalk";
36685
646c2ae00fdb Removed some spaces for better alignment
Ankit Vani <a@nevitus.org>
parents: 36684
diff changeset
45 protocol->name = "Google Talk (XMPP)";
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
46
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
47 /* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */
32929
2c6aa2ca6a52 Remove and replace the Default Domain UI hack.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32928
diff changeset
48 split = purple_account_user_split_new(_("Domain"), "gmail.com", '@');
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
49 purple_account_user_split_set_reverse(split, FALSE);
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
50 protocol->user_splits = g_list_append(protocol->user_splits, split);
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
51
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
52 split = purple_account_user_split_new(_("Resource"), "", '/');
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
53 purple_account_user_split_set_reverse(split, FALSE);
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
54 protocol->user_splits = g_list_append(protocol->user_splits, split);
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
55
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
56 #define ADD_VALUE(list, desc, v) { \
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
57 PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
58 kvp->key = g_strdup((desc)); \
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
59 kvp->value = g_strdup((v)); \
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
60 list = g_list_prepend(list, kvp); \
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
61 }
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
62
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
63 ADD_VALUE(encryption_values, _("Require encryption"), "require_tls");
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
64 ADD_VALUE(encryption_values, _("Use encryption if available"), "opportunistic_tls");
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
65 ADD_VALUE(encryption_values, _("Use old-style SSL"), "old_ssl");
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
66 encryption_values = g_list_reverse(encryption_values);
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
67
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
68 #undef ADD_VALUE
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
69
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
70 option = purple_account_option_list_new(_("Connection security"), "connection_security", encryption_values);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
71 protocol->account_options = g_list_append(protocol->account_options,
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
72 option);
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
73
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
74 option = purple_account_option_bool_new(
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
75 _("Allow plaintext auth over unencrypted streams"),
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
76 "auth_plain_in_clear", FALSE);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
77 protocol->account_options = g_list_append(protocol->account_options,
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
78 option);
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
79
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
80 option = purple_account_option_int_new(_("Connect port"), "port", 5222);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
81 protocol->account_options = g_list_append(protocol->account_options,
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
82 option);
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
83
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
84 option = purple_account_option_string_new(_("Connect server"),
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
85 "connect_server", NULL);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
86 protocol->account_options = g_list_append(protocol->account_options,
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
87 option);
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
88
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
89 option = purple_account_option_string_new(_("File transfer proxies"),
37198
5813479c8e02 Remove default XMPP file transfer proxy and replace existing defaults in user prefs. See ticket #16535. (ok'd by elb, etan, datallah)
Michael McConville <mmcconville@mykolab.com>
parents: 37163
diff changeset
90 "ft_proxies", NULL);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
91 protocol->account_options = g_list_append(protocol->account_options,
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
92 option);
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
93
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
94 option = purple_account_option_string_new(_("BOSH URL"),
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
95 "bosh_url", NULL);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
96 protocol->account_options = g_list_append(protocol->account_options,
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
97 option);
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
98
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
99 /* this should probably be part of global smiley theme settings later on,
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
100 shared with MSN */
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
101 option = purple_account_option_bool_new(_("Show Custom Smileys"),
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
102 "custom_smileys", TRUE);
37038
8832d14d7d0c Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents: 37004
diff changeset
103 protocol->account_options = g_list_append(protocol->account_options,
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
104 option);
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
105 }
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
106
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
107 static void
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
108 gtalk_protocol_class_init(GTalkProtocolClass *klass)
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
109 {
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
110 PurpleProtocolClass *protocol_class = PURPLE_PROTOCOL_CLASS(klass);
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
111
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
112 protocol_class->list_icon = gtalk_list_icon;
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
113 }
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
114
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
115 static void
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
116 gtalk_protocol_class_finalize(G_GNUC_UNUSED GTalkProtocolClass *klass)
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
117 {
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
118 }
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
119
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
120 static void
39757
4a5ba806d8c9 Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38854
diff changeset
121 gtalk_protocol_server_iface_init(PurpleProtocolServerInterface *server_iface)
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
122 {
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
123 /* disable xmpp functions not available for gtalk */
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
124 server_iface->register_user = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
125 server_iface->unregister_user = NULL;
32926
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
126 }
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
127
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
128 G_DEFINE_DYNAMIC_TYPE_EXTENDED(
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
129 GTalkProtocol, gtalk_protocol, JABBER_TYPE_PROTOCOL, 0,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
130
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
131 G_IMPLEMENT_INTERFACE_DYNAMIC(PURPLE_TYPE_PROTOCOL_SERVER,
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
132 gtalk_protocol_server_iface_init));
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
133
39894
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
134 /* This exists solely because the above macro makes gtalk_protocol_register_type
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
135 * static. */
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
136 void
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
137 gtalk_protocol_register(PurplePlugin *plugin)
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
138 {
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
139 gtalk_protocol_register_type(G_TYPE_MODULE(plugin));
7eab91ea30a1 Replace Purple type macros by GObject macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39760
diff changeset
140 }

mercurial