libpurple/protocols/jabber/facebook.c

Fri, 10 Apr 2015 11:36:40 +0530

author
Ankit Vani <a@nevitus.org>
date
Fri, 10 Apr 2015 11:36:40 +0530
branch
soc.2013.gobjectification.plugins
changeset 37163
bdaa6ae19356
parent 36310
libpurple/protocols/jabber/libfacebook.c@723b8ecf31cd
parent 37148
libpurple/protocols/jabber/libfacebook.c@50f361d39a1e
permissions
-rw-r--r--

Merge default branch (yet to add media_send_dtmf)

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 "facebook.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 facebook_list_icon(PurpleAccount *a, PurpleBuddy *b)
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
32 {
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
33 return "facebook";
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
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
36012
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
37 facebook_login(PurpleAccount *account)
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
38 {
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
39 PurpleConnection *gc;
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
40 JabberStream *js;
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
41
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
42 jabber_login(account);
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
43
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
44 gc = purple_account_get_connection(account);
36019
b12e7444a0cb Facebook XMPP: disable some unsupported features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36012
diff changeset
45 if (!gc)
b12e7444a0cb Facebook XMPP: disable some unsupported features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36012
diff changeset
46 return;
b12e7444a0cb Facebook XMPP: disable some unsupported features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36012
diff changeset
47
b12e7444a0cb Facebook XMPP: disable some unsupported features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36012
diff changeset
48 purple_connection_set_flags(gc, 0);
b12e7444a0cb Facebook XMPP: disable some unsupported features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36012
diff changeset
49
36012
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
50 js = purple_connection_get_protocol_data(gc);
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
51 if (!js)
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
52 return;
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
53
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
54 js->server_caps |= JABBER_CAP_FACEBOOK;
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
55 }
68d162284480 XMPP: adjust facebook roster quirks
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34894
diff changeset
56
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
57 static void
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
58 facebook_protocol_init(PurpleProtocol *protocol)
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
59 {
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 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
61 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
62 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
63
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
64 protocol->id = "prpl-facebook-xmpp";
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
65 protocol->name = "Facebook (XMPP)";
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
66 protocol->options = 0;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
67 purple_protocol_override(protocol, PURPLE_PROTOCOL_OVERRIDE_ICON_SPEC);
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
68
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
69 /* 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: 32927
diff changeset
70 split = purple_account_user_split_new(_("Domain"), "chat.facebook.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
71 purple_account_user_split_set_reverse(split, FALSE);
36020
47474e8b92dd Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36019
diff changeset
72 purple_account_user_split_set_constant(split, TRUE);
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
73 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
74
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 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
76 purple_account_user_split_set_reverse(split, FALSE);
36020
47474e8b92dd Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36019
diff changeset
77 purple_account_user_split_set_constant(split, TRUE);
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
78 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
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 #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
81 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
82 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
83 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
84 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
85 }
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
86
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
87 ADD_VALUE(encryption_values, _("Require encryption"), "require_tls");
32932
0672f4626f75 Replace Facebook's UI hack for default connection security.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32930
diff changeset
88 ADD_VALUE(encryption_values, _("Use encryption if available"), "opportunistic_tls");
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
89 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
90 #if 0
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
91 ADD_VALUE(encryption_values, "None", "none");
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 #endif
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 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
94
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 #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
96
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 = 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
98 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
99 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
100
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_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
102 "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
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 }
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
106
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
107 static void
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
108 facebook_protocol_class_init(PurpleProtocolClass *klass)
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
109 {
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
110 klass->login = facebook_login;
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
111 klass->list_icon = facebook_list_icon;
36684
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
112 }
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
113
ecc74498e088 Refactored other protocols to use instance init
Ankit Vani <a@nevitus.org>
parents: 36678
diff changeset
114 static void
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
115 facebook_protocol_client_iface_init(PurpleProtocolClientIface *client_iface)
36582
095b9c85c45c Refactored jabber to use the new protocol API.
Ankit Vani <a@nevitus.org>
parents: 36545
diff changeset
116 {
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
117 client_iface->get_actions = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
118 client_iface->find_blist_chat = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
119 client_iface->blist_node_menu = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
120 client_iface->get_moods = NULL;
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
121 }
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
122
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
123 static void
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
124 facebook_protocol_server_iface_init(PurpleProtocolServerIface *server_iface)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
125 {
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
126 server_iface->register_user = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
127 server_iface->unregister_user = NULL;
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
128 server_iface->set_info = NULL;
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
129 server_iface->add_buddy = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
130 server_iface->remove_buddy = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
131 server_iface->alias_buddy = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
132 server_iface->group_buddy = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
133 server_iface->rename_group = NULL;
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
134 server_iface->set_buddy_icon = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
135 }
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
136
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
137 static void
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
138 facebook_protocol_chat_iface_init(PurpleProtocolChatIface *chat_iface)
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
139 {
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
140 chat_iface->info = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
141 chat_iface->info_defaults = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
142 chat_iface->join = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
143 chat_iface->get_name = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
144 chat_iface->invite = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
145 chat_iface->leave = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
146 chat_iface->send = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
147 chat_iface->get_user_real_name = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
148 chat_iface->set_topic = NULL;
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
149 }
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
150
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
151 static void
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
152 facebook_protocol_privacy_iface_init(PurpleProtocolPrivacyIface *privacy_iface)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
153 {
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
154 privacy_iface->add_deny = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
155 privacy_iface->rem_deny = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
156 }
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
157
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
158 static void
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
159 facebook_protocol_roomlist_iface_init(PurpleProtocolRoomlistIface *roomlist_iface)
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
160 {
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
161 roomlist_iface->get_list = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
162 roomlist_iface->cancel = NULL;
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
163 }
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
164
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
165 static void
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
166 facebook_protocol_attention_iface_init(PurpleProtocolAttentionIface *attention_iface)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
167 {
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
168 attention_iface->send = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
169 attention_iface->get_types = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
170 }
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
171
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
172 static void
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
173 facebook_protocol_media_iface_init(PurpleProtocolMediaIface *media_iface)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
174 {
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
175 media_iface->initiate_session = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
176 media_iface->get_caps = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
177 }
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
178
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
179 static void
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
180 facebook_protocol_xfer_iface_init(PurpleProtocolXferIface *xfer_iface)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
181 {
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
182 xfer_iface->can_receive = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
183 xfer_iface->send = NULL;
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
184 xfer_iface->new_xfer = 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
185 }
6a06b6cea862 Since XMPP is already a split-prpl thing, make two new prpls for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
186
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36685
diff changeset
187 PURPLE_DEFINE_TYPE_EXTENDED(
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36685
diff changeset
188 FacebookProtocol, facebook_protocol, JABBER_TYPE_PROTOCOL, 0,
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
189
36729
7f9fac14ed60 Temporarily replaced PurpleProtocolInterface with PurpleProtocolClientIface in protocols
Ankit Vani <a@nevitus.org>
parents: 36714
diff changeset
190 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_CLIENT_IFACE,
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
191 facebook_protocol_client_iface_init)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
192
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
193 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_SERVER_IFACE,
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
194 facebook_protocol_server_iface_init)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
195
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
196 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_CHAT_IFACE,
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
197 facebook_protocol_chat_iface_init)
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
198
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
199 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_PRIVACY_IFACE,
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
200 facebook_protocol_privacy_iface_init)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
201
37144
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
202 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ROOMLIST_IFACE,
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
203 facebook_protocol_roomlist_iface_init)
8b63b9948107 Merged default branch
Ankit Vani <a@nevitus.org>
parents: 36020 37038
diff changeset
204
36732
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
205 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_ATTENTION_IFACE,
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
206 facebook_protocol_attention_iface_init)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
207
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
208 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_MEDIA_IFACE,
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
209 facebook_protocol_media_iface_init)
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
210
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
211 PURPLE_IMPLEMENT_INTERFACE_STATIC(PURPLE_TYPE_PROTOCOL_XFER_IFACE,
39a42632a4c8 Refactored jabber to use the new protocol interfaces
Ankit Vani <a@nevitus.org>
parents: 36729
diff changeset
212 facebook_protocol_xfer_iface_init)
36714
ec178f7d66da Refactored protocols to use the new type definition macros
Ankit Vani <a@nevitus.org>
parents: 36685
diff changeset
213 );

mercurial